Conversation
tt-a1i
left a comment
There was a problem hiding this comment.
[P2] Keep the Cookie replacement on one line (extensions/suggestions/src/transcript.ts:74). The \s* after Cookie: matches line breaks. I reproduced Cookie:\nordinary: visible becoming only Cookie: [REDACTED]; the ordinary next line is lost, contrary to the stated transcript-preservation contract. The same happens with CRLF. Restrict the whitespace to [ \t]* and add empty-header LF/CRLF regressions.
|
Updated head 5d09cb2 per review: standalone Cookie redaction now restricts post-header whitespace to spaces/tabs, so an empty LF or CRLF header cannot consume the following line. Added both LF and CRLF regressions. Local focused transcript tests: 41/41; bun run check: passed; git diff --check: passed. Exact-head GitHub CI is green. |
Problem
Closes #603.
When opt-in suggestions serialize a standalone unquoted multi-cookie header, the general
cookie=matcher redacts only the first value. On current main before this change:became
Cookie: [REDACTED]; sid=syntheticBeta; the remaining synthetic value could therefore enter the suggestion-model transcript.Value
Cookie header values should not be supplied to the suggestion model. The fix keeps adjacent ordinary transcript text available and does not claim general shell parsing or universal secret detection.
Approach
Before generic key/value rules, apply a case-insensitive, line-bounded replacement to standalone
Cookie:header lines. The pattern retains optional indentation and the header label, replaces only that line's value, and cannot consume a following line. Add the publicserializeRunTranscriptregression for two values and a following ordinary line.Validation
43cd2e94withsid=syntheticBetapreserved.node --experimental-strip-types --test tests/extensions/suggestions/transcript.test.ts— 39/39 passed.node --experimental-strip-types --test tests/extensions/suggestions/*.test.ts— 72/72 passed.bun run check— passed (config/docs/discipline contracts, web build, format, lint, TypeScript; existing Vite chunk-size warning only).bun run test— started and reached the existing real-Pi post-edit timeout cluster (8 failures) before this PR touches those files; it remains running at PR creation time. This is not claimed as a full-suite pass.All test and reproduction values are synthetic; no live suggestion-model request was made.
Impact