Skip to content

fix(roadmap): stage return comment repeats a degenerate reply #4618

Description

@dan-petty

Problem Description

When the stage job returns an item to New at CONST_ROADMAP_STAGE_PLAN_DEFECT_LIMIT, and the last failure is a degenerate reply (a placeholder in every text of the plan), the return comment shows the same problem two times.

_Planner._stop_degenerate in src/devops_cli/roadmap/stage/stage.py adds the degenerate reply with MESSAGES.roadmap.stage_degenerate to self._refused. It does not set self._stopped_by_checks. Then _return_plan_defects adds failure.reason, which is the same stage_degenerate text, after the refused problems. The result is two bullets that are the same.

PR #4537 (issue #4491) added this regression. Before #4537, failure.problems or (reason,) gave one bullet. The spec requirement in openspec/specs/roadmap-stage/spec.md says the comment gives the reason of the failure "unless the checks refused the last reply". The job keeps and logs the degenerate reply as a refused reply (result=degenerate), so the comment must not give its problem again.

The limit can occur on this path. RoadmapStageDegenerateError is a subclass of RoadmapStageError, so the failure class is plan_defect and it counts toward the limit. A degenerate reply repeats on the same body, because the same request gives the same reply.

Reproduction Steps

  1. Use a worktree at origin/main (after merge commit 9c666ea).
  2. In tests/roadmap/stage/test_roadmap_stage_plan_defect_limit.py, add a round test: _two_items(...), then _fail_to_the_limit(store, 1, less=1). The plan answer for item 1 is _placeholders() from tests/roadmap/stage/test_roadmap_stage_refused_reply.py. Run one round with _run_stage_adapter.
  3. Assert that item 1 is New and that _bullets(comment) has no two bullets that are the same.

Expected vs Actual Behavior

Expected: the return comment has one bullet for the degenerate reply.

Actual: the return comment has two bullets that are the same: - Every text of the plan reply is a placeholder, such as xorplaceholder. The same request gives the same reply, so the job sends no second request. The assert len(bullets) == len(set(bullets)) fails with assert 2 == 1.

Environment Diagnostics

devops-cli main at 1936572. Python test run with uv run pytest. No live system is necessary.

Logs, Traces, or Terminal Output

>       assert len(bullets) == len(set(bullets))
E       AssertionError: assert 2 == 1
FAILED tests/roadmap/stage/test_roadmap_stage_plan_defect_limit.py::test_scratch_degenerate_reply_at_the_limit_gives_one_bullet
1 failed in 15.80s

Proposed fix

Set self._stopped_by_checks = True in _Planner._stop_degenerate before the raise. The degenerate reply is a reply that the job refused and kept, and its problem is the failure reason. Add the round test above as the fail-to-pass test. The spec text needs no change.

Pre-Submission Checklist

  • I have verified that no sensitive credentials, private keys, or internal tokens are contained in this issue report.
  • I have checked existing issues and pull requests to ensure this is not a duplicate.

Source: #4537

Activity

  1. added
    type/bug
    source/agent
    scope/roadmap
    status/new
    value/low
    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/bug. The fix prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P3-Low. The item is returned correctly; only the comment text repeats one bullet, which is cosmetic.
    • Value: Low. Users see a repeated line in a comment; no functional impact.
    • Effort: Low. The fix is one boolean assignment plus one test case.
    • Related: fix(roadmap): stage retries a refused plan with no cap #4491, which asks for a different change. Both concern the stage plan defect limit path; #4491 adds the cap, this candidate fixes a duplicate bullet its PR introduced in the return comment.
  3. added
    priority/p3-low
    on Nov 11, 2026
  4. added
    status/in-review
    and removed
    status/new
    on Nov 14, 2026
  5. removed
    status/in-review
    on Nov 14, 2026
  6. added a commit that references this issue on Nov 14, 2026
  7. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor
  8. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-14 15:02 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/p3-lowscope/roadmapsource/agenttype/bugvalue/low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions