Commit eda4da2
authored
fix(claude-code): eliminate PROCESSING false-positives from compaction and /exit (#199)
Replace the regex-based THINKING_BEFORE_SEPARATOR_PATTERN.search() with a
last-separator-anchored walk-back algorithm in get_status(). The old regex
matched any spinner+ellipsis line before *any* separator in the scrollback,
causing two false-positive patterns:
1. Mid-conversation compaction: '✢ Compacting…' → sep → more output → last sep
The compaction spinner sits before its own separator, not the last one.
2. Post-exit: spinner → sep (task done) → ❯ /exit → last sep (exit menu)
The spinner belongs to the completed task, not the exit separator.
The new algorithm walks backwards from the last separator only. If it hits
a spinner line before another separator, the agent is genuinely processing.
If it hits another separator first, the spinner is from a completed task.
Adds three regression tests covering both false-positive patterns.1 parent 2cad3e5 commit eda4da2
2 files changed
Lines changed: 67 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
49 | 42 | | |
50 | 43 | | |
51 | 44 | | |
| |||
335 | 328 | | |
336 | 329 | | |
337 | 330 | | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
343 | 347 | | |
344 | 348 | | |
345 | 349 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
425 | 425 | | |
426 | 426 | | |
427 | 427 | | |
| 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 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
428 | 474 | | |
429 | 475 | | |
430 | 476 | | |
| |||
0 commit comments