Skip to content

fix(roadmap): intake --title loses the issue that it opens #4873

Description

@dan-petty

Problem Description

devops roadmap intake --title ... --body-file ... --confirm loses track of the issue that it opens in two cases. The caller then cannot tell if the candidate is filed, and a retry can open the same issue two times.

  1. The create call times out. run_gh gives each gh subprocess a default timeout of 30.0 s (src/devops_cli/github/rate_limiter.py), and a timeout becomes exit 124. The create is a write, so after a timeout its result is not known: GitHub can open the issue after the client stops waiting. Intake reports the candidate as not written and says "the next run tries them again". The store write (_write in src/devops_cli/roadmap/stores/github_store.py) and the intake code have no case for a timed-out write, so no step looks for an issue that the timed-out write opened. On 2026-11-11 at about 22:50 UTC, one create call passed 30 s. GitHub did not open that issue, and a second run filed it.
  2. The Service intake places the new issue first. On 2026-11-11 at 23:38 UTC, a local run opened feat(monitoring): show soft-cap and fix-check results with alerts #4868. The Service intake (event-driven on a new issue) wrote its reason comment and labels 35 s later. The local run then printed "Intake placed 0 item(s)" with exit 0, and no "Filed #N." line. feat(monitoring): show soft-cap and fix-check results with alerts #4868 was filed, labelled and linked to its source, but the output said that nothing was placed. A caller that reads the output files the candidate again.

Reproduction Steps

  1. Case 1: run devops roadmap intake --title ... --confirm when GitHub is slow, so that the create call takes more than 30 s.
  2. Case 2: run devops roadmap intake --title ... --confirm while the roadmap Service receives issue webhooks. When the Service places the new issue before the local run writes its labels, the local run reports 0 items.

Expected vs Actual Behavior

Expected: intake prints "Filed #N." for every issue that it opened, in both cases. After a timed-out create, intake reads the newest issues once and uses an open issue with the same title and source; it sends no second create in the same run.

Actual, case 1: GitHubOperationError: Could not open the issue '<title>' ... (exit 124): GitHub API command timed out after 30.0 seconds, "Intake placed 0 item(s)", and "the next run tries them again", with no check.

Actual, case 2: "Intake placed 0 item(s)", exit 0, no "Filed #N." line, and no error, while the issue exists.

Environment Diagnostics

devops-cli at origin/main d83c7d9 (release 0.113.0), devcontainer, uv run devops; the roadmap Service ran its event-driven intake.

Logs, Traces, or Terminal Output

# case 1
✓ Intake placed 0 item(s).
✗ Intake finished with candidates it could not write: the writes failed for 1 candidate(s), and intake skipped them after writing the others; the next run tries them again: "<title>" (GitHubOperationError: Could not open the issue '<title>' in dan-petty/devops-cli (exit 124): GitHub API command timed out after 30.0 seconds)
Elapsed: 2m 58s

# case 2 (the issue #4868 exists)
  - writes: file the issue with source/agent; sub-issue of #4843; label type/feature; label scope/monitoring; Status New; Value Medium; Effort Low; reason comment; Priority P2-Medium
✓ Intake placed 0 item(s).
Elapsed: 5m 37s

Acceptance Criteria

  • A test with a fake gh that times out on the create: intake reads the newest issues once, finds the issue with the same title and uses it; with no such issue it reports the candidate as not written. No second create is sent in the same run.
  • A test where the issue gets its labels from another writer after the create: intake prints "Filed #N." and counts the candidate as placed.

Dependencies

None.

Alternatives check of 2026-11-27: none.
Tool: none found.
Reason: Searches found only generic HTTP idempotency documentation and no open, maintained tool or library that reconciles a timed-out issue create or reports an issue another writer placed; the fix belongs in the project's own store and intake code.

Proposed design

Problem statement

devops roadmap intake --confirm can open an issue and then lose it. A timed-out create leaves the issue state unknown, and a timed-out read after a create loses the known issue number. The Service intake can label the new issue before the local run does. Intake then reports zero placed items or the candidate as not written, so a caller can file a duplicate. The change reconciles a timed-out create with one read of the newest issues, prints Filed #N. for every opened issue, and counts an issue that another writer placed.

Acceptance criteria

Requirement: Reconcile a timed-out create

The store SHALL read the newest issues once and return an open issue with the same title and source label after a create timeout.

Scenario: Timed-out create finds the issue

  • WHEN The fake gh exits 124 on the create and the newest issues page holds an open issue with the same title and source label.
  • THEN create_issue returns that issue and the fake gh records one create call.

