Repository navigation
Commit 61bed1c
Смерджено в ручную
* fix: make the spawned app-server handshake deadline overridable (#55)
The spawned `codex app-server` initialize had a hard 10s deadline. The
`spawnedInitializeTimeoutMs` option existed but nothing in production set
it — the only caller was a test — so on a cold start, a CPU-quota'd
container or a loaded CI runner, `/codex:*` failed with a message the
user could neither act on nor tune.
Add `CODEX_COMPANION_SPAWNED_INITIALIZE_TIMEOUT_MS`, mirroring the
existing `CODEX_COMPANION_BROKER_IDLE_TIMEOUT_MS` resolver in
app-server-broker.mjs (same env-name shape, same lenient parse, same
fall-back-to-default on garbage). It rejects `<= 0` rather than treating
0 as "disabled": a 0ms handshake budget would just fail instantly.
Also name the deadline that fired and the knob that raises it in the
error message, via an optional `timeoutMessage` on request(). The shared
request() default is unchanged, so the broker transport keeps its
generic wording.
Deliberately not implemented: the progress-based deadline (option 3 in
the issue). Keeping this minimal.
Closes #55
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LA3HNpq2wRzWpRDBnHusvw
* fix: reject sub-millisecond initialize timeout overrides
The `parsed <= 0` guard ran before `Math.floor`, so a positive fraction
such as `0.5` passed validation and then floored to `0`. request() only
arms its timer when `timeoutMs > 0`, so that silently disarmed the
handshake deadline entirely and a wedged spawned app-server would hang
forever — exactly the failure mode this deadline exists to prevent
(fork #29/#31).
Floor first, then validate. A sub-millisecond budget is unusable input,
so it falls back to the 10s default rather than clamping to an
instantly-failing 1ms. Math.floor(NaN)/Math.floor(Infinity) stay
non-finite, so the existing garbage-input cases are unaffected.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LA3HNpq2wRzWpRDBnHusvw
* fix: reject initialize timeout overrides above Node's timer ceiling
Node stores a timer's delay in a 32-bit signed int, so setTimeout
silently reduces any delay above 2^31-1 to 1ms (with a
TimeoutOverflowWarning). The resolver accepted such values, so a user
raising the deadline to something enormous got a handshake that failed
almost instantly — the opposite of what they asked for.
This is the mirror image of the sub-millisecond case fixed in the
previous commit. Both extremes are unusable input, so both fall back to
the 10s default rather than clamping: clamping would silently run a
deadline that means the opposite of what the user typed, while the
default is the documented behaviour. The ceiling itself remains valid.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LA3HNpq2wRzWpRDBnHusvw
---------
Co-authored-by: axisrow <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
1 parent 9d0bac5 commit 61bed1c
3 files changed
Lines changed: 185 additions & 5 deletions
File tree
- plugins/codex
- scripts/lib
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
35 | 70 | | |
36 | 71 | | |
37 | 72 | | |
| |||
106 | 141 | | |
107 | 142 | | |
108 | 143 | | |
109 | | - | |
| 144 | + | |
110 | 145 | | |
111 | 146 | | |
112 | 147 | | |
| |||
116 | 151 | | |
117 | 152 | | |
118 | 153 | | |
119 | | - | |
| 154 | + | |
120 | 155 | | |
121 | 156 | | |
122 | 157 | | |
| |||
130 | 165 | | |
131 | 166 | | |
132 | 167 | | |
133 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
134 | 171 | | |
135 | 172 | | |
136 | 173 | | |
| |||
272 | 309 | | |
273 | 310 | | |
274 | 311 | | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
275 | 316 | | |
276 | 317 | | |
277 | 318 | | |
278 | 319 | | |
279 | 320 | | |
280 | | - | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
281 | 328 | | |
282 | 329 | | |
283 | 330 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 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 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
0 commit comments