[PR #10944] fix: mark copilot claude tool loops as agent-initiated #13618

Closed
opened 2026-02-16 18:18:27 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/10944

State: closed
Merged: No


Issue

Copilot Claude was switched to ai-sdk/anthropic, which considers tool results to have "role": "user". This causes tool loops to consume infinity premium requests.

Fix

Check for tool_result. This is exclusive to /v1/messages among the copilot endpoints

Verify

Added some tests. Also checked the real request headers to confirm.


Fixes https://github.com/anomalyco/opencode/issues/10941

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/10944 **State:** closed **Merged:** No --- ## Issue Copilot Claude was switched to ai-sdk/anthropic, which considers tool results to have `"role": "user"`. This causes tool loops to consume infinity premium requests. ## Fix Check for `tool_result`. This is exclusive to `/v1/messages` among the copilot endpoints ## Verify Added some tests. Also checked the real request headers to confirm. --- Fixes https://github.com/anomalyco/opencode/issues/10941
yindo added the pull-request label 2026-02-16 18:18:27 -05:00
yindo closed this issue 2026-02-16 18:18:27 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13618