Skip to content

fix(opencode): run transformParams middleware unconditionally for all call types#19558

Open
robinmordasiewicz wants to merge 1 commit intoanomalyco:devfrom
f5xc-salesdemos:fix/transform-params-all-types
Open

fix(opencode): run transformParams middleware unconditionally for all call types#19558
robinmordasiewicz wants to merge 1 commit intoanomalyco:devfrom
f5xc-salesdemos:fix/transform-params-all-types

Conversation

@robinmordasiewicz
Copy link
Copy Markdown

Issue for this PR

Fixes #19557

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The transformParams middleware in llm.ts wraps ProviderTransform.message() behind an if (args.type === "stream") guard. Non-stream call types skip the entire normalization pipeline — normalizeMessages(), applyCaching(), and tool-call ID scrubbing all get bypassed.

The prompt shape is the same regardless of args.type, so the guard has no purpose. This removes it so the middleware runs unconditionally. The existing TODO comment on the line suggests this was already known to be questionable.

How did you verify your code works?

  • Typecheck clean across all 13 packages (bun turbo typecheck)
  • All existing tests pass
  • Manually confirmed ProviderTransform.message() is called for both stream and non-stream paths by adding a temporary log and running bun dev

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

… call types

The `if (args.type === "stream")` guard meant non-stream call types
skipped ProviderTransform.message() entirely — no normalizeMessages(),
no applyCaching(), no tool-call ID scrubbing. The prompt shape is the
same regardless of call type.

Fixes anomalyco#19557
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.

bug: transformParams middleware skips ProviderTransform.message() for non-stream calls

1 participant