Large raw_output snapshots from tool_call_update notifications caused
O(N²) traffic through the event pipeline, multi-GB transient allocations
and WKWebView crashes. The fix turns cumulative snapshots into bounded
incremental deltas and removes redundant payload copies.
- Add ToolCallOutputCache keyed by tool_call_id with a 8KB tail
fingerprint and total length. Detects cumulative extensions by
matching the cached tail at the expected offset in the incoming
snapshot, so it works even when the full output grows into the MB
range. Emits suffix deltas with raw_output_append=true; falls back
to a truncated replacement when content diverges.
- Cap any single emitted raw_output chunk at 64KB (MAX_SINGLE_EMIT_BYTES)
with a UTF-8 char-boundary-safe tail and ANSI-sequence-safe trimming.
Apply the same cap to emit_terminal_output_update.
- Bound the cache at 256 entries with FIFO eviction, and clear entries
when the tool call reaches completed / failed / cancelled / error.
- Seed the cache via a dedicated seed() method on SessionUpdate::ToolCall
so the initial event never emits an accidental append.
- Share emit payloads as Arc<serde_json::Value> across broadcast
receivers and skip the Tauri-side clone: serialize once and hand the
same Arc to both the webview emit and the WebSocket broadcaster.
- Add 14 unit tests covering boundary cases: identity, prefix extension
past the cached tail, divergence, oversized deltas, multibyte UTF-8
truncation, final-status cleanup, FIFO eviction, seed semantics, and
ANSI-safe trimming.
Forward the previously-dropped `locations` and `meta` fields from ACP
SDK ToolCall/ToolCallUpdate events through to the frontend. The meta
field carries `claudeCode.parentToolUseId` which enables precise
parent-child matching for concurrent Agent tool calls during streaming.
- Forward locations/meta in Rust AcpEvent types and connection handlers
- Use parentToolUseId for exact agent→child mapping, with position-based
fallback for agents that don't provide it (Codex, OpenCode)
- Replace `any` types with proper ToolCallMeta / unknown types
- Add runtime guards for meta field parsing (defensive against
unexpected shapes from different agents)
- Cache inferLiveToolName results per tool_call_id to avoid redundant
computation across Phase 1 and Phase 2
- Lazy-construct agentStats only when children exist
Claude Code SDK now supports the "auto" permission mode, so the
filtering that hid it from the selector and silently dropped attempts
to set it is no longer needed.
Enable raw Claude SDK forwarding for ACP sessions and emit only system/api_retry events to the frontend.
Show a localized single-line retry banner with loading under the conversation input, including error details and retry progress.
- Session-page connect never triggers download/install; returns
SdkNotInstalled immediately and prompts the user to install from
Agent Settings instead
- Binary agents now accept any cached version via
find_best_cached_binary_for_agent so stale caches still connect
- Bound Initialize handshake with a 60s timeout and convert it to
AcpError::InitializeTimeout via a sentinel in run_connection
- Spawn background task owns ConnectionManager map insertion and
removes the entry on exit through an RAII guard that survives
panics, preventing leaked stale entries
- AcpError gains SdkNotInstalled and InitializeTimeout variants plus
a stable code() identifier; AcpEvent::Error carries code so the
frontend can render localized messages by key
- Frontend preflight now runs for all connect sources; error event
handler switches on code to show translated text for
initialize_timeout, sdk_not_installed, platform_not_supported,
process_exited, spawn_failed and download_failed
- Remove ConnectionStatus::Downloading enum variant, all frontend
branches, and i18n strings; drop obsolete autoLinkFailedTitle,
autoLinkPreflightFailed, preflightCheckFailedDefault and
preflightFailedTitle keys across 10 locales
- Add backendErrors.* translations in 10 languages
- Diagnostic logging: always log agent stderr plus binary
path/size/args/env keys and Initialize timing; gate stdin/stdout
JSON-RPC tracing behind CODEG_ACP_DEBUG to avoid persisting user
content into OS log files
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When reopening a Gemini CLI history session, session/load fails with
"Authentication required" and the fallback session/new overwrites the
DB external_id with a new session ID that has no corresponding file,
causing all historical messages to disappear.
- Skip session/new when session/load returns "Authentication required"
- Add Gemini to the parser fallback so stale external_ids recover via
folder_path + started_at matching
- Guard externalIdSavedRef for existing conversations to prevent
session/new from overwriting the persisted external_id
- Only update conversation status on disconnect when user has sent a
message, avoiding spurious "completed" flips on pure history views
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Claude Code errors when setting config options to "auto". Strip "auto"
values from config options returned to frontend and skip set requests
with "auto" value for Claude Code agent.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>