Skip to content

feat(roadmap): Stop the implement step early on stalls and refusals #4115

Open

Description

@dan-petty

Problem Description

The implement runner permits a step to consume its entire token budget when progress is stalled.

In issue #3075, the implement runner executed Group 1. The task group contained 19 fault injection test cases. The runner executed 68 model requests and consumed 8,024,412 tokens before it stopped with LimitReached.

During this run, the agent encountered repeated command refusals and failing test attempts with no code progress. The implement runner continued until it exhausted roadmap.implement.step_token_budget. This consumed significant compute and model tokens without producing a commit.

Reproduction Steps

  1. Run an implement runner job on a task group with an extensive testing matrix.
  2. Let the agent fail repeatedly or encounter refused commands.
  3. Observe that the runner makes requests until it exhausts the 8,000,000 token budget.

Expected vs Actual Behavior

Expected: The implement runner detects lack of progress or repeated tool refusals and halts the step early.
Actual: The implement runner loops until it exhausts the entire step token budget.

Proposed Solution

Add loop detection and tool refusal limits to src/devops_cli/roadmap/implement/implement_step.py:

  1. Track consecutive refused tool executions and consecutive failing test runs without file edits.
  2. When the count exceeds a configured threshold, stop the step with a clear FailureClass.
  3. Provide an early failure report to the roadmap store instead of spending the full token budget.

Environment Diagnostics

  • DevOps CLI Version: 0.86.0
  • Python Version: 3.14.10
  • Execution Environment: Roadmap Service Implement Runner

Dependencies

Activity

  1. added
    type/feature
    priority/p2-medium
    source/agent
    scope/roadmap
    on Nov 8, 2026
  2. changed the title [-]feat(roadmap): stop implement step early on repeated command refusals and stagnant iterations[/-] [+]feat(roadmap): Stop the implement step early on stalls and refusals[/+] on Nov 8, 2026
  3. devops-cli-service commented on Nov 8, 2026

    @devops-cli-service
    Contributor

    The job shortened the title of this item. The summary had 78 characters, and the limit is 60. The type and the scope stay.

    • Before: feat(roadmap): stop implement step early on repeated command refusals and stagnant iterations
    • After: feat(roadmap): Stop the implement step early on stalls and refusals
    • Source of the summary: the background model
  4. dan-petty commented on Nov 20, 2026

    @dan-petty
    OwnerAuthor

    Frozen on 2026-11-20. The stage, implement and fix-checks jobs grade under 60%, so the owner rule asks for a re-architecture before more fixes inside the current design (tracker #6519). This item is incremental work on those jobs, so its Dependencies section now names #6521 first. Stage and implement leave this item while #6521 is open. When the experiments of #6519 decide, a person closes #6521 (this item can then continue) or closes this item as not planned.

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

    priority/p2-mediumscope/roadmapsource/agenttype/feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions