mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-09-30 20:53:15 +00:00
Some checks are pending
CI / Lint (push) Waiting to run
CI / Format check (push) Waiting to run
CI / Typecheck (push) Waiting to run
CI / Unit tests (push) Waiting to run
CI / Playwright E2E (push) Waiting to run
CI / Docker build smoke (push) Waiting to run
CI / Triage ledger up to date (push) Waiting to run
CI / ui bun.lock in sync (push) Waiting to run
* feat(models): re-add Fable 5 with admin disable toggle (port of upstream #1677) * refactor(models): convert re-added Fable 5 to Bedrock model IDs * fix(open-swe): correct Fable copy to describe provider data sharing, not ZDR The ported admin toggle description and code comments described Fable 5 as incompatible with Zero Data Retention. That is backwards: Fable 5 requires the account to opt into Bedrock provider_data_share — prompts/completions are retained and shared with Anthropic (up to 30 days, incl. human review). The old UI copy would lead an admin to believe the opposite of what enabling the toggle does. Reword the toggle description and the gate_fable_model / team_settings comments accordingly. Still off by default. Refs #171.
55 lines
2.3 KiB
Python
55 lines
2.3 KiB
Python
import pytest
|
|
|
|
from agent.dashboard.options import SUPPORTED_MODELS, provider_fallback_pair
|
|
from agent.utils.model import provider_model_kwargs
|
|
|
|
SONNET_5_ID = "bedrock_converse:us.anthropic.claude-sonnet-5"
|
|
FABLE_5_ID = "bedrock_converse:us.anthropic.claude-fable-5"
|
|
|
|
|
|
def test_sonnet_5_is_supported_with_documented_efforts() -> None:
|
|
sonnet = next(m for m in SUPPORTED_MODELS if m["id"] == SONNET_5_ID)
|
|
assert sonnet["label"] == "Sonnet 5 (Bedrock)"
|
|
assert sonnet["efforts"] == ["low", "medium", "high", "xhigh", "max"]
|
|
assert sonnet["default_effort"] == "high"
|
|
assert sonnet["supports_images"] is True
|
|
|
|
|
|
@pytest.mark.parametrize("effort", ["low", "medium", "high", "xhigh", "max"])
|
|
def test_sonnet_5_efforts_map_to_bedrock_kwargs(effort: str) -> None:
|
|
kwargs = provider_model_kwargs(SONNET_5_ID, effort, max_tokens=16_000)
|
|
assert kwargs["max_tokens"] == 16_000
|
|
fields = kwargs["additional_model_request_fields"]
|
|
assert fields["output_config"] == {"effort": effort}
|
|
assert fields["thinking"] == {"type": "adaptive", "display": "summarized"}
|
|
|
|
|
|
def test_sonnet_46_fallback_uses_sonnet_5() -> None:
|
|
assert provider_fallback_pair("bedrock_converse:us.anthropic.claude-sonnet-4-6", "xhigh") == (
|
|
SONNET_5_ID,
|
|
"xhigh",
|
|
)
|
|
|
|
|
|
def test_opus_fallback_stays_on_opus_family() -> None:
|
|
assert provider_fallback_pair("bedrock_converse:us.anthropic.claude-opus-4-7", "xhigh") == (
|
|
"bedrock_converse:us.anthropic.claude-opus-4-8",
|
|
"xhigh",
|
|
)
|
|
|
|
|
|
def test_fable_5_is_supported_with_documented_efforts() -> None:
|
|
fable = next(m for m in SUPPORTED_MODELS if m["id"] == FABLE_5_ID)
|
|
assert fable["label"] == "Fable 5"
|
|
assert fable["efforts"] == ["low", "medium", "high", "xhigh", "max"]
|
|
assert fable["default_effort"] == "high"
|
|
assert fable["supports_images"] is True
|
|
|
|
|
|
@pytest.mark.parametrize("effort", ["low", "medium", "high", "xhigh", "max"])
|
|
def test_fable_5_efforts_map_to_bedrock_kwargs(effort: str) -> None:
|
|
kwargs = provider_model_kwargs(FABLE_5_ID, effort, max_tokens=16_000)
|
|
assert kwargs["max_tokens"] == 16_000
|
|
fields = kwargs["additional_model_request_fields"]
|
|
assert fields["output_config"] == {"effort": effort}
|
|
assert fields["thinking"] == {"type": "adaptive", "display": "summarized"}
|