Fix four review findings: busy release, poison recovery, core.md errors, chat loop

Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
This commit is contained in:
2026-09-18 21:06:58 -07:00
parent 2be8581a0c
commit c060c80c7e
8 changed files with 100 additions and 12 deletions
+2 -2
View File
@@ -58,10 +58,10 @@ pub fn new_session_id() -> SessionId {
// The system clock is never before the unix epoch on any machine this runs on.
let elapsed = std::time::SystemTime::now()
.duration_since(std::time::UNIX_EPOCH)
.expect("the system clock is not before the unix epoch");
.unwrap_or_default();
// "chat-<digits>-<digits>" uses only [a-z0-9-] and stays well under 64 bytes, so this cannot fail.
let candidate = format!("chat-{}-{}", elapsed.as_secs(), elapsed.subsec_nanos());
SessionId::new(&candidate).expect("chat-<digits>-<digits> is always a valid session id")
SessionId::new(&candidate).unwrap_or_else(|_| SessionId::new("chat-0-0").unwrap_or_default())
}
/// Sends one turn and reads the reply. `on_event` sees every event frame as it arrives.
+2 -1
View File
@@ -245,8 +245,9 @@ fn run_interactive(opts: &Options) -> ExitCode {
}
}
Ok(Err(e)) => {
// A failed turn is reported and the loop goes on: the session still exists, so the
// next line resumes it.
eprintln!("bxctl: {e}");
return ExitCode::from(1);
}
}
}