Repository navigation
Description
Problem Description
devops roadmap intake --title ... --body-file ... --confirm failed once to open a new issue: GitHubOperationError: Could not open the issue '<title cut to 64 characters>' in dan-petty/devops-cli (exit 1): unexpected end of JSON input. Intake then said Intake placed 0 item(s) and skipped the candidate. GitHub held no issue after it. The same command with a 3-character shorter title, 1 minute later, filed #5268. So the cause is not known: a gh call whose answer was empty, or the title. The message also cuts the title, so it does not show the title that intake sent.
Reproduction Steps
uv run devops roadmap intake --repo dan-petty/devops-cli --title "test(docs): six docs tests read the DEVOPS_CLI_CONFIG of the shell" --body-file <file> --confirmon 2026-11-12 at about 22:16Z.
Expected vs Actual Behavior
Expected: the issue is filed, or the error names the gh command, its stderr and the full title.
Actual: exit 1: unexpected end of JSON input, with no stderr of gh and a cut title.
Environment Diagnostics
devops-cli at origin/main 5645b63 (after #5264), in the devcontainer.
Logs, Traces, or Terminal Output
✓ 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: "test(docs): six docs tests read the DEVOPS_CLI_CONFIG of the shell" (GitHubOperationError: Could not open the issue 'test(docs): six docs tests read the DEVOPS_CLI_CONFIG of the she' in dan-petty/devops-cli (exit 1): unexpected end of JSON input)
Found by the builder of #5125.
Alternatives check of 2026-11-16: none.
Tool: none found.
Proposed design
Problem statement
Intake reports a failed gh issue create as GitHubOperationError: ... (exit 1): unexpected end of JSON input. That text is gh's own stderr, but intake presents it as an unlabeled blob, cuts the title to 64 characters, and omits the command. The fix names the command, labels the stderr (or says it is empty), and keeps the full title in both the store error and the intake summary.
Acceptance criteria
Requirement: Full title in the create error
When gh's stderr matches no classified failure, the error for a failed gh issue create SHALL name the full issue title that intake sent.
Scenario: A title longer than the store's 64-character cut fails to open
- WHEN A unit test calls
GitHubRoadmapStore.create_issuewith a title longer than 64 characters and a fakeghresult of exit 1 and stderrunexpected end of JSON input. - THEN The test asserts the error text contains the complete title and not the title cut to 64 characters.
Requirement: Command, exit code and stderr in the create error
When gh's stderr matches no classified failure, the error for a failed gh issue create SHALL name the gh api -X POST repos/<repo>/issues command, its exit code and its stderr.
Scenario: gh refuses the create with a validation error
- WHEN A unit test gives
GitHubRoadmapStore.create_issuea fakeghresult of exit 1 and stderrHTTP 422: Validation Failed. - THEN The test asserts the error text contains
gh api -X POST repos/dan-petty/devops-cli/issues,exit 1andstderr: HTTP 422: Validation Failed.
Requirement: gh stderr is reported as stderr
The error for a failed gh issue create SHALL label the text gh wrote to stderr as stderr, so it is not mistaken for a JSON parse failure of intake.
Scenario: gh exits nonzero with empty stdout
- WHEN A unit test gives
GitHubRoadmapStore.create_issuea fakeghresult of exit 1, empty stdout and stderrunexpected end of JSON input. - THEN The test asserts the error text contains
stderr: unexpectand notGitHub returned malformed issue after it was opened.
Requirement: Empty stderr is explicit
The error for a failed gh issue create SHALL state when the stderr of gh is empty.
Scenario: gh fails with no stderr
- WHEN A unit test gives
GitHubRoadmapStore.create_issuea fakeghresult of exit 1 and empty stdout and stderr. - THEN The test asserts the error text contains
stderr: (empty).
Requirement: Full title in the intake summary
The intake failure summary SHALL name a candidate with the complete title that intake sent.
Scenario: A new candidate with a long title fails to file
- WHEN A unit test runs
intake_candidatewithconfirm=Truefor a new candidate whose title is longer than 80 characters, and the store'screate_issueraisesGitHubOperationError. - THEN The test asserts the intake failure text contains the complete title and not the title cut to 80 characters.
Existing Tool Considered
No open, maintained tool or library covers this need. The alternatives check of 2026-11-16 searched for a library that reports a failed gh command with its stderr and the full title and found none. The closest, plumbum's ProcessExecutionError, carries argv, stdout, stderr and the return code, but the project already receives the same fields from subprocess.CompletedProcess (src/devops_cli/roadmap/stores/github_store.py:1326), so it lacks only what this change adds: the intake action, the full title and the 256-character bound. No new component is built; the change edits _failure and create_issue. The written cost is about 2,000 tokens and under one hour.
Key questions
- Should intake parse the stdout of
gh issue createwhen the command exits nonzero?: No.GitHubRoadmapStore._writealready checksproc.returncodefirst (src/devops_cli/roadmap/stores/github_store.py:1326) and returns stdout only after exit 0 (:1330);_validateparses it only after that (:1415). Theunexpected end of JSON inputin the issue is gh's own stderr, which_failureputs into the message (:1442-1447), not an intake JSON parse: an intake parse failure would readGitHub returned malformed issue after it was opened(:1419-1422). The change keeps the exit-code check and adds no second parse path. (best practice) [sources: src/devops_cli/roadmap/stores/github_store.py:1326, src/devops_cli/roadmap/stores/github_store.py:1328, src/devops_cli/roadmap/stores/github_store.py:1415, src/devops_cli/roadmap/stores/github_store.py:1447]- Rejected: Parse stdout first and add stderr to the JSON error. It hides the real gh failure and raises
unexpected end of JSON inputon empty stdout. - Chosen: Check the exit code first, then parse stdout. The store already does this (
github_store.py:1328,:1415), so a failed gh call reports its stderr before any JSON parse.
- Rejected: Parse stdout first and add stderr to the JSON error. It hides the real gh failure and raises
- What text must the intake write error show for a failed
gh issue create?: It must show the full issue title, thegh api -X POST repos/<repo>/issuescommand, the exit code, and gh's stderr labelled as stderr, orstderr: (empty)when gh wrote none. The store error is built in_failure(github_store.py:1447), and the intake summary must not cut the title again (intake.py:462). (best practice) [sources: src/devops_cli/roadmap/stores/github_store.py:975, src/devops_cli/roadmap/stores/github_store.py:1447, src/devops_cli/roadmap/intake/intake.py:462, openspec/specs/roadmap-intake-failures/spec.md:9]- Rejected: Keep the 64-character title and add stderr. The cut title does not show what intake sent, and the intake summary still hides the title (
intake.py:462). - Rejected: Show the full title and stderr but omit the command. The issue asks for the command, and the command distinguishes this create write from the store's other writes.
- Chosen: Show the full title, command, exit code and stderr. It gives the cause and the exact request, as the issue's expected behavior asks, within the existing 256-character bound.
- Rejected: Keep the 64-character title and add stderr. The cut title does not show what intake sent, and the intake summary still hides the title (
- How should the error name the
ghcommand without printing the issue body?: Name the subcommand and endpoint,gh api -X POST repos/<repo>/issues, and stop before the first-f,-For--inputfield value. The field values carry the title, body and labels; printing them would make the error long, could expose the body, and would push gh's stderr past the 256-character bound. (best practice) [sources: src/devops_cli/roadmap/stores/github_store.py:620, src/devops_cli/roadmap/stores/github_store.py:1447, src/devops_cli/security/sanitizer.py:551]- Rejected: Print the whole
ghargv, including-f body=.... The body can be long and may hold sensitive text, and the field values would push stderr past the 256-character bound. - Chosen: Print the subcommand and endpoint only. It names the command and keeps the error short, while the full title is shown separately.
- Rejected: Print the whole
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 12, 2026
Both improve the error message for failed intake writes; #3651 names the cause, the candidate adds the full title and gh stderr.devops-cli-service commentedon Nov 16, 2026
Alternatives check: none
Reason: Searches for the need (an intake error that names the gh command, its stderr and the untruncated title when
gh issue createfails) returned no relevant tool or library: the results were unrelated pages and near-miss packages (e.g. a subprocess-tee build repo) that do not surface gh's stderr or the full title. The change is an internal fix to intake's own error formatting and JSON parse of gh output, so no external tool covers it.Tool: none found
Lacks:
Searches run:
Sources:
Checked on 2026-11-16. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 17, 2026
Status set to Ready at 3f422ad (see proposed design in issue body).
devops-cli-service commentedon Nov 18, 2026
Released in v0.177.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.177.0
devops-cli-service commentedon Nov 18, 2026
Live since 2026-11-18 16:28 UTC