fix(memories,canvas): #2921 cleanup — GitHub token labels + clear hydrationError on success #2936
Reference in New Issue
Block a user
Delete Branch "fix/2921-github-token-redaction-cleanup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #2921 (memory redaction + canvas hydration cleanup items).
Memory redaction (
workspace-server/internal/handlers/memories.go)gho_OAuth user-token prefix with labelGITHUB_OAUTH.ghs_label fromGITHUB_OAUTHtoGITHUB_APP_SERVER_TOKEN.Canvas hydration (
canvas/src/store/canvas.ts)hydrationErroron the hydrate success path so a prior failed load does not leave a stale error banner after a successful rehydrate.console.errorthe caught error in the failure path for supportability.Test plan
go test ./workspace-server/internal/handlers -run TestRedactSecrets_GitHubgo build ./...npm test -- --run -t hydrationError(canvas)npm run lint(canvas)SOP Checklist
memorySecretPatternsandhydratestore patterns.🤖 Generated with Claude Code
The GitHub token redaction table was missing the gho_ OAuth user-token prefix and mislabeled ghs_ (GitHub App server-to-server token) as GITHUB_OAUTH. Add gho_ with the correct label and relabel ghs_ to GITHUB_APP_SERVER_TOKEN, plus inline comments documenting the prefix meanings. - Add gho_[A-Za-z0-9]{16,} -> GITHUB_OAUTH. - Change ghs_ label from GITHUB_OAUTH to GITHUB_APP_SERVER_TOKEN. - Add unit tests for both new/changed labels. Fixes #2921 (memory redaction cleanup items). Test plan: - go test ./workspace-server/internal/handlers -run TestRedactSecrets_GitHub - go build ./...fix(memories): add gho_ GitHub OAuth token prefix and correct ghs_ label (#2921)to fix(memories,canvas): #2921 cleanup — GitHub token labels + clear hydrationError on successAdds runtime-built test fixtures for the AKIA[A-Z0-9]{16} redaction pattern so the pre-commit secret scanner does not flag the test source. - Verifies a 20-char AKIA-prefixed key is redacted as AWS_ACCESS_KEY_ID. - Verifies an AKID-prefixed string is not false-positived. Relates #2921.Friendly bump — functional CI is green/pending on the latest commit; the only blockers are the review/governance gates. Please review the code/test changes and post the needed
/sop-ack//sop-n/acomments. Thanks!APPROVE — a genuine secret-redaction fix plus a small canvas UX fix; both tested, no regression. Reviewed @ head (all-required CI green).
memories.go — real redaction-gap fix ✅ (the meaningful part). The table previously labeled
ghs_asGITHUB_OAUTH(wrong —ghs_is a GitHub App server-to-server token) and was missinggho_entirely — the actual OAuth user-token prefix — so rawgho_…tokens pasted into memory content were NOT being redacted and could leak. This PR addsgho_ → GITHUB_OAUTH, relabelsghs_ → GITHUB_APP_SERVER_TOKEN, and adds a prefix legend. Net effect is strictly MORE coverage (gho_ now caught; ghs_ still caught, just accurately labeled) — no regression. New tests assert both gho_ and ghs_ redact with the correct labels and that the plaintext doesn't leak. Composes correctly with the #2934 lint exemption for this same file.canvas.ts ✅
hydrate()now setshydrationError: nullon success so a recovered rehydrate doesn't strand the user on a stale error banner (core#2921), and adds aconsole.erroron the failure path for diagnosibility. The fail-closed catch (keep previous nodes + retryable message) is preserved. Test added for the clear-on-success path.5-axis: correctness ✓, no security regression (improvement), no perf impact, readable. APPROVE.
— CR2