Skip to content

fix(provider): remove LiteLLM workarounds ported upstream, requires LiteLLM v1.85.0-rc.2+#26819

Merged
rekram1-node merged 2 commits into
anomalyco:devfrom
Sameerlite:fix/opencode-delegate-litellm-compat
May 14, 2026
Merged

fix(provider): remove LiteLLM workarounds ported upstream, requires LiteLLM v1.85.0-rc.2+#26819
rekram1-node merged 2 commits into
anomalyco:devfrom
Sameerlite:fix/opencode-delegate-litellm-compat

Conversation

@Sameerlite
Copy link
Copy Markdown
Contributor

@Sameerlite Sameerlite commented May 11, 2026

Summary

Removes OpenCode-side LiteLLM workarounds now handled in LiteLLM.

Fixes #21346

Changes

  • transform.ts: Set reasoningSummary: "auto" for non–gpt-5-pro GPT‑5 models for all SDK packages, including @ai-sdk/openai-compatible
  • llm.ts: Inject the _noop compat tool only for GitHub Copilot. LiteLLM detection and the litellmProxy provider option are removed.

Upstream

Verification

bun test test/provider/transform.test.ts test/session/llm.test.ts (from packages/opencode)

Both these issue fixes from Litellm side have made it to v1.85.0-rc.2.

…orkarounds

Delegate compatibility to LiteLLM (BerriAI/litellm#27618, BerriAI/litellm#27620).
Restore reasoningSummary for openai-compatible GPT-5; keep _noop injection for Copilot only.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label May 11, 2026
@github-actions
Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions
Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@Sameerlite Sameerlite marked this pull request as draft May 11, 2026 05:59
@rekram1-node rekram1-node removed the needs:compliance This means the issue will auto-close after 2 hours. label May 11, 2026
@rekram1-node
Copy link
Copy Markdown
Collaborator

lgtm so far, whenever it's ready ill merge it

Thanks!

@Sameerlite Sameerlite marked this pull request as ready for review May 14, 2026 13:18
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label May 14, 2026
@Sameerlite
Copy link
Copy Markdown
Contributor Author

@rekram1-node let me know if this good to be merged. Only concern is that for this to work, user needs to use litellm with v1.85.0-rc.2+. If you can let me know any docs i need to update or if this can be mentioned in the release notes

@github-actions
Copy link
Copy Markdown
Contributor

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label May 14, 2026
@github-actions github-actions Bot closed this May 14, 2026
@rekram1-node rekram1-node reopened this May 14, 2026
@rekram1-node rekram1-node changed the title fix(opencode): drop LiteLLM-specific provider workarounds fix(provider): support LiteLLM GPT-5 reasoning and Anthropic tool history May 14, 2026
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label May 14, 2026
@rekram1-node rekram1-node changed the title fix(provider): support LiteLLM GPT-5 reasoning and Anthropic tool history fix(provider): remove LiteLLM workarounds ported upstream, requires LiteLLM v1.85.0-rc.2+ May 14, 2026
@rekram1-node rekram1-node merged commit 7f7eb2e into anomalyco:dev May 14, 2026
12 checks passed
@KnutZuidema
Copy link
Copy Markdown
Contributor

@rekram1-node this indeed breaks my usage, since I'm using a LiteLLM proxy which I do not directly control with a lower version.

Is there any reason to remove the handling for LiteLLM? I understand wanting to keep workarounds and tech debt to a minimum, but removing this workaround means OpenCode is broken when used with a LiteLLM provider version less than v1.85.0-rc.2+.

IMO, this change should be reverted.

@denisrosca
Copy link
Copy Markdown

same issue as @KnutZuidema
It's a bit premature to remove workarounds until most of the LiteLLM proxy had time to upgrade.

@rekram1-node
Copy link
Copy Markdown
Collaborator

Thats fair, im not as familiar with litellm so I was generally trusting the makers of it here, but given there have been a few issues ill add back this functionality in the interim but as a pure plugin which should be possible (will be enabled out of the box and should work exact same as this previously did)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:compliance This means the issue will auto-close after 2 hours. Vouched

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GPT-5.4 via custom @ai-sdk/openai LiteLLM provider crashes with activeReasoningPart.summaryParts, while direct /v1/responses succeeds

4 participants