Skip to content

fix(ai): set the Jev context window from the model data #5209

Closed

Description

@dan-petty

Problem or Motivation

CONST_AI_JEV_CONTEXT_WINDOW is 262_144 (src/devops_cli/config/constants.py:2899). But genai-prices gives context_window=32000 for typesafe/jev-1.14 (genai_prices/data.py:26216). CONST_ROADMAP_JEV_MAX_DIFF_TOKENS is a fourth of the constant (constants.py:2919). So the completeness check (#4308) can send a diff that is larger than the window of the model.

Proposed Solution & Architectural Design

Read the window from genai-prices for CONST_AI_JEV_MODEL, in place of the constant. Make the diff cap from that value. The completeness check then skips a draft whose diff holds more than 8,000 model tokens.

Files: src/devops_cli/config/constants.py, src/devops_cli/ai/jev.py, tests/ai/test_jev.py.

Target Subsystem

AI & Agentic Review Pipeline (src/devops_cli/ai/jev.py, the Jev limits).

Existing Tool Considered

genai-prices, which is already a dependency. Cost: about 0.1M model tokens and 1 hour.

Acceptance Criteria

  1. uv run devops ci fail-to-pass --base origin/main shows a test that fails on main and passes on the branch: the Jev window is equal to the genai-prices value for CONST_AI_JEV_MODEL.
  2. The completeness tests pass with the new cap.

Dependencies

None.

Related

Source: #5199

Activity

  1. added
    source/agent
    on Nov 12, 2026
  2. added
    type/bug
    scope/ai
    status/new
    value/medium
    effort/low
    on Nov 12, 2026
  3. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor
  4. added
    priority/p2-medium
    on Nov 12, 2026
  5. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor

    A possible cause of the completeness no-go (2026-11-12)

    The decision-model study found that this error may explain part of the no-go of stage_ready.completeness (#4320: 47 cases, 43% recall, 28% false holds).

    • CONST_ROADMAP_JEV_MAX_DIFF_TOKENS is CONST_AI_JEV_CONTEXT_WINDOW // 4, so 65,536 tokens (src/devops_cli/config/constants.py:2860 on origin/main 5645b63). That cap is more than 2 times the window of 32,000 tokens of typesafe/jev-1.14.
    • So the pilot could send a diff that does not fit the window. The result "Jev does not read a long diff" can then be partly a window overflow, not only a limit of the model.
    • The study did not count how many of the 47 cases had a diff over the window.

    Recommendation: fix this item before #4317 redoes the completeness builder, and count the pilot cases with a diff over the window. The point stays off until then.

  6. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor

    Scope note from the decision-model docs review of 2026-11-12. The owner approved it on 2026-11-12. One cause gives this item and #4296.

    The documents say:

    The shared cause: SystemOneModel reports the provider system-one, which genai-prices 0.2.3 does not know. An offline lookup (sockets blocked) gives None for the window with provider system-one and a gateway URL, and also for the model name alone. With provider openrouter, it gives 32000. The price lookup fails in the same way (#4296). So the proposed fix of this item ("Read the window from genai-prices for CONST_AI_JEV_MODEL") gets None unless it names the provider. SystemOneModel also drops usage.cost and the response id that OpenRouter returns in every response.

    Change to this item:

    1. Read the window with provider openrouter, or set the profile context_window from genai-prices for that provider.
    2. Add a budget of about 32,000 bytes (UTF-8) for the state and the questions, so that requests stay out of the long-context mode. Count bytes, not characters. fix(ai): ask-jev refuses no context and reports unsure #5284 (ask-jev) and feat(roadmap): the Jev completeness check sees a removed hunk #4317 (completeness) use the same budget.
    3. 262,144 is the hard window of the long-context mode, not the edge of the default mode. Keep it only if a reader needs the hard limit.
  7. added
    status/in-progress
    and removed
    status/new
    on Nov 15, 2026
  8. added
    status/in-review
    and removed
    status/in-progress
    on Nov 15, 2026
  9. removed
    status/in-review
    on Nov 15, 2026
  10. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    Contributor
  11. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-15 12:41 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/aisource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions