Show status/thinking messages in chat window, debug empty responses

- Add ThinkingMessage variant to AppEvent for chat-visible status
- Add set_thinking() and clear_thinking() to AppState
- Thinking messages show as system messages with spinner indicator
- Auto-clear thinking messages when agent response arrives
- Tool started/completed now shown in chat window
- Add debug logging to NEAR AI provider to diagnose empty responses
- Log raw response output when text extraction returns empty

Co-Authored-By: Claude Opus 4.5 <[email protected]>
This commit is contained in:
Illia Polosukhin
2026-02-03 00:17:40 -08:00
co-authored by Claude Opus 4.5
parent 3d709eb253
commit 42d6e87186
4 changed files with 52 additions and 6 deletions
+15
View File
@@ -118,16 +118,24 @@ impl LlmProvider for NearAiProvider {
let response: NearAiResponse = self.send_request("responses", &request).await?;
tracing::debug!("NEAR AI response: {:?}", response);
// Extract text from response output
let text = response
.output
.iter()
.filter_map(|item| {
tracing::debug!("Processing output item: type={}", item.item_type);
if item.item_type == "message" {
item.content.as_ref().and_then(|contents| {
contents
.iter()
.filter_map(|c| {
tracing::debug!(
"Content item: type={}, text={:?}",
c.content_type,
c.text
);
if c.content_type == "output_text" {
c.text.clone()
} else {
@@ -143,6 +151,13 @@ impl LlmProvider for NearAiProvider {
.collect::<Vec<_>>()
.join("");
if text.is_empty() {
tracing::warn!(
"Empty response from NEAR AI. Raw output: {:?}",
response.output
);
}
Ok(CompletionResponse {
content: text,
finish_reason: FinishReason::Stop,