mirror of
https://github.com/chenhg5/cc-connect.git
synced 2026-07-09 00:24:05 +08:00
When opencode rejects a tool call in default mode (e.g. bash permission denied), it emits a tool_use event with status="error" then exits without generating any follow-up text. This caused the engine to fall through to the "(空响应)" / "(empty response)" placeholder since textParts was empty. Fix: when handleToolUse receives status="error" with a non-empty error message, emit an EventText containing the rejection reason. This ensures textParts is populated and the user sees why the command was blocked (e.g. "The user rejected permission to use this specific tool call.") rather than a silent empty response. Three scenarios handled: - Permission denied (default mode): error text surfaced ✓ - Tool completed successfully: no change ✓ - Error with no message: no spurious empty EventText ✓ To avoid permission rejections entirely, set mode="yolo" in config or configure opencode's permission settings to allow the required tools. Fixes #178 Co-authored-by: root <root@UYQQVGRAEKQKNQP> Co-authored-by: Cursor <cursoragent@cursor.com>