Repository navigation
Commit 2b576cf
fix(broker): P0 stability — idle timeout + PID liveness + shutdown timeout
Wave 1 (SUP-366/367/368) — three fixes for known stability issues, addressing
user-reported pain points around orphan brokers, zombie running jobs, and
SessionEnd hangs.
Changes:
1. app-server-broker.mjs (SUP-366, cc#108):
- 10 min idle auto-shutdown (configurable via CODEX_BROKER_IDLE_MS env)
- Fires when sockets.size === 0 for the timeout window
- Defense-in-depth alongside the SessionEnd hook
- Pattern adapted from sanghyun-io/codex-app-server-plugin
2. lib/job-control.mjs (SUP-367, cc#264/openai#164/openai#202/openai#222):
- PID liveness check via process.kill(pid, 0)
- Auto-transition status:running -> crashed when worker is gone
- Tail last 3 log lines into errorMessage for diagnostics
3. lib/broker-lifecycle.mjs (SUP-368, cc#245/openai#288, PR#293 reference):
- 5 s safety timeout in sendBrokerShutdown
- Prevents SessionEnd hook from hanging on unresponsive broker
- timer.unref() so it doesn't block process exit
INV-1 (no regression of existing /codex:* commands): preserved.
INV-2 (clean upstream rebase): minimum diff to existing files.
INV-3 (supalead skill compatibility): plugin/marketplace name unchanged.
INV-4 (no CLAUDE.md import): not added.
Refs Linear SUP-366, SUP-367, SUP-368
Project: codex-plugin-cc-plus fork (codex 안정성 + A+ delegate)
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>1 parent b0703c1 commit 2b576cf
3 files changed
Lines changed: 94 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
14 | 23 | | |
15 | 24 | | |
16 | 25 | | |
| |||
71 | 80 | | |
72 | 81 | | |
73 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
74 | 101 | | |
75 | 102 | | |
76 | 103 | | |
| |||
117 | 144 | | |
118 | 145 | | |
119 | 146 | | |
| 147 | + | |
120 | 148 | | |
121 | 149 | | |
122 | 150 | | |
| |||
225 | 253 | | |
226 | 254 | | |
227 | 255 | | |
| 256 | + | |
228 | 257 | | |
229 | 258 | | |
230 | 259 | | |
231 | 260 | | |
232 | 261 | | |
| 262 | + | |
233 | 263 | | |
234 | 264 | | |
235 | 265 | | |
| |||
244 | 274 | | |
245 | 275 | | |
246 | 276 | | |
| 277 | + | |
247 | 278 | | |
248 | 279 | | |
249 | 280 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
44 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
45 | 56 | | |
46 | 57 | | |
47 | 58 | | |
48 | 59 | | |
49 | 60 | | |
50 | 61 | | |
51 | 62 | | |
52 | | - | |
| 63 | + | |
53 | 64 | | |
54 | | - | |
55 | | - | |
| 65 | + | |
| 66 | + | |
56 | 67 | | |
57 | 68 | | |
58 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
11 | 41 | | |
12 | 42 | | |
13 | 43 | | |
| |||
174 | 204 | | |
175 | 205 | | |
176 | 206 | | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
177 | 225 | | |
178 | 226 | | |
179 | 227 | | |
| |||
0 commit comments