Skip to content

fix(roadmap): bound the stage gate returns and start no return in a drain #4900

Closed

Description

@dan-petty

Problem Description

#4869 (for #4802) made the stage gate returns a setting, roadmap.stage.gate_returns, with the default 3. The setting has only a lower limit (ge=0) and no upper limit. The return loop _Planner._returned in src/devops_cli/roadmap/stage/stage.py stops only at returns >= self._gate_returns. It does not read the stop of the Service.

  1. No hard ceiling. Each return is one more full planner run, with up to 250 model requests (CONST_ROADMAP_STAGE_MAX_REQUESTS). The docstring of _Planner.plan gives 3R + 4 planner calls for one item with a verifier. A ConfigMap value of 10 gives 34 planner calls for one item. The owner allowance to loosen the roadmap caps says that each extension has a hard ceiling.
  2. No drain guard. On SIGTERM the Service sets the stop, and the stage row starts no next item (fix(roadmap): a Service rollout stops stage rounds with no record #4485). But a return in progress starts a new planner run during the 600 s drain (CONST_SERVICE_STOP_DRAIN_SECONDS). A planner run sends model requests. The cut at the end of the drain refuses only GitHub requests, so it does not stop the run. The p90 of one planner ask is about 728 s, which is longer than the drain. The pod then gets SIGKILL at 660 s, and the round ends with no clean stop.

The release PR 0.115.0 holds #4869. The image with the setting is not live yet (the Service logs show version 0.114.1), and the live ConfigMap does not set roadmap.stage.gate_returns.

Reproduction Steps

  1. Run uv run python -c 'from devops_cli.config.settings import RoadmapStageConfig; print(RoadmapStageConfig(gate_returns=50).gate_returns)'. It prints 50.
  2. In a test, let the planner give a reply that the checks refuse, and call begin_service_stop() in the model fake after the first ask. The planner gets 3 more asks.

Expected vs Actual Behavior

Expected: a value over 3 fails the settings load with the name of the setting. After the Service stops, the job starts no return; the round ends with ServiceStoppingError and counts no failed round, as the stop before an item does.

Actual: any value loads. A return starts during the drain.

Environment Diagnostics

Logs, Traces, or Terminal Output

gate_returns: Annotated[int, Variable()] = Field(..., default=DEFAULT_ROADMAP_STAGE_GATE_RETURNS, ge=0)
if returns >= self._gate_returns:

Pre-Submission Checklist

Source: #4869

Activity

  1. added
    source/agent
    type/bug
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 12, 2026
  2. dan-petty commented on Nov 12, 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/bug. The fix prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. The setting is not live yet, but it will go live soon and the drain gap can cause a SIGKILL mid-run.
    • Value: Medium. It prevents unbounded planner runs and a hard kill during drain, which protects Service stability.
    • Effort: Medium. Adding a Pydantic upper bound is small, but the drain guard needs a stop check before each return starts.
    • Related: fix(roadmap): loosen the caps that turn a stage refusal into a loss #4802, which asks for a different change. Both work on the stage gate returns mechanism, but 4802 introduced the setting while the candidate adds an upper bound and a drain guard to it.
  3. added
    priority/p2-medium
    owner/agent
    status/in-progress
    and removed
    status/new
    on Nov 12, 2026
  4. removed
    status/in-progress
    owner/agent
    on Nov 12, 2026
  5. devops-cli-service commented on Nov 12, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-12 05:27 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/mediumpriority/p2-mediumscope/roadmapsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions