diff --git a/frontend/src/lib/components/agent/AgentChat.svelte b/frontend/src/lib/components/agent/AgentChat.svelte index 3048886c..3180d9ba 100644 --- a/frontend/src/lib/components/agent/AgentChat.svelte +++ b/frontend/src/lib/components/agent/AgentChat.svelte @@ -287,18 +287,49 @@ } async function copyDebugInfo() { + const lastMsg = model.messages.at(-1); const payload = { + // ── Identifiers ── conversation_id: model.currentConversationId, pending_thread_id: model.pendingThreadId, - connection_state: model.connectionState, - streaming_state: model.streamingState, user_id: model.userId, environment_id: model.envId, - messages: model.messages.length, - active_tool_calls: model.activeToolCalls.map((tc) => ({ - tool: tc.tool, - status: tc.status, - })), + // ── Connection & Streaming ── + connection_state: model.connectionState, + streaming_state: model.streamingState, + agent_phase: model.agentPhase, + // ── Messages ── + messages_count: model.messages.length, + last_message_id: lastMsg?.id ?? null, + last_message_role: lastMsg?.role ?? null, + last_message_preview: lastMsg?.text?.slice(0, 200) ?? null, + // ── Streaming buffer ── + partial_text_length: model.partialText.length, + partial_tokens_count: model.partialTokens.length, + // ── Tool calls (full objects) ── + active_tool_calls: model.activeToolCalls.length, + active_tool_calls_full: model.activeToolCalls, + // ── HITL / Confirmation ── + confirmation_message: model.confirmationMessage, + pending_tool_name: model.pendingToolName, + pending_tool_args: model.pendingToolArgs, + pending_confirmation_risk: model.pendingConfirmationRisk, + pending_risk_level: model.pendingRiskLevel, + // ── LLM health ── + llm_status: model.llmStatus, + llm_banner_dismissed: model.llmBannerDismissed, + llm_retry_countdown: model.llmRetryCountdown, + llm_banner_message: model.llmBannerMessage, + // ── Conversation list ── + conversations_count: model.conversations.length, + conversations_has_next: model.conversationsHasNext, + // ── UI state ── + is_debug_panel_open: model.isDebugPanelOpen, + is_conversation_sidebar_open: model.isConversationSidebarOpen, + is_loading_history: model.isLoadingHistory, + queue_position: model.queuePosition, + user_cancelled: model._userCancelled, + // ── Error ── error: model.error, }; try { @@ -415,23 +446,29 @@ {#if model.isDebugPanelOpen} -