mirror of
https://github.com/outbackdingo/optimclaw.git
synced 2026-08-26 15:40:18 +00:00
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:
co-authored by
Claude Opus 4.5
parent
3d709eb253
commit
42d6e87186
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user