Skip to content

fix(streaming): mask credentials in streaming responses under the same opt-in - #16786

Merged
diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.52from
maxmad64bis:fix/credential-masker-absent-streaming
Oct 16, 2026
Merged

diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.52from
maxmad64bis:fix/credential-masker-absent-streaming

Conversation

@maxmad64bis

@maxmad64bis maxmad64bis commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ base-red inherited: #15306

Summary

When the opt-in is on, non-streaming responses mask secrets while streaming responses pass them through in clear text, because the streaming pipeline has no credential step. This change pipes streamed chunks through the same credential check when the existing opt-in is on, so keys and connection strings arrive masked on both paths and bytes stay untouched when it's off or opted out.

Related Issues

  • No linked issue — reproduced on the release base

Target Branch

  • Base is the active release/v3.8.x branch (the highest open release/v*), not main
  • New feature? From 3.8.55 on it is held with the v4-feature label for the v4 channel

Validation

  • Change type: other
  • Focused tests and category gates from the golden path
  • npm run lint
  • Reconciled with the current active release base; focused checks rerun afterward
  • Production-code changes include a new or updated automated test in this PR

Tests Added Or Updated

  • tests/unit/streaming-credential-transform.test.ts — covers masking on content and tool arguments, plus image data URLs and split secrets
  • tests/unit/chatcore-streaming-pipeline.test.ts — covers pipeline order and the gate staying off by default, off, and under opt-out
  • tests/unit/sseTextTransform.test.ts — covers routing tool arguments to the processor when the new flag is on

Coverage Notes

  • src/lib/streamingCredentialTransform.ts — covered by tests/unit/streaming-credential-transform.test.ts
  • open-sse/handlers/chatCore/streamingPipeline.ts — covered by tests/unit/chatcore-streaming-pipeline.test.ts
  • open-sse/handlers/chatCore/streamingTail.ts — covered by the gate tests in tests/unit/streaming-credential-transform.test.ts
  • src/lib/sseTextTransform.ts — covered by tests/unit/sseTextTransform.test.ts

Reviewer Notes

  • Behavior: masking is opt-in and matches non-streaming; a real key inside an image data URL stays unmasked, which is the pre-existing guardrail's limit.

@maxmad64bis
maxmad64bis force-pushed the fix/credential-masker-absent-streaming branch from 2f3276a to e547d0f Compare October 15, 2026 21:24
@maxmad64bis
maxmad64bis marked this pull request as ready for review October 15, 2026 21:51
diegosouzapw pushed a commit that referenced this pull request Oct 16, 2026
Local board on origin/release/v3.8.52 (ad37e8f) in `.claude/worktrees/maxmad-wave2`, together with #16759, #16760, #16769, #16773, #16786, and #16793. The combined tree passed `check-file-size` and `check-changelog-integrity`.

The health matrix leaves idle models out of the default payload and still counts them in `omittedIdleModelCount`. `includeIdleModels=true` brings the lines back. Focused file: `provider-health-matrix.test.ts`.

⚠️ base-red inherited: #15306

Thank you @maxmad64bis.
@diegosouzapw
diegosouzapw merged commit d8e3130 into diegosouzapw:release/v3.8.52 Oct 16, 2026
27 of 42 checks passed
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.

2 participants