Redirect noisy warnings to debug log to stop TUI corruption
Duplicate key warnings fire on every store load and were writing to stderr, corrupting the TUI display. Log write warnings and MCP server failures are similarly routine. Route these to dbglog. Serious errors (rkyv snapshot failures, store corruption) remain on stderr — those are real problems the user needs to see. Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
c31d531954
commit
3e0d52c451
4 changed files with 5 additions and 5 deletions
|
|
@ -801,7 +801,7 @@ impl ContextState {
|
||||||
pub fn push_log(&mut self, section: Section, node: AstNode) {
|
pub fn push_log(&mut self, section: Section, node: AstNode) {
|
||||||
if let Some(ref log) = self.conversation_log {
|
if let Some(ref log) = self.conversation_log {
|
||||||
if let Err(e) = log.append_node(&node) {
|
if let Err(e) = log.append_node(&node) {
|
||||||
eprintln!("warning: log: {:#}", e);
|
dbglog!("warning: log: {:#}", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.section_mut(section).push(node);
|
self.section_mut(section).push(node);
|
||||||
|
|
|
||||||
|
|
@ -403,7 +403,7 @@ impl Agent {
|
||||||
if let Some(ref log) = ctx.conversation_log {
|
if let Some(ref log) = ctx.conversation_log {
|
||||||
let node = &ctx.conversation()[branch_idx];
|
let node = &ctx.conversation()[branch_idx];
|
||||||
if let Err(e) = log.append_node(node) {
|
if let Err(e) = log.append_node(node) {
|
||||||
eprintln!("warning: log: {:#}", e);
|
dbglog!("warning: log: {:#}", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -578,7 +578,7 @@ impl Agent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
eprintln!("warning: failed to reload identity: {:#}", e);
|
dbglog!("warning: failed to reload identity: {:#}", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -148,7 +148,7 @@ async fn ensure_init() -> Result<()> {
|
||||||
let args: Vec<&str> = cfg.args.iter().map(|s| s.as_str()).collect();
|
let args: Vec<&str> = cfg.args.iter().map(|s| s.as_str()).collect();
|
||||||
match McpServer::spawn(&cfg.name, &cfg.command, &args).await {
|
match McpServer::spawn(&cfg.name, &cfg.command, &args).await {
|
||||||
Ok(server) => reg.servers.push(server),
|
Ok(server) => reg.servers.push(server),
|
||||||
Err(e) => eprintln!("warning: MCP server {} failed: {:#}", cfg.name, e),
|
Err(e) => dbglog!("warning: MCP server {} failed: {:#}", cfg.name, e),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
||||||
|
|
@ -200,7 +200,7 @@ impl Store {
|
||||||
// Report duplicate keys
|
// Report duplicate keys
|
||||||
for (key, uuids) in &key_uuids {
|
for (key, uuids) in &key_uuids {
|
||||||
if uuids.len() > 1 {
|
if uuids.len() > 1 {
|
||||||
eprintln!("WARNING: key '{}' has {} UUIDs (duplicate nodes)", key, uuids.len());
|
dbglog!("WARNING: key '{}' has {} UUIDs (duplicate nodes)", key, uuids.len());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue