Repository navigation
fix(channel): redact GitHub App tokens from run error replies - #87
Open
RaphaelFakhri wants to merge 1 commit into
Open
RaphaelFakhri wants to merge 1 commit into
RaphaelFakhri wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
When an agent run fails,
userFacingRunErrorinapp/channel-helpers.tsposts a short reason into the Slack or Teams thread. Before it does,sanitizeReasonmasks GitHub tokens withTOKEN_RE:The GitHub App coder authentication change (7e9be6d) widened the agent's copy of this pattern in
agent/coding/sandbox.pyto(ghp|github_pat|gho|ghs|ghu|ghr), because a GitHub App mintsghs_installation tokens. The runtime copy was not updated. With GitHub App auth configured, an error whose message carries the installation token, for example a git URL of the formhttps://x-access-token:ghs_...@github.com/..., reaches the thread with the token unmasked.This change makes the runtime pattern match the agent's:
ghs_,ghu_andghr_tokens are now shown asghs_[redacted]and so on, the same wayghp_already is.Verification
pnpm exec vitest run app/channel-helpers.test.ts: 15 passed. The three new cases (ghs,ghu,ghr) fail onmain(3 failed, 12 passed) and pass with the change.pnpm check-types: exit 0.pnpm test: 34 files, 502 tests passed.node node_modules/railway/dist/iac/bin.js: exit 0,"diagnostics": [].The change touches no Python, so
uv run pytestinagent/was not run.