Show Codex background task counts
This commit is contained in:
1 parent
947ea8ecf2
commit
a9cfea89e5
5 files changed
+155
-52
No files matched your search
@@ -137,6 +137,9 @@ impl CodexDriver {
|
||||
}
|
||||
Some((_, process::Liveness::Dead)) | None => {
|
||||
process::clear(session_dir);
|
||||
// Every child thread lived in the app-server which is gone. Clear adopted open
|
||||
// ids before the replacement process reports its background count.
|
||||
subagents.finish_all();
|
||||
// Requests written to a dead process have no recipient. Put their messages back
|
||||
// in front of the unsent queue so restarting cannot silently lose them.
|
||||
while let Some(message) = state.sent.pop_back() {
|
||||
@@ -200,6 +203,10 @@ impl CodexDriver {
|
||||
}
|
||||
|
||||
impl Driver for CodexDriver {
|
||||
fn background_tasks(&self) -> Option<usize> {
|
||||
Some(self.inner.subagents.open_count())
|
||||
}
|
||||
|
||||
fn send_user_message(&self, text: String, attachments: Vec<AttachmentRef>) {
|
||||
let mut state = self.inner.state.lock().unwrap();
|
||||
if state.closed {
|
||||
|
||||
Reference in new issue
Block a user