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:
asepharyana
2026-07-20 15:53:43 +07:00
parent f84dfb8476
commit 16494d4b1e
69 changed files with 637 additions and 30 deletions
+2 -1
View File
@@ -3,7 +3,7 @@
use std::path::{Path, PathBuf};
use anyhow::Result;
use tracing::info;
use tracing::{info, instrument};
use crate::workflow::hive_mind::types::NodeOutput;
@@ -11,6 +11,7 @@ use crate::workflow::hive_mind::types::NodeOutput;
///
/// Flow: create docs/runs/ dir → build markdown content → write file.
/// This is deterministic (not an LLM step) and never skippable.
#[instrument(skip(nodes))]
pub fn write_hive_mind_convergence(
run_dir: &Path,
nodes: &[NodeOutput],
@@ -1,7 +1,7 @@
//! Workflow execution — runs a parsed workflow script phase by phase.
use anyhow::Result;
use tracing::info;
use tracing::{info, instrument};
use crate::llm::provider::LlmClient;
use crate::tools::ToolCtx;
@@ -11,6 +11,7 @@ use crate::workflow::script::WorkflowScript;
/// Execute each phase of a workflow script sequentially.
///
/// Flow: for each phase → execute_primitive → collect result.
#[instrument(skip(tool_ctx, _llm_client))]
pub async fn execute_workflow(
script: &WorkflowScript,
tool_ctx: &ToolCtx,
+2 -1
View File
@@ -1,7 +1,7 @@
//! Workflow script — parse and execute user-defined workflow scripts.
use anyhow::Result;
use tracing::info;
use tracing::{info, instrument};
/// A single phase in a parsed workflow script.
#[derive(Debug, Clone)]
@@ -29,6 +29,7 @@ impl WorkflowScript {
/// - name: implement
/// directive: "Implement the changes..."
/// ```
#[instrument]
pub fn parse(yaml: &str) -> Result<Self> {
let parsed: serde_json::Value = serde_yaml_ng::from_str(yaml)
.map_err(|e| anyhow::anyhow!("Failed to parse workflow YAML: {e}"))?;