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,11 +1,20 @@
|
||||
//! Git credential management tool.
|
||||
//!
|
||||
//! Provides store, list, and erase actions for git credentials
|
||||
//! by communicating with `git credential approve/reject` via stdin.
|
||||
|
||||
use crate::tools::{execute_cmd, Tool, ToolCtx};
|
||||
use anyhow::Result;
|
||||
use serde_json::{json, Value};
|
||||
use std::io::Write;
|
||||
use std::process::{Command, Stdio};
|
||||
use tracing::{info, instrument};
|
||||
|
||||
/// Tool that manages git credentials (store, list, erase).
|
||||
///
|
||||
/// Interacts with the git credential helper protocol via `git credential approve`
|
||||
/// (for storing) and `git credential reject` (for erasing). The `list` action
|
||||
/// reads the global git config.
|
||||
pub struct GitCred;
|
||||
|
||||
impl Tool for GitCred {
|
||||
@@ -43,8 +52,10 @@ impl Tool for GitCred {
|
||||
})
|
||||
}
|
||||
|
||||
#[instrument(skip(self, _ctx, args))]
|
||||
fn run(&self, _ctx: &ToolCtx, args: &Value) -> Result<String> {
|
||||
let action = crate::tools::arg_str(args, "action")?;
|
||||
info!(action, "git_cred invoked");
|
||||
|
||||
match action.as_str() {
|
||||
"store" => {
|
||||
@@ -60,6 +71,7 @@ impl Tool for GitCred {
|
||||
stdin.write_all(input.as_bytes())?;
|
||||
}
|
||||
child.wait()?;
|
||||
info!("credential stored for {url}");
|
||||
Ok(format!("Credential stored for {url}"))
|
||||
}
|
||||
"list" => {
|
||||
@@ -79,6 +91,7 @@ impl Tool for GitCred {
|
||||
stdin.write_all(input.as_bytes())?;
|
||||
}
|
||||
child.wait()?;
|
||||
info!("credential erased for {url}");
|
||||
Ok(format!("Credential erased for {url}"))
|
||||
}
|
||||
_ => anyhow::bail!("unknown action: {}", action),
|
||||
|
||||
Reference in New Issue
Block a user