Skip to content

fix(llm): inject _noop tool for all providers when messages contain tool history#34603

Open
Robin1987China wants to merge 1 commit into
anomalyco:devfrom
Robin1987China:fix-compaction-toolconfig
Open

fix(llm): inject _noop tool for all providers when messages contain tool history#34603
Robin1987China wants to merge 1 commit into
anomalyco:devfrom
Robin1987China:fix-compaction-toolconfig

Conversation

@Robin1987China

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #34089

Type of change

  • Bug fix

What does this PR do?

The _noop tool injection in request.ts has a provider guard that only runs for github-copilot. However, when tool_use messages are present in history, the AI SDK requires a tool list to be non-empty. Without _noop, providers without native tool support fail to process conversations that contain prior tool interactions.

This removes the provider guard so _noop is injected unconditionally when messages contain tool history.

How did you verify your code works?

  • Ran full test suite: 52/52 passing
  • Typecheck: bun run typecheck passes cleanly

Checklist

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

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Potential Related PR Found

PR #34094: fix(opencode): restore _noop tool injection for Bedrock-backed providers during compaction

…ool history

Bedrock (and other providers) requires a toolConfig when messages contain
toolUse/toolResult content blocks, even if no active tools are being used.

Previously the _noop tool injection was limited to github-copilot, but the
underlying constraint affects Compaction on Bedrock-backed providers too
(e.g. Portkey) — resulting in "toolConfig field must be defined" errors.

Remove the github-copilot-specific guard so the _noop tool is injected
whenever messages contain prior tool calls but no current tools are active.

Closes anomalyco#34089
@Robin1987China Robin1987China force-pushed the fix-compaction-toolconfig branch from 37158ed to e1714ba Compare July 9, 2026 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compaction fails on Bedrock-backed providers: missing toolConfig

1 participant