Skip to content

test(roadmap): run the limit and monitor tests with small limits #4688

Closed

Description

@dan-petty

Problem or Motivation

16 tests drive the production limits through a scripted model: 500 requests and 1,500 tool calls (src/devops_cli/config/constants.py:3354-3355), and 200 toolbox calls (constants.py:3232). The 12 slowest of them take 108.5 s with no coverage, 5.3-11.6 s each (measured).

9 implement-world tests poll the real PR-monitor timeout, which is 120 polls (src/devops_cli/config/defaults.py:890, 909). Each poll runs a real git rev-parse in PullFake (tests/support/roadmap_implement.py:437). These 9 tests take 48.9 s with the registry cached (measured).

Saving: 50-130 s of CI worker time from the limits and about 45 s from the polls (estimated).

Found by the CI and test audit of 2026-11-11. The account runs at most 20 hosted jobs at one time (measured), so each job that does no work makes the queue of each pull request longer.

Proposed Solution & Architectural Design

  • run_step and run_fix_step (src/devops_cli/roadmap/implement/implement_step.py) take an optional limits: UsageLimits, and ToolboxClient (src/devops_cli/roadmap/stage/stage_toolbox.py) takes an optional budget. The constants are the defaults.
  • The tests pass small limits (for example 6 requests, 12 tool calls and a budget of 8) and keep their relative asserts.
  • One test asserts that the defaults equal the constants.
  • Set roadmap.implement.monitor_timeout_seconds small in the implement-world config.
  • fix(roadmap): halt implement step on consecutive command refusals #4043 changes implement_step.py now. Start after it merges.

Risk: The tests no longer run at the exact production numbers. The test of the defaults covers the wiring.

Target Subsystem

AI & Agentic Review Pipeline (src/devops_cli/roadmap/implement/, src/devops_cli/roadmap/stage/stage_toolbox.py, tests/support/roadmap_implement.py).

Existing Tool Considered

UsageLimits of pydantic-ai, which the code already uses. No new tool. Cost: about 30,000 tokens and 2 hours.

Acceptance Criteria

  • Each limit test takes 2 s or less with no coverage.
  • Each monitor test polls 5 times or less.
  • One test proves that the default limits equal the constants.

Dependencies

None. Start after #4043 merges, because it changes the same file.

Activity

  1. added
    source/agent
    type/test
    scope/roadmap
    status/new
    value/medium
    effort/low
    on Nov 11, 2026
  2. dan-petty commented on Nov 11, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/test. The test prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. It saves 95 to 175 s of CI time per run, which is valuable but not a blocking defect.
    • Value: Medium. It shortens CI queue time for every pull request by removing 95 to 175 s of idle test work.
    • Effort: Low. The change edits test configs, adds one assertion, and sets a small timeout; the author estimates 2 hours.
    • Related: perf(ci): the Tests & Coverage check averages 382 s on main, over the 5-minute limit #2699, which asks for a different change. Both reduce CI test duration, but #2699 targets the overall check time while this candidate changes specific limit and monitor tests to use small values.
  3. added
    priority/p2-medium
    owner/agent
    status/in-progress
    and removed
    status/new
    on Nov 11, 2026
  4. removed
    status/in-progress
    owner/agent
    on Nov 12, 2026
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/roadmapsource/agenttype/testvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions