Skip to content

[codex] Block legacy fine-tuned SAM3 loads#2278

Draft
hansent wants to merge 2 commits intomainfrom
codex/block-legacy-sam3-loads
Draft

[codex] Block legacy fine-tuned SAM3 loads#2278
hansent wants to merge 2 commits intomainfrom
codex/block-legacy-sam3-loads

Conversation

@hansent
Copy link
Copy Markdown
Collaborator

@hansent hansent commented Apr 27, 2026

Summary

  • block fine-tuned SAM3 legacy loads during Roboflow model type resolution when SAM3_FINE_TUNED_MODELS_ENABLED is disabled
  • return a dedicated 501 deployment-level error instead of falling through to a generic failure after model construction
  • add regression coverage for both the registry guard and the HTTP error mapping

Why

The legacy /{dataset}/{version} inference path could resolve a fine-tuned SAM3 model, instantiate SegmentAnything3, and download large SAM3 weights even on deployments where fine-tuned SAM3 loading is disabled. Inference then failed later because that endpoint cannot actually serve SAM3. This change short-circuits that path before model construction and weight download.

Impact

Serverless or otherwise restricted deployments now reject fine-tuned SAM3 model IDs earlier and more clearly, while core sam3/... models continue to work as before.

Validation

  • PYTHONPATH=/Users/hansent/.codex/worktrees/e7e5/inference/inference_models:/Users/hansent/.codex/worktrees/e7e5/inference uv run --no-project --with-requirements requirements/requirements.test.unit.txt pytest tests/inference/unit_tests/core/registries/test_roboflow.py tests/inference/unit_tests/core/interfaces/http/test_error_handlers.py
  • result: 65 passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant