Enhance logging and documentation across utility tools and TUI overlays
- Added tracing instrumentation and improved logging messages in the Pong, Todofinish, and Todowrite tools for better debugging and monitoring. - Enhanced documentation comments for clarity on tool functionalities and workflows. - Implemented tracing in WorkflowRun, NoteFinding, ReadFindings, and HiveMind tools to track execution phases and findings. - Updated TUI overlays (e.g., Bash, Clear Confirm, Editor, Effort Level, Help, Key Input, Learning, Loading, MCP, Model Selector, Plan, Quit Confirm, Rewind, Settings, Todo, Usage) with debug logging to capture rendering details. - Improved the status bar and workflow panel rendering with additional debug information. - Added tracing to various utility functions to facilitate better performance monitoring and error tracking.
This commit is contained in:
@@ -1,9 +1,17 @@
|
||||
//! Sequential thinking tool — step-by-step reasoning.
|
||||
//!
|
||||
//! Allows the agent to record one step of a chain-of-thought reasoning process,
|
||||
//! tracking progress through a planned number of steps.
|
||||
|
||||
use crate::tools::{Tool, ToolCtx};
|
||||
use anyhow::Result;
|
||||
use serde_json::{json, Value};
|
||||
use tracing::{info, instrument};
|
||||
|
||||
/// Perform sequential / step-by-step reasoning (chain-of-thought).
|
||||
///
|
||||
/// Flow: extract thought, step number, total steps, and continuation flag from
|
||||
/// args → format into a reasoning step response.
|
||||
pub struct SeqThink;
|
||||
|
||||
impl Tool for SeqThink {
|
||||
@@ -40,6 +48,7 @@ impl Tool for SeqThink {
|
||||
})
|
||||
}
|
||||
|
||||
#[instrument(skip(self, _ctx, args))]
|
||||
fn run(&self, _ctx: &ToolCtx, args: &Value) -> Result<String> {
|
||||
let thought = crate::tools::arg_str(args, "thought")?;
|
||||
let step = args
|
||||
@@ -55,6 +64,8 @@ impl Tool for SeqThink {
|
||||
.and_then(|v| v.as_bool())
|
||||
.unwrap_or(false);
|
||||
|
||||
info!(step, total, next_needed, "sequential think step");
|
||||
|
||||
Ok(format!(
|
||||
"Step {}/{}: {}\n{}",
|
||||
step,
|
||||
|
||||
Reference in New Issue
Block a user