fix(fastpick): the redaction guard ate the key id - #220
Merged
Conversation
`--key` and `-p` sat in SECRET_FLAGS, so `saveThread` replaced their value with `***`, and args are replayed on respawn: a relaunched thread ran `fastpick --key ***` and died on `no provider or key with id '***', see --list`. neither flag carries a secret, `--key` names a credential `<provider>.<key>` and `-p` is the prompt flag. SECRET_VALUE_RE still tests every argument, so a real key handed to either one is redacted. rows already written keep the `***`, so `withoutRedactedKey` drops the poisoned pair at relaunch: provider and model stay, fastpick resolves the key from the model.
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.
--keyand-pleaveSECRET_FLAGSinsrc/lib/shared/utils/redact.ts, andwithoutRedactedKeyinsrc/lib/features/thread/resume-args.tsdrops a--key ***pair a relaunch finds in an existing row.saveThreadredacted the value after both flags before writing the row, andresumeArgvreplays stored args, so a fastpick thread came back asfastpick --key ***and died onno provider or key with id '***', see --list. neither flag carries a secret:--keyis the<provider>.<key>id thatcomboArgswrites atcombo.ts:138,-pis the prompt flag of claude, codex and fastpick.same class as the bare-prefix false positive already fixed in that file, where
skipandghostmatched.the healing path drops the flag instead of guessing an id that is gone from the row.
--providerand--modelsurvive, and fastpick resolves the key from the model when one key of that provider serves it.SECRET_VALUE_REstill tests every argument, so--key sk-ant-...is redacted, covered by a test.bun run test1094 passing,bun run lintclean. the--keytest fails on the old code withexpected [...] to include 'codex-everywhere.openai'.