api: retry transient connection errors, misc fixes
- Retry up to 5 times with exponential backoff (2s, 4s, 8s, 16s) on transient errors: IncompleteMessage, connection closed/reset/ refused, timeouts. Non-transient errors fail immediately. - tail command: print to stdout instead of stderr - state_dir rename: output_dir → state_dir throughout knowledge.rs Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
5d803441c9
commit
3e410347a2
3 changed files with 53 additions and 31 deletions
|
|
@ -264,9 +264,8 @@ pub fn spawn_agent(
|
|||
|
||||
let log_dir = store::memory_dir().join("logs");
|
||||
fs::create_dir_all(&log_dir).ok();
|
||||
let agent_log = fs::OpenOptions::new()
|
||||
.create(true).append(true)
|
||||
.open(log_dir.join(format!("{}.log", agent_name)))
|
||||
let agent_log = fs::File::create(
|
||||
log_dir.join(format!("{}-{}.log", agent_name, store::compact_timestamp())))
|
||||
.unwrap_or_else(|_| fs::File::create("/dev/null").unwrap());
|
||||
|
||||
let child = std::process::Command::new("poc-memory")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue