Bring Anthropic usechat backend to OpenAI-level tool-use parity and stream robustness#2971
Draft
Bring Anthropic usechat backend to OpenAI-level tool-use parity and stream robustness#2971
Conversation
Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update pkg/aiusechat/anthropic provider for full functionality
Bring Anthropic usechat backend to OpenAI-level tool-use parity and stream robustness
Mar 3, 2026
Deploying waveterm with
|
| Latest commit: |
d629e4a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://bc2a2902.waveterm.pages.dev |
| Branch Preview URL: | https://copilot-update-anthropic-bac.waveterm.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This updates
pkg/aiusechat/anthropicfrom partial implementation to full backend parity for core tool-use orchestration and stream behavior. The main gaps were unimplemented tool lifecycle methods, missing persisted tool-use UI state, and weaker disconnect/error handling versus the OpenAI backend.Tool-use lifecycle parity (critical path)
UpdateToolUseDataRemoveToolUseCallGetFunctionCallInputByToolCallIdpkg/aiusechat/usechat-backend.goto call Anthropic implementations instead of stubs.nilresponses are not wrapped into[]GenAIMessage{nil}.Persisted tool-use state in Anthropic native messages
ToolUseDatastorage on Anthropictool_useblocks.Clean().UI conversion parity for reloaded history
ConvertToUIMessage()to emitdata-tooluseparts when tool-use metadata exists, in addition totool-{name}parts.Streaming UX parity for tool argument deltas
aiutil.SendToolProgress(...)calls during:input_json_delta(incremental updates)content_block_stopfortool_use(final update)Disconnect/stream robustness
sse.Err()checks in event handling and decode-error path.Correctness + hygiene alignment
AreModelsCompatible(...)(instead of strict string equality).httpClient.Dofailures).log.Printfcalls withlogutil.DevPrintf.Targeted coverage additions
data-tooluseUI conversion behavior✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.