Skip to content

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

Closed
robinmordasiewicz wants to merge 1 commit into
anomalyco:devfrom
f5xc-salesdemos:fix/transform-params-all-types
Closed

fix(opencode): run transformParams middleware unconditionally for all call types#19558
robinmordasiewicz wants to merge 1 commit into
anomalyco: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
@rekram1-node
Copy link
Copy Markdown
Collaborator

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

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

2 participants