Commit 00ff7ff
fix(screentracker): make writeStabilize Phase 1 non-fatal when agents don't echo input (#208)
Fixes #123.
- Make Phase 1 (echo detection) of `writeStabilize` non-fatal on timeout -- proceed to Phase 2 instead of returning HTTP 500
- Guard non-fatal path with `errors.Is(err, util.WaitTimedOut)` so context cancellation still propagates
- Reduce Phase 1 timeout from 15s to 2s (terminal echo is near-instant)
- Extract `writeStabilizeEchoTimeout` and `writeStabilizeProcessTimeout` constants
- Log at Info level (not Warn) since non-echoing agents hit this on every message
- Add doc comment on `formatPaste` in `claude.go` documenting the ESC limitation with TUI selection prompts
- Add tests for non-echoing agents (reacts, unresponsive, context-cancelled)
## Known limitation
For TUI selection prompts (numbered/arrow-key lists), this fix eliminates the 500 but does **not** deliver the correct selection -- the `\x1b` (ESC) in bracketed paste cancels the selection widget. The correct approach is `MessageTypeRaw`. Documented via a comment on `formatPaste` in `lib/httpapi/claude.go`.
Also discovered a separate issue during smoke-testing: #209 (fixed in #215, included in this branch).
> 🤖 Written by a Coder Agent. Reviewed by several humans and a veritable army of robots.
Co-authored-by: 35C4n0r <70096901+35C4n0r@users.noreply.github.com>1 parent d42b9ac commit 00ff7ff
File tree
6 files changed
+266
-28
lines changed- lib
- httpapi
- msgfmt
- testdata/initialization/claude/ready
- screentracker
6 files changed
+266
-28
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
8 | 13 | | |
9 | 14 | | |
10 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
7 | 14 | | |
8 | | - | |
| 15 | + | |
9 | 16 | | |
10 | | - | |
| 17 | + | |
11 | 18 | | |
12 | 19 | | |
13 | 20 | | |
14 | 21 | | |
15 | | - | |
| 22 | + | |
16 | 23 | | |
17 | 24 | | |
18 | 25 | | |
| |||
22 | 29 | | |
23 | 30 | | |
24 | 31 | | |
25 | | - | |
| 32 | + | |
26 | 33 | | |
27 | | - | |
| 34 | + | |
28 | 35 | | |
29 | 36 | | |
30 | | - | |
| 37 | + | |
31 | 38 | | |
32 | | - | |
| 39 | + | |
33 | 40 | | |
34 | 41 | | |
35 | 42 | | |
| |||
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
19 | 40 | | |
20 | 41 | | |
21 | 42 | | |
| |||
411 | 432 | | |
412 | 433 | | |
413 | 434 | | |
414 | | - | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
415 | 448 | | |
416 | 449 | | |
417 | 450 | | |
418 | 451 | | |
419 | 452 | | |
420 | 453 | | |
421 | 454 | | |
422 | | - | |
| 455 | + | |
| 456 | + | |
423 | 457 | | |
424 | | - | |
| 458 | + | |
425 | 459 | | |
426 | 460 | | |
427 | 461 | | |
| |||
441 | 475 | | |
442 | 476 | | |
443 | 477 | | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
448 | 494 | | |
449 | 495 | | |
450 | 496 | | |
451 | | - | |
| 497 | + | |
452 | 498 | | |
453 | 499 | | |
454 | 500 | | |
| |||
527 | 573 | | |
528 | 574 | | |
529 | 575 | | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
530 | 584 | | |
531 | 585 | | |
532 | 586 | | |
| |||
0 commit comments