Skip to content

fix(github): a refused App JWT names GitHub's reason - #3116

Merged
dan-petty merged 3 commits into
mainfrom
fix/2491-a-refused-jwt-exchange-of-the
Nov 1, 2026
Merged

dan-petty merged 3 commits into
mainfrom
fix/2491-a-refused-jwt-exchange-of-the

Conversation

@devops-cli-service

@devops-cli-service devops-cli-service Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Closes #2491

Issue #2491: when GitHub refuses the App's JWT with HTTP 401, the error message tells the operator to run gh auth login or set GH_TOKEN. A process that acts as the App has no gh login, so the advice is wrong. The message also drops GitHub's reason, for example "A JSON web token could not be decoded". The spec requirement "A failed exchange names the App and the reason" asks for the reason.

Change: openspec/changes/archive/2026-11-01-2491-a-refused-jwt-exchange-of-the/

@devops-cli-service

Copy link
Copy Markdown
Contributor Author

The steps of the job:

  • group 1 (Name GitHub's reason in the App 401 error): done, 33 model requests, commit 1add47df9459

@dan-petty

Copy link
Copy Markdown
Owner

Advisory pre-merge review (automated; a person decides).

Recommendation: merge after two minor fixes. Fix the PR title and rebase onto origin/main so the required check turns green.

The code change is correct. It delivers all of issue #2491. Four lenses (fidelity, tests, correctness and scope, standards) found no defect in the code.

Severity Where Problem Evidence Fix
minor PR title The title ends with a literal "...". It looks cut off. The squash commit and the changelog line will read as a broken sentence. Title: fix(github): a refused JWT exchange of the GitHub App names GitHub's.... The title check passes, but the text is incomplete. Write a full phrase of at most 60 characters, for example name GitHub's reason in the App JWT 401 error.
minor Required check "Tests & Coverage" at head f981065 The check is red. The failing test is not part of this PR. The branch lacks a fix that main already has. Log: FAILED tests/roadmap/test_roadmap_implement_step_rules.py::test_a_hostile_agents_md_is_data_and_never_changes_the_instructions, 1 failed, 16143 passed. Commit a6615b9 (#3115) on main fixes this test. Rebase onto origin/main, push, and watch with devops pr monitor 3116. Mark the PR ready only after the checks pass.
nit src/devops_cli/github/app_installation.py:122 The new comment is 109 characters long and only repeats the code. The line limit is 100. Ruff ignores E501, so no check fails. Line length scan of the file. Shorten or remove the comment.
nit src/devops_cli/github/app_installation.py:121-126 No test covers a long reason (the 256-character cut). No test covers a 401 that is not an HTTPException. The only changed test uses a short body. Optional. Add a test in a later change.
nit Commit 1add47d The branch commit subject is not a Conventional Commit. The squash merge uses the PR title, so this has no effect. git log origin/main..HEAD. None needed.
nit Check "Tests & Coverage" The job took 5m 6s, at the 5-minute limit. This PR adds no test, so it did not cause the time. Pytest line: 16143 passed in 299.74s. None for this PR. Note it for the CI speed work.

Behavior change, checked: only HTTP 401 on the App token exchange changes. The error now names GitHub's reason, the request line and the status. It no longer says gh auth login or GH_TOKEN. The 422 path and the other paths are the same. The gh session text in error_classifier.py is not changed, and its contract tests pass. The reason comes from the response body and holds no key or JWT.

Checks that I and the lenses ran:

  • uv run devops ci test tests/github/test_github_app_identity.py on head: 23 passed.
  • Fail-to-pass: the head test file on a worktree of origin/main: 1 failed, 22 passed (the message differs). On head: 23 passed.
  • tests/github/test_github_contract.py: 21 passed.
  • ruff check and ruff format --check on the 3 changed Python files: pass.
  • mypy --strict on the 2 changed source files: no issues.
  • uv run devops docs generate --sync-readme: no diff.
  • Scope: 9 files, all in the plan. The OpenSpec archive is a rename, with boxes ticked in tasks.md. The spec delta matches the code and test.
  • Private data scan of the change folder: nothing found.
  • Closing keyword: only Closes #2491.

@dan-petty dan-petty changed the title fix(github): a refused JWT exchange of the GitHub App names GitHub's... fix(github): a refused App JWT names GitHub's reason Nov 1, 2026
@dan-petty
dan-petty marked this pull request as ready for review November 1, 2026 23:37
@dan-petty
dan-petty self-requested a review as a code owner November 1, 2026 23:37
@dan-petty
dan-petty merged commit 5ac0bea into main Nov 1, 2026
20 checks passed
@dan-petty
dan-petty deleted the fix/2491-a-refused-jwt-exchange-of-the branch November 1, 2026 23:37
dan-petty pushed a commit that referenced this pull request Nov 2, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.39.0](v0.38.0...v0.39.0)
(2026-11-02)


### Features

* **ci:** uv, test, serve and mcp dry runs list their requests
([#3135](#3135))
([666e183](666e183))
* **k8s:** serve gemini-3.8-flash and two Claude models
([#3117](#3117))
([1fa3a31](1fa3a31)),
closes [#3113](#3113)
* **repos:** request plans for repos, branches, ssh and tls
([#3129](#3129))
([174b82c](174b82c))
* **roadmap:** move unworkable scope to new issues during refine
([#3130](#3130))
([a0b2cb5](a0b2cb5))


### Bug Fixes

* **github:** a refused App JWT names GitHub's reason
([#3116](#3116))
([5ac0bea](5ac0bea))
* **roadmap:** make the alternatives check search before a verdict
([#3127](#3127))
([099c689](099c689))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(github): a refused JWT exchange of the GitHub App names GitHub's reason, not a gh login

1 participant