Repository navigation
Description
Split from #3503.
Split from #3503. The evidence comments on #3049, #3076, #2754 and #2740 ask a person to run devops roadmap return --comment `` --confirm. They state that the command fails with 401 in an agent session. Nobody verified this 401. If it holds, a person cannot deliver the evidence from an agent session. #3503 copies the evidence of a closed plan pull request with the Service's own store call, so the 401 does not block that copy. A reproduction needs a live agent session with the App token, which the refine investigation cannot run. A fix of the token scope or of the error is a separate change. Acceptance criteria: A run of devops roadmap return --comment `` --confirm in an agent session states its result, and the record quotes the output. When the run fails with 401, the record names the cause. When the run fails with 401, the fix makes the command write the comment and set Status New from an agent session. A test: a token without the scope that the comment write needs gives a message that names the scope.
Proposed design
Problem statement
The evidence comments on #3049, #3076, #2754 and #2740 ask a person to run devops roadmap return --comment ... --confirm, and say that it fails with 401 in an agent session. No run verifies that claim. The repository shows that a 401 is gh reporting a login that GitHub does not accept, and the command already names that cause. A missing permission is a 403 that gh words Resource not accessible by integration. is_gh_refused_by_token recognizes that 403, but the comment write does not call it, so the command names no permission. This change pins the 401 message and makes a refused comment write name issues: write. The live reproduction and the token-scope fix are deferred to their own issue.
Acceptance criteria
Requirement: A refused login names its fix
devops roadmap return SHALL report a comment write that GitHub refuses with HTTP 401 as a refused login, and name the way to replace the login.
Scenario: The session login is refused
- WHEN The
gh apicomment write exits nonzero and writesHTTP 401to stderr. - THEN The command prints an error that holds
401,gh auth loginandGH_TOKEN, and the command exits 1.
Requirement: A refused App comment names issues write
The comment write MUST report a token that GitHub refuses with HTTP 403 and Resource not accessible by integration as a missing issues: write permission.
Scenario: The token has no issues write
- WHEN The
gh apicomment write exits nonzero and writesgh: Resource not accessible by integration (HTTP 403)to stderr. - THEN The store raises
GitHubScopeErrorwhose message holdsissues: writeandHTTP 403, and the command exits 1.
Requirement: A refused comment leaves Status unchanged
The command MUST NOT write the Status label when the comment write is refused.
Scenario: The comment write is refused
- WHEN The evidence comment write raises
GitHubScopeErrorbefore the Status write. - THEN The store writes no Status label, the item keeps its current Status, and the command exits 1.
Existing Tool Considered
No alternatives check has run on this issue. gh (https://github.com/cli/cli) is the open, maintained CLI that performs the evidence comment and the Status label write, and the store calls it for both (src/devops_cli/roadmap/stores/github_store.py). gh prints Resource not accessible by integration (HTTP 403) when the token lacks the permission, but it does not name the missing permission, and it reports a refused login as HTTP 401 with no cause. The change therefore extends the project's own error mapping: it reuses is_gh_refused_by_token (src/devops_cli/github/error_classifier.py) and adds one permission argument to the store's comment write. Written cost: about 6k to 12k tokens to build, keep and fix that mapping, and under one hour elapsed.
Key questions
- Does
devops roadmap returnwrite the evidence comment and the Status label throughgh?: Yes.GitHubRoadmapStorereads and writes the roadmap throughgh, so the evidence comment and the Status label areghcalls. [sources: src/devops_cli/roadmap/stores/github_store.py] - Which GitHub App permission does an issue comment need?:
issues: write. ADR 0015 lists Issues read and write among the roadmap jobs' permissions, and the token request asks forissues: writeon every installation token. [sources: docs/adr/0015-roadmap-jobs-act-as-a-github-app-on-the-personal-account.md, openspec/specs/github-app-identity/spec.md, src/devops_cli/config/constants.py] - Is the 401 of the evidence comments a missing permission?: No.
GitHubUnauthenticatedErrorcovers HTTP 401: the process has no GitHub identity, or GitHub refused its token. A missing permission is the 403 thatis_gh_refused_by_tokenrecognizes. The comment write does not call that detector. [sources: docs/ERRORS.md, src/devops_cli/exceptions/git.py, src/devops_cli/github/error_classifier.py] - What should the command report when the comment write returns 401?: Keep the refused-login message. It names the failed
ghcommand and says thatghhas no login that GitHub accepts. Then it namesgh auth loginandGH_TOKEN. (best practice) [sources: src/devops_cli/github/error_classifier.py, docs/ERRORS.md, src/devops_cli/roadmap/stores/github_store.py]- Chosen: Keep the refused-login message. It names the failed write and the cause, and it matches the 401 class that the project records.
- Rejected: Add
issues: writeto the 401 message. A 401 is a refused token, so the hint would send a person to a permission that is not the cause. - Rejected: Print GitHub's own body. The project classifies a failed
ghcommand from its exit status and stderr, never from the message body of GitHub.
- How does the command learn that a refused comment write needs
issues: write?: The store's comment write callsis_gh_refused_by_tokenon gh's stderr. When it returns true, the store raisesGitHubScopeErrorthat namesissues: writeand the fix. The endpoint owns the permission, so the store passes it, not the classifier. (best practice) [sources: src/devops_cli/github/error_classifier.py, src/devops_cli/exceptions/git.py, src/devops_cli/roadmap/stores/github_store.py]- Chosen: Name the permission in the store's comment write. The store knows the endpoint, already owns the action text, and the detector already exists.
- Rejected: Add a branch to
_GH_CLASSES. The classifier sees only the output ofgh, which does not name the permission of the endpoint. - Rejected: Leave the generic failure. It names the action and the status but not
issues: write, which the body's test requires.
- Should the command retry with another token or mint a new installation token on 401?: No. The command reports the refused login and stops. A retry sends the same credential to the same endpoint, and ADR 0015 already refreshes an installation token before it expires. (best practice) [sources: docs/adr/0015-roadmap-jobs-act-as-a-github-app-on-the-personal-account.md, src/devops_cli/github/app_token.py, docs/ERRORS.md]
- Chosen: Report and stop. It keeps the failure explicit and leaves the login to the person who owns the session.
- Rejected: Retry with the Service's token. It hides the refused login and mixes two identities in one write.
- Rejected: Mint a new installation token. The session already refreshes its token before it expires, so a new token of the same identity does not change a refused login.
- Does the body's last acceptance criterion ask for a test on the 401?: No. It asks for a test on a token that lacks the scope that the comment write needs. That token gives the 403 that names the permission, not a 401. (best practice) [sources: src/devops_cli/github/error_classifier.py, docs/ERRORS.md]
- Chosen: Keep the test on the 403 refusal. It is the one part that runs offline, and it matches the status that GitHub uses for a missing permission.
- Rejected: Drop the test. It would leave the only offline acceptance criterion of the issue unmet.
- Rejected: Assert on a 401. A 401 carries no permission, so the assertion could only pass with a wrong message.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
devops-cli-service commentedon Nov 5, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fixprefix of the title gives the type.(roadmap)scope of the title gives the scope.The 401 blocks a person from delivering evidence in an agent session, but the failure is unverified and needs a live reproduction first.It unblocks a specific agent-session workflow for delivering roadmap evidence, but the scope is one command in one context.It needs a live reproduction, a token scope or error fix, and a test for the missing-scope message.Both work on the devops roadmap return flow; #3503 copies evidence to the issue, while this candidate fixes the 401 that blocks the command in an agent session.devops-cli-service commentedon Nov 7, 2026
Refine cannot set this item to Ready at 72c52c6 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.
devops-cli-service commentedon Nov 20, 2026
Next step: the alternatives check records a verdict. See the section Proposed design of the body.
devops-cli-service commentedon Nov 28, 2026
Released in v0.235.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.235.0
devops-cli-service commentedon Nov 28, 2026
Live since 2026-11-28 17:56 UTC