Skip to content

bug: preserve content blocks in regexReplace messages responses - #1901

Open
Huldoser wants to merge 2 commits into
Portkey-AI:mainfrom
Huldoser:fix-regexreplace-message-blocks
Open

Huldoser wants to merge 2 commits into
Portkey-AI:mainfrom
Huldoser:fix-regexreplace-message-blocks

Conversation

@Huldoser

@Huldoser Huldoser commented Nov 14, 2026 •

Copy link
Copy Markdown

Description: (required)

  • Preserve the object shape and metadata of text content blocks when redacting messages responses.
  • Keep non-text blocks in their original order and leave single-choice chat redaction unchanged.
  • Add regression coverage for typed text blocks, interleaved tool_use blocks, and the chat control.

Tests Run/Test cases added: (required)

  • npx jest plugins/default/regexReplace.test.ts --runInBand (3 passed)
  • npx jest plugins/utils.test.ts --runInBand (13 passed, 8 skipped)
  • npx prettier --check plugins/utils.ts plugins/default/regexReplace.test.ts
  • npx eslint plugins/utils.ts plugins/default/regexReplace.test.ts
  • Focused TypeScript 5.3.3 check of the changed plugin modules
  • Full repository npx tsc --noEmit --pretty false reports three pre-existing errors in src/handlers/retryHandler.ts, src/providers/bytez/api.ts, and src/providers/open-ai-base/index.ts; pristine main reports the same errors.
  • The full plugin suite was attempted but is not locally green because of unrelated existing setup issues, including missing credential files. The new regression file and existing utils suite pass.
  • Live provider integration was not run.

Type of Change:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)

@Huldoser Huldoser changed the title Fix regexreplace message blocks bug: preserve content blocks in regexReplace messages responses Nov 14, 2026

This branch has not been deployed

No deployments
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