Requirement: Report a timed-out create with no match

Intake SHALL report the candidate as not written when a timed-out create has no open issue with the same title and source.

Scenario: Timed-out create finds no issue

  • WHEN The fake gh exits 124 on the create and the newest issues page holds no open issue with the same title and source label.
  • THEN Intake reports the candidate as not written and the fake gh records one create call.

Requirement: Print the filed issue

Intake SHALL print Filed #N. for each issue that create_issue returns, before it writes the remaining labels.

Scenario: Another writer labels the issue first

Requirement: Count a placement by another writer

Intake SHALL count a candidate as placed when its issue holds a priority/* label after the writes, including a label that another writer set.

Scenario: The Service places the issue

  • WHEN The created issue already holds a priority/* label from the Service intake.
  • THEN Intake prints Intake placed 1 item(s). and exits 0.

Requirement: Report a failure after the create

Intake SHALL print Filed #N. with the failed step after a create succeeds, and it MUST NOT print the next-run message.

Scenario: A read after the create times out

Existing Tool Considered

The alternatives check in the issue body records none; no open, maintained tool or library covers this need. The change builds its own code in GitHubRoadmapStore.create_issue and intake: 40,000 tokens to build, 12,000 tokens to keep and fix, and 2 days elapsed.

Key questions

  • How does the store find the issue that a timed-out create opened?: GitHubRoadmapStore.create_issue reads the first page of the newest issues once, newest first. It returns the first open issue whose title and source label match the create. If none matches, it raises the timeout failure. (best practice) [sources: src/devops_cli/roadmap/stores/github_store.py, src/devops_cli/github/rate_limiter.py]
    • Chosen: Read the first page of the newest issues and match title and source label. It is one bounded read, and the issue asks for one read of the newest issues.
    • Rejected: Read the whole issue listing. It is unbounded and slow; the issue asks for one read of the newest issues.
    • Rejected: Search GitHub issues by title. The search index can lag a just-created issue, and it is not the store's issue listing.
    • Rejected: Retry the create. A retry can open a duplicate, and the issue forbids a second create in the same run.
  • Which value identifies the source of a candidate in the create request?: The source is the source label in the labels sequence that create_issue sends. The store matches that label exactly. [sources: src/devops_cli/roadmap/stores/github_store.py]
  • Where should the timed-out create be reconciled?: GitHubRoadmapStore.create_issue holds the title and the source label, and it returns the issue record. The generic _write stays unchanged. (best practice) [sources: src/devops_cli/roadmap/stores/github_store.py, src/devops_cli/github/rate_limiter.py]
    • Chosen: In GitHubRoadmapStore.create_issue. It holds the title and the source label, and it can return the issue that the read finds. A generic write cannot reconcile a comment or a label.
    • Rejected: In _write for every write. A timed-out comment or label write has no read-back that identifies it, so a generic path would be misleading.
    • Rejected: In the intake code. Intake would duplicate the store's newest-issues read and its payload validation.
  • Does a timed-out create get a retry in the same run?: No. The store reads the newest issues once and sends no second create in the same run. If no issue matches, intake reports the candidate as not written and a later run may try again. (best practice) [sources: src/devops_cli/github/rate_limiter.py, src/devops_cli/roadmap/stores/github_store.py]
    • Chosen: No retry; reconcile once. A retry can open a duplicate, and the issue requires no second create in the same run.
    • Rejected: Retry the create once. GitHub may have opened the issue after the timeout, so a retry opens a duplicate.
    • Rejected: Retry with an idempotency key. GitHub's issue creation has no idempotency key, as the alternatives check found.
  • How should intake report and count a created issue when another writer labels it first?: Intake prints Filed #N. as soon as the create result gives the issue number. It counts the candidate as placed when the issue holds a priority/* label after its writes, including a label that another writer set. (best practice) [sources: src/devops_cli/roadmap/intake/intake_requests.py, src/devops_cli/roadmap/stores/github_store.py, CONTEXT.md]
    • Chosen: Print on create and count when the issue is an Item. The create proves the issue exists, and an Item is an issue with a priority label, whichever writer set it.
    • Rejected: Count only when the local run writes the priority label. This is the reported bug: the Service writes the label first, so the local run counts zero.
    • Rejected: Read the issue after every write and count only the store's own writes. It still loses the placement when another writer writes the same label first.
  • How should intake report a failure that comes after the create?: The create result gives the issue number. Intake keeps the number and uses it when a later step fails. It prints Filed #N. and the failed step, and it does not print the next-run message. It keeps exit 1. (best practice) [sources: src/devops_cli/roadmap/intake/intake_requests.py, src/devops_cli/roadmap/stores/github_store.py, src/devops_cli/github/rate_limiter.py]
    • Chosen: Carry the created issue number from the create result. The number is a structured value, and the issue exists even when a later read fails.
    • Rejected: Parse the issue number from the error text. The text is brittle, and it gives no number when the failure does not name one.
    • Rejected: Treat the candidate as not written. This loses a created issue and tells the caller to file it again.
    • Rejected: Retry the read in the same run. The issue asks for a report of the failed step, not a second read.
  • What exit code marks a gh timeout?: Exit code 124. _execute_gh_single_attempt returns it when subprocess.TimeoutExpired ends the gh call. [sources: src/devops_cli/github/rate_limiter.py]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

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 bug can open duplicate issues or hide a filed issue from the caller, but a manual check or retry is a workaround.
    • Value: Medium. It prevents duplicate issues and gives the caller a reliable signal that the candidate was filed.
    • Effort: Medium. It needs timeout recovery logic, a race-condition check, and two new tests with a fake gh.
    • Related: fix(roadmap): intake retries a changed item; schedule errors show #4042, which asks for a different change. Both fix intake error handling, but #4042 handles RoadmapItemChangedError as a failed placement while this candidate handles a timed-out create and a race with another writer.
  3. added
    priority/p2-medium
    on Nov 12, 2026
  4. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor

    Alternatives check: none

    Reason: Searches for GitHub idempotency keys on issue creation, for a library that reconciles a write whose outcome is unknown after a timeout, and for tooling to fake a gh create that times out found no tool or library that addresses this; GitHub's issue creation offers no idempotency key, and nothing generic can decide that an open issue with the same title and source is the one a timed-out create opened. The behaviour the issue asks for is specific to intake's own store write and output (one read of the newest issues, no second create in the run, and counting a placement another writer labelled), so it has to be implemented in github_store._write and the intake code.

    Tool: none found

    Lacks:

    • No tool reconciles a timed-out gh issue create by reading the newest issues once and matching title and source
    • No tool treats an issue placed by another writer (the Service intake) as placed and prints "Filed #N."
    • No tool suppresses a second create in the same run after an unknown-outcome write

    Searches run:

    • python library idempotent write after timeout reconcile by reading back resource, results: 5
    • GitHub API create issue idempotency key timeout duplicate issue, results: 5
    • fake gh CLI for tests pytest simulate timeout subprocess, results: 5
    • pytest-subprocess fake command timeout, results: 5
    • PyGithub create issue timeout retry duplicate, results: 5
    • "idempotency" GitHub REST API issue creation not supported, results: 5
    • pypi pytest-subprocess, results: 5
    • idempotency key library python, results: 5
    • tenacity python retry library, results: 5
    • GitHub CLI gh issue create timeout exit 124 retry duplicate issue, results: 5

    Checked on 2026-11-14. A person decides what this means for the item. The check changes no label and closes no issue.

  5. added
    status/ready
    and removed
    status/new
    on Nov 15, 2026
  6. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at ca62d6a (see proposed design in issue body).

  7. dan-petty commented on Nov 19, 2026

    @dan-petty
    OwnerAuthor

    This comment adds a third case: the create succeeds, then the read of the new issue times out, and intake reports the candidate as not written.

    On 2026-11-19, devops roadmap intake --title "fix(roadmap): a tool the item names gets covers, not in-use" --body-file <file> --confirm printed:

    ✓ Intake placed 0 item(s).
    ✗ Intake finished with candidates it could not write: the writes failed for 1 candidate(s), and intake skipped them after writing the others; the next run tries them again: "fix(roadmap): a tool the item names gets covers, not in-use" (GitHubOperationError: Could not read issue #6443 in dan-petty/devops-cli (exit 124): gh api repos/dan-petty/devops-cli/issues/6443; stderr: GitHub API command timed out after 30.0 seconds)
    

    The exit code was 1. But #6443 exists, with the title, the labels type/bug, priority/p2-medium, source/agent, scope/roadmap, status/new, value/medium and effort/medium, and the intake reason comment. A run that follows the advice "the next run tries them again" files the same candidate again.

    The error text names the new issue number (#6443), so intake knows the create succeeded. The fix of this item can use that number: after a failure that comes after the create, intake reports "Filed #N" with the step that failed, and it does not tell the caller to run again.

  8. devops-cli-service commented on Nov 26, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See the section Proposed design of the body.

  9. added
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 28, 2026
  10. removed
    status/in-review
    owner/agent
    on Nov 28, 2026
  11. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-28 20:38 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