Skip to content

fix(fastpick): the redaction guard ate the key id - #220

Merged
klNuno merged 1 commit into
masterfrom
fix/fastpick-key-redaction
Aug 27, 2026
Merged

fix(fastpick): the redaction guard ate the key id#220
klNuno merged 1 commit into
masterfrom
fix/fastpick-key-redaction

Conversation

@klNuno

@klNuno klNuno commented Aug 27, 2026

Copy link
Copy Markdown
Member

--key and -p leave SECRET_FLAGS in src/lib/shared/utils/redact.ts, and withoutRedactedKey in src/lib/features/thread/resume-args.ts drops a --key *** pair a relaunch finds in an existing row.

saveThread redacted the value after both flags before writing the row, and resumeArgv replays stored args, so a fastpick thread came back as fastpick --key *** and died on no provider or key with id '***', see --list. neither flag carries a secret: --key is the <provider>.<key> id that comboArgs writes at combo.ts:138, -p is the prompt flag of claude, codex and fastpick.

same class as the bare-prefix false positive already fixed in that file, where skip and ghost matched.

the healing path drops the flag instead of guessing an id that is gone from the row. --provider and --model survive, and fastpick resolves the key from the model when one key of that provider serves it.

SECRET_VALUE_RE still tests every argument, so --key sk-ant-... is redacted, covered by a test.

bun run test 1094 passing, bun run lint clean. the --key test fails on the old code with expected [...] to include 'codex-everywhere.openai'.

`--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.
@klNuno
klNuno merged commit 7a360d1 into master Aug 27, 2026
6 checks passed
@klNuno
klNuno deleted the fix/fastpick-key-redaction branch August 27, 2026 00:49
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