Skip to content

fix(roadmap): read live issue state after runner Jobs end #7063

Done

Description

@dan-petty

Problem Description

Since #6013 merged (ed82af5ef), runner Jobs that succeed and write implement.result="drafted" (Status: In Review) are misclassified as stopped at job (class=ci_infra, infra=true, empty logs) by implement_submit._report.
This leaves the item with both implement.result="drafted" and implement.stopped="job", overwrites status/in-review with status/blocked, and triggers up to 4 wasted continuation Jobs and digest clears on one item.

Three causes interact:

  1. devops-cli-runner, roadmap-stage, and devops-cli-planner-run pods act as devops-cli-service[bot] without DEVOPS_CLI_VALKEY_PASSWORD, so they write to GitHub without updating brain-issue in Valkey.
  2. webhooks.py refuses own_write webhooks before calling _remember_delivery_issue, so brain-issue keeps stale Status: In Progress state for up to 1 hour (DEFAULT_BRAIN_ISSUE_MAX_AGE_SECONDS).
  3. implement_submit._report calls _fresh(store, item.number) (store.item), which hits that stale cache, sets stops = True, removes owner/service (refreshing the cache to Status: In Review as a side effect), and then calls write_status(store, _fresh(store, item.number), StatusFacts(stopped=True), ...) without re-checking _settles_as_stop. _read_back in status_sync.py also calls cached store.issue().

Reproduction Steps

  1. Enable shared brain-issue caching (valkey-devops) in roadmap-service.
  2. Start a runner Job for a Staged item so roadmap-service caches status/in-progress in brain-issue.
  3. Within 1 hour, let the publish container finish in another pod (no Valkey access) and set status/in-review plus implement.result="drafted" on GitHub.
  4. Run the implement row (implement_submit._report).

Expected vs Actual Behavior

Expected: _report reads the authoritative post-Job issue state from GitHub, sees implement.result="drafted" (Status: In Review), clears owner/service, records implement.job_state="succeeded", and writes no stop. Own-write webhooks keep brain-issue current when newer than the cached entry.

Actual: _report reads stale status/in-progress from brain-issue, posts a false ended: succeeded stop comment, overwrites status/in-review with status/blocked (implement.stopped="job", implement.failure="ci_infra"), and schedules duplicate continuation Jobs.

Environment Diagnostics

  • Cluster incidents observed after feat(service): Cache GitHub issue and PR state in the brain from webhooks #6013 (2026-11-24T14:30Z to 2026-11-25T01:15Z) on #4416, #4649, #4650, and #4709 (v0.211.3 - v0.211.6).
  • Code locations: src/devops_cli/roadmap/stores/github_store.py, src/devops_cli/roadmap/implement/implement_submit.py, src/devops_cli/roadmap/status_sync.py, src/devops_cli/server/routes/webhooks.py.

Logs, Traces, or Terminal Output

2026-11-25T00:58:03Z devops-cli-service[bot] labeled status/in-review (PR #7032, implement.result="drafted")
2026-11-25T01:09:39Z devops-cli-service[bot] comment: The runner Job devops-cli-implement-devops-cli-4709-2e82af ended: succeeded.
2026-11-25T01:09:51Z devops-cli-service[bot] unlabeled owner/service
2026-11-25T01:10:06Z devops-cli-service[bot] unlabeled status/in-review
2026-11-25T01:10:06Z devops-cli-service[bot] labeled status/blocked
2026-11-25T01:10:10Z INFO devops_cli.roadmap.job_result: roadmap job result: job=implement repo=dan-petty/devops-cli item=#4709 result=stopped success=false class=ci_infra infra=true first_pass=false repair_rounds=0 tokens=0 seconds=597 pull=7032 version=0.211.6

Activity

  1. added
    type/bug
    source/agent
    scope/roadmap
    status/new
    effort/medium
    on Nov 25, 2026
  2. dan-petty commented on Nov 25, 2026

    @dan-petty
    OwnerAuthor
    • Priority: P1-High. Successful Jobs are misclassified as stopped, overwriting correct status and triggering up to four wasted continuation Jobs per item. The regression commit ed82af5 does not set P0: the author has no write access, and no caller attached it as evidence. A person can set P0 with the label priority/p0-critical.
    • Related: fix(roadmap): Implement writes its stop report once, on the issue #6194, which asks for a different change. Both touch implement_submit._report, but #6194 reduces duplicate stop comments while the candidate fixes a false stop caused by reading a stale Valkey cache instead of live GitHub state.
  3. added
    value/high
    priority/p1-high
    owner/agent
    status/in-progress
    and removed
    status/new
    on Nov 25, 2026
  4. added
    status/in-review
    and removed
    status/in-progress
    on Nov 25, 2026
  5. removed
    status/in-review
    owner/agent
    on Nov 25, 2026
  6. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    Contributor
  7. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-25 06:00 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/p1-highscope/roadmapsource/agenttype/bugvalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions