Match saveAgentColor with its new options argument on Claude Code 2.1.233 - #954
Merged
bl-ue merged 1 commit intoAug 17, 2026
Merged
Conversation
….233 saveAgentColor grew a fourth parameter that it forwards to the transcript append call, so the pattern -- pinned to three parameters and a two-argument append call -- stopped matching and the session-color patch bailed out with "failed to patch saveAgentColor". Make both the extra parameter and the extra argument optional so the pre-2.1.233 forms keep matching.
Contributor
|
Caution Review failedAn error occurred during the review process. Please try again later. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
bl-ue
enabled auto-merge (squash)
August 17, 2026 17:49
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.
Problem
On Claude Code 2.1.233 the whole
session-colorpatch bails out:saveAgentColorgrew a fourth parameter, which it forwards to the transcript append call:The pattern pinned the signature to exactly three parameters and the append call to exactly two arguments, so neither of the two alternatives matched, and
writeSessionColorreturnednulleven though its app-state injections were fine.Fix
Make the extra parameter and the extra argument optional. Capture-group numbering is untouched (both additions are non-capturing), so the extraction of the function name and the session-id getter is unchanged.
Verification
Ran the old and the new implementation over every extracted bundle I have (2.1.88, 2.1.89, 2.1.92, 2.1.98, 2.1.113, 2.1.126, 2.1.144, 2.1.183, 2.1.195, 2.1.201, 2.1.204, 2.1.214, 2.1.219, 2.1.233):
null; the new ones injectglobalThis.__tweakccSaveAgentColor=(c)=>o2n(qt(),c);, which matches theif(e===qt())check inside that function.Applied to a real 2.1.233 native binary: the patch reports success,
TWEAKCC_SESSION_COLORand__tweakccSaveAgentColorare present in the patched bundle, and the binary runs (2.1.233 (Claude Code)).A regression test covers the new shape; the existing tests for the three earlier shapes still pass. Full suite,
tsc, ESLint and Prettier are clean.