Commit d79d14c
fix(daemon): ACP-HTTP review round 4 — write-failure ownership, loopback, error routing
Rebased onto daemon_mode_b_main (QwenLM#4353 + QwenLM#4469), no conflicts. Addresses the
PR reviewers:
- C1 (P0): SseStream now OWNS write-failure handling (log + close on first
reject; 'error' listener in doWrite; guarded onClose) — the round-3 note
claimed this but it wasn't implemented.
- C2 (P1): per-request fromLoopback threaded into sessionCtx/permission
votes; isLoopbackReq widened to 127.0.0.0/8 + ::ffff:127.* + ::1 (REST parity).
- C3 (P1): CONN_ROUTED_METHODS — route error frames like the success path
(no misroute of session/load|resume|close|heartbeat failures).
- C4 (P1): bridge.detachClient on connection/session teardown (no stale
bridge client ids).
- C5 (P1): session/close local cleanup in finally.
- C6-C11 (P2): path.isAbsolute cwd (Windows); protocolVersion clamp [1,1];
reject empty load/resume sessionId; log notification-form prompt errors;
open() before session-stream attach; shared writeStderrLine.
- C12 (P2): design doc aligned to shipped surface (env toggle only; fs/*,
terminal/*, --no-acp-http flag, acp_http capability tag marked deferred).
Suite 22 -> 25 tests. Re-verified live (125 session/update -> end_turn).
Generated with AI
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>1 parent d034c72 commit d79d14c
6 files changed
Lines changed: 272 additions & 52 deletions
File tree
- docs/design/daemon-acp-http
- packages/cli/src/serve/acpHttp
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
223 | 227 | | |
224 | 228 | | |
225 | 229 | | |
| |||
259 | 263 | | |
260 | 264 | | |
261 | 265 | | |
262 | | - | |
263 | | - | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
264 | 270 | | |
265 | 271 | | |
266 | 272 | | |
| |||
420 | 426 | | |
421 | 427 | | |
422 | 428 | | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | 22 | | |
26 | 23 | | |
27 | 24 | | |
| |||
32 | 29 | | |
33 | 30 | | |
34 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
35 | 44 | | |
36 | 45 | | |
37 | 46 | | |
| |||
110 | 119 | | |
111 | 120 | | |
112 | 121 | | |
| 122 | + | |
113 | 123 | | |
114 | 124 | | |
115 | 125 | | |
| |||
203 | 213 | | |
204 | 214 | | |
205 | 215 | | |
| 216 | + | |
206 | 217 | | |
207 | 218 | | |
208 | 219 | | |
| |||
213 | 224 | | |
214 | 225 | | |
215 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
216 | 230 | | |
217 | 231 | | |
218 | 232 | | |
| |||
249 | 263 | | |
250 | 264 | | |
251 | 265 | | |
| 266 | + | |
252 | 267 | | |
253 | 268 | | |
254 | 269 | | |
| |||
265 | 280 | | |
266 | 281 | | |
267 | 282 | | |
268 | | - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
269 | 289 | | |
270 | 290 | | |
271 | 291 | | |
| |||
301 | 321 | | |
302 | 322 | | |
303 | 323 | | |
304 | | - | |
| 324 | + | |
305 | 325 | | |
306 | 326 | | |
307 | 327 | | |
| |||
0 commit comments