Skip to content

fix(config): refuse typesafe/jev-router as a decision model #6361

Done

Description

@dan-petty

Problem

The settings check accepts typesafe/jev-router as a decision model, but that model is a chat router that writes text.

  • is_decision_model_name (src/devops_cli/config/settings.py:928-938) accepts each name that starts with CONST_AI_JEV_MODEL_TARGETS (typesafe/jev-, jev-). A local run gives True for typesafe/jev-router and jev-router. A config with ai.decision_model: typesafe/jev-router loads as valid.
  • _is_jev_decision_name (src/devops_cli/ai/pydantic_ai_bridge.py:125-127) gives True for openai-chat:jev-router too. So a task route with that name becomes a SystemOneModel, and its calls fail. pydantic_ai_bridge.py:68 uses the same prefix test.
  • The public OpenRouter models API (GET https://openrouter.ai/api/v1/models) lists typesafe/jev-router with output modality text and prompt price -1. The OpenRouter guide says that Jev picks the model and the picked model writes the reply.
  • The field text of ai.decision_model says that a model that writes text is refused. The check does not do that.
  • The gain is preventive. No config, template or code names jev-router now (git grep is empty). A later router trial with a name that starts with jev- would hit it.

Expected

  • The check accepts a Jev name only when a version follows jev-, for example the pattern ^(typesafe/)?jev-\d. The same rule applies in the prefixed branch of is_decision_model_name and in pydantic_ai_bridge.py:68.
  • Test first: the settings load refuses ai.decision_model: typesafe/jev-router. A task route openai-chat:jev-router does not become a SystemOneModel. typesafe/jev-1.14 and jev-1.13 still pass.

Alternatives check of 2026-11-19: none.
Tool: none found.
Reason: Searches found no open library that validates decision-model names; the fix is a project-internal regex shared by settings.py and pydantic_ai_bridge.py, which no external tool supplies.

Lacks:

  • A version requirement after the jev- prefix
  • Refusal of openai-chat:jev-router in task routes
  • One shared prefix rule for settings and bridge tests

Proposed design

Problem statement

The settings check accepts typesafe/jev-router as a decision model because it matches the typesafe/jev- prefix. The bridge then builds a SystemOneModel for openai-chat:jev-router, and its calls fail. The change requires a version digit after jev- and refuses router names while keeping typesafe/jev-1.14 and jev-1.13.

Acceptance criteria

Requirement: Unprefixed router names are refused

The decision-model name check SHALL accept a Jev name only when a digit follows jev-.

Scenario: Router target is refused

  • WHEN a test calls is_decision_model_name with typesafe/jev-router and with jev-router
  • THEN both calls return False.

Requirement: Versioned Jev names stay accepted

The decision-model name check SHALL accept versioned Jev names.

Scenario: Versioned targets pass

  • WHEN a test calls is_decision_model_name with typesafe/jev-1.14 and with jev-1.13
  • THEN both calls return True.

Requirement: Settings refuse router decision model

The settings loader SHALL refuse a config whose ai.decision_model is typesafe/jev-router.

Scenario: Config load fails

  • WHEN a test loads a config with ai.decision_model: typesafe/jev-router
  • THEN the load raises a validation error and returns no valid settings object.

Requirement: Prefixed router name is refused

The prefixed-name check SHALL refuse openai-chat:jev-router as a Jev decision model.

Scenario: Prefixed router target is refused

  • WHEN a test calls is_decision_model_name with openai-chat:jev-router and calls _is_jev_decision_name with the same name
  • THEN both calls return False.

Requirement: Bridge route avoids SystemOneModel

The bridge SHALL NOT build a SystemOneModel for the task route openai-chat:jev-router.

Scenario: Router task route stays a chat model

  • WHEN a test calls resolve_pydantic_ai_model for the task route openai-chat:jev-router with a chat provider
  • THEN the result is not an instance of SystemOneModel.

Requirement: Bridge uses the shared Jev target rule

The bridge SHALL call is_jev_model_target at src/devops_cli/ai/pydantic_ai_bridge.py:68.

Scenario: Shared target rule refuses router

  • WHEN a test calls is_jev_model_target with jev-router and with typesafe/jev-router
  • THEN both calls return False.

Existing Tool Considered

The alternatives check of 2026-11-19 records verdict none with no tool. The alternatives block in the issue body gives its searches and lacks. The change builds a shared project regex. Written cost: about 10k tokens and 1 hour to write, test and keep that code.

Key questions

  • What name pattern identifies a Jev decision model?: A Jev target matches ^(typesafe/)?jev-\d. The name must have a digit after jev-, so jev-router and typesafe/jev-router do not match, while jev-1.13 and typesafe/jev-1.14 do. (best practice) [sources: src/devops_cli/config/settings.py:928, src/devops_cli/config/constants.py:3077, src/devops_cli/ai/pydantic_ai_bridge.py:125]
    • Rejected: Keep the current prefix match. It accepts typesafe/jev-router and jev-router, so a chat router becomes a decision model.
    • Chosen: Require a version digit after jev-. It keeps typesafe/jev-1.14 and jev-1.13 and refuses names with no version.
  • Where should the version rule live so the settings check and the bridge cannot drift?: Add is_jev_model_target in src/devops_cli/config/settings.py. Use it in is_decision_model_name, in _is_jev_decision_name, and at src/devops_cli/ai/pydantic_ai_bridge.py:68. (best practice) [sources: src/devops_cli/config/settings.py:928, src/devops_cli/ai/pydantic_ai_bridge.py:68, src/devops_cli/ai/pydantic_ai_bridge.py:125]
    • Rejected: Duplicate the regex in both files. Two copies can drift, and the issue asks for one shared rule.
    • Chosen: Add one shared helper. Settings and bridge call the same rule, so a later change reaches both paths.
  • Should a valid versioned Jev name still resolve to a SystemOneModel?: Yes. typesafe/jev-1.14 must still resolve to a SystemOneModel, as the deployment spec requires. [sources: openspec/specs/roadmap-service-deployment/spec.md:93, src/devops_cli/config/settings.py:928]
  • Should a prefixed router name be refused by the prefixed branch?: Yes. The prefixed branch must apply the same version rule, so openai-chat:jev-router is not a Jev decision model and does not become a SystemOneModel. (best practice) [sources: src/devops_cli/config/settings.py:928, src/devops_cli/ai/pydantic_ai_bridge.py:125, src/devops_cli/ai/pydantic_ai_bridge.py:68]
    • Rejected: Keep the prefix-only check in the prefixed branch. It accepts openai-chat:jev-router and builds a failing SystemOneModel.
    • Chosen: Apply the version rule to the target after the prefix. It refuses the router target and keeps versioned Jev targets.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/bug
    scope/config
    source/agent
    on Nov 19, 2026
  2. dan-petty commented on Nov 19, 2026

    @dan-petty
    OwnerAuthor
  3. added
    status/new
    effort/low
    value/low
    priority/p2-medium
    on Nov 19, 2026
  4. devops-cli-service commented on Nov 19, 2026

    @devops-cli-service
    Contributor

    The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.

    Searches (10)

    Searches run:

    • validate LLM model name against OpenRouter model list library, results: 5
    • OpenRouter models API python library list model output modalities, results: 5
    • openrouter-python client models list output_modalities, results: 5
    • litellm model cost map output modality text chat model validation, results: 5
    • pydantic-ai model name validation known models, results: 5
    • typesafe jev-router decision model version, results: 5
    • devops-cli is_decision_model_name settings.py Jev model targets, results: 5
    • github openrouter models list output_modalities python package, results: 5
    • OpenRouter model routing guide router picks model writes reply, results: 5
    • OpenRouter API documentation models endpoint architecture output_modalities, results: 5

    Sources:

  5. added
    status/ready
    and removed
    status/new
    on Nov 19, 2026
  6. devops-cli-service commented on Nov 19, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See the section Proposed design of the body.

  7. added
    owner/agent
    on Nov 25, 2026
  8. removed
    status/ready
    owner/agent
    on Nov 25, 2026
  9. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    Contributor
  10. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-25 17:24 UTC

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumscope/configsource/agenttype/bugvalue/low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions