Skip to content

Linger is An Open-Source Personal Agent That Runs Fully on Your PC. We aim to break Big Tech’s grip on AI by bringing powerful local AI to everyday computers through efficient model–harness co-design, so everyone can run their own.

fix(computer): confirm a Codex stop when the process left on its own

jeffrey875ab059ec32
diff --git a/apps/computer/local-daemon/internal/provider/native/codex_process.go b/apps/computer/local-daemon/internal/provider/native/codex_process.go
index 1110edd5..0c8624ed 100644
--- a/apps/computer/local-daemon/internal/provider/native/codex_process.go
+++ b/apps/computer/local-daemon/internal/provider/native/codex_process.go
@@ -306,10 +306,12 @@ func (p *codexProcess) stopTree() bool {
p.mu.Unlock()
p.reapWithGrace()
gone := p.groupGone()
- p.mu.Lock()
- external := p.external
- p.mu.Unlock()
- excused := cleanupErr == nil || (external && errors.Is(cleanupErr, errCodexChildGone))
+ // A cleanup that failed because the process had gone needs no excuse
+ // beyond the reaped leader and the empty group: nothing is left to run
+ // the turn or its terminals. Who ended the process does not matter, and
+ // cannot be told reliably: the leader can exit just before the stop
+ // above closes its stdin, which then counts the exit as the stop's.
+ excused := cleanupErr == nil || errors.Is(cleanupErr, errCodexChildGone)
return p.confirmIf(p.isReaped() && gone && excused, logger)
}