Skip to content

Answer 422 with the issuer's reason when a secret is missing - #80

Merged
czpython merged 1 commit into
mainfrom
claude/issuer-refusal-422-08395b
Oct 22, 2026
Merged

czpython merged 1 commit into
mainfrom
claude/issuer-refusal-422-08395b

Conversation

@czpython

@czpython czpython commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

When a secret is missing, the issuer answers 4xx: the GitHub App is not on the repo, or the vault row is revoked. A retry gets the same answer, so POST /hosts now fails at once with 422, SECRET_MISSING and the issuer's reason. 5xx and transport failures keep the 502.

  • MissingSecretError, the name Druks gives the condition, is an IssuerError that the API answers with 422. Secret.fetch raises it with the body's detail on a 4xx. A 4xx body without detail is a wrong-shaped answer like any other.
  • HostService.provision marks the host failed as before and lets the error through.
  • The exchange's refresh loop treats it like every other issuer failure.
  • Two checklist tidy-ups in service.py on the way: the pool claim reads as one positive branch, and the mark_failed comment no longer names the 502.

@czpython
czpython force-pushed the claude/issuer-refusal-422-08395b branch 2 times, most recently from de4f365 to ce9fd52 Compare October 19, 2026 19:39
@czpython czpython changed the title Answer 422 with the issuer's reason when it refuses a secret Answer 422 with the issuer's reason when a secret is missing Oct 19, 2026
When a secret is missing, the issuer answers 4xx: the GitHub App is not
on the repo, or the vault row is revoked. A retry gets the same answer,
so the host create now fails at once with 422 and the issuer's reason.
5xx and transport failures keep the 502.
@czpython
czpython force-pushed the claude/issuer-refusal-422-08395b branch from ce9fd52 to 6435813 Compare October 22, 2026 14:50
@czpython
czpython merged commit 714a6d6 into main Oct 22, 2026
6 checks passed
@czpython
czpython deleted the claude/issuer-refusal-422-08395b branch October 22, 2026 15:03
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.

1 participant