fix(acp): improve vendor compatibility for session/update parsing#434
Open
fix(acp): improve vendor compatibility for session/update parsing#434
Conversation
Add support for alternative JSON formats in ACP session/update messages to handle different vendor implementations (OpenClaw, OpenCode, etc.). Changes: - Add debug logging to capture raw session/update JSON for troubleshooting - Support multiple text field formats in mapAgentMessageChunk: - Standard ACP: content.text with type field - Alternative: content.text without type - Alternative: top-level text field - Alternative: content as string - Enhance fallback text extraction for unknown sessionUpdate types - Add tests for all alternative formats Fixes #432 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
c3a32f0 to
20f0444
Compare
Owner
Author
|
LGTM! Clean fix for vendor compatibility. ✅ Correctness: Multiple JSON format fallbacks correctly handle various vendor implementations
✅ Tests: Comprehensive test coverage for all alternative formats ✅ Debug logging: Added slog.Debug statements for troubleshooting ✅ CI: All checks pass ✅ Documentation: Added OpenClaw pairing requirements to config.example.toml Fixes #432 - OpenClaw/OpenCode empty response issue. |
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.
Summary
mapAgentMessageChunk()to support multiple JSON formats:{"content": {"type": "text", "text": "..."}}{"content": {"text": "..."}}(type omitted){"text": "..."}(top-level text field){"content": "..."}(content as string)mapSessionUpdateFallback()to extract text from common vendor extensions (message,message_chunk,response,text)Root Cause
Issue #432 reported "(empty response)" when using OpenClaw/OpenCode with cc-connect. The ACP agent was only parsing the standard
content.textformat. If a vendor sends text in a different JSON structure, the mapping function returnednil, resulting in noEventTextevents and eventually "(empty response)" in the UI.Test plan
go build ./...go test ./...Fixes #432
🤖 Generated with Claude Code