Commit a24c6e1
committed
Six concrete bugs + two cheap v2 extensions from the review at
#16102 (comment)
Larger items (structured comments as session substrate, taxonomy
reorg) deferred to v2 with reply posted on the issue.
Pre-merge bug fixes
- unblock_task: close any stale current_run_id pointer with a
reclaimed run inside the unblock txn. Defensive; the invariant
holds under current data paths (block_task already closes the
run) but a future or external write that leaves the pointer
dangling would otherwise persist across the ready->blocked->
ready cycle. Mirrors the same pattern in claim_task +
archive_task.
- Migration backfill: wrap the in-flight backfill loop in
write_txn and add a CAS guard (`current_run_id IS NULL`) on
the pointer UPDATE, with a cleanup path that marks any orphan
run row reclaimed if the CAS fails. Prevents races against a
concurrent dispatcher between SELECT and INSERT.
- Notifier sub leak on non-done terminals: unsub on the last
delivered event's kind being terminal (completed / blocked /
gave_up / crashed / timed_out), not just on task.status in
(done, archived). blocked / gave_up / crashed / timed_out used
to fire one ping then strand the subscription row forever.
- Notifier thrashes dead chats: per-subscription send-failure
counter keyed on (task_id, platform, chat_id, thread_id).
After 3 consecutive adapter.send exceptions, drop the sub
automatically. Counter resets on any successful send.
Daemon ops visibility
- run_daemon on_tick now tracks consecutive ticks where the
ready queue is non-empty but 0 spawns succeeded. After 6 such
ticks (default ~30s at interval=5), emits a WARN line to
stderr pointing at profile health (venv, PATH, credentials)
and `hermes kanban list --status blocked`. Rate-limited to
one message per 5 minutes so a persistent outage doesn't
spam logs.
v2 extensions shipped in scope (pure upside)
- build_worker_context: new "Recent work by @assignee" section
surfacing the 5 most-recent completed runs for the current
task's assignee (excluding this task). Bounded, cached by
the natural LIMIT, no new dependencies. Skipped when the
task has no assignee.
- Gateway notifier message prefix: terminal pings now lead
with `@<assignee>` so fleets (one chat subscribing to many
tasks with different workers) stay legible at a glance.
One-line template change.
Deferred to v2 (noted in reply to erosika)
- recompute_ready full-scan starvation at 10k+ tasks: dirty-set
approach is a real refactor; fine as follow-up.
- Skill ↔ assignee validation for routing: depends on skill
introspection surface that isn't nailed down.
- Structured comments (in_reply_to / addressed_to / kind) as
multi-peer session substrate: schema-affecting, exactly the
v2-scope design vulcan flagged shouldn't cram into this PR.
- Pattern vs mechanism taxonomy split in docs: pure docs reorg,
low urgency.
Tests (+6 in core functionality)
- unblock_invariant_recovery (engineered leak, defensive close)
- unblock_normal_path_no_spurious_run (no run created on happy
block->unblock; erosika's main concern)
- migration_backfill_idempotent_under_re_run (3x init_db on a
legacy-shape DB yields exactly 1 run row, not 3)
- build_worker_context_includes_role_history (role continuity)
- build_worker_context_role_history_skipped_when_no_assignee
- build_worker_context_role_history_bounded_to_5
180/180 kanban suite pass under scripts/run_tests.sh. Live-smoke
exercised all three kernel fixes end-to-end with isolated
HERMES_HOME.
1 parent 7206eed commit a24c6e1
4 files changed
Lines changed: 360 additions & 40 deletions
File tree
- gateway
- hermes_cli
- tests/hermes_cli
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2490 | 2490 | | |
2491 | 2491 | | |
2492 | 2492 | | |
| 2493 | + | |
| 2494 | + | |
| 2495 | + | |
| 2496 | + | |
| 2497 | + | |
| 2498 | + | |
| 2499 | + | |
| 2500 | + | |
| 2501 | + | |
| 2502 | + | |
| 2503 | + | |
| 2504 | + | |
| 2505 | + | |
| 2506 | + | |
| 2507 | + | |
| 2508 | + | |
| 2509 | + | |
2493 | 2510 | | |
2494 | 2511 | | |
2495 | 2512 | | |
| |||
2546 | 2563 | | |
2547 | 2564 | | |
2548 | 2565 | | |
| 2566 | + | |
| 2567 | + | |
| 2568 | + | |
| 2569 | + | |
| 2570 | + | |
2549 | 2571 | | |
2550 | 2572 | | |
2551 | 2573 | | |
| |||
2563 | 2585 | | |
2564 | 2586 | | |
2565 | 2587 | | |
2566 | | - | |
| 2588 | + | |
2567 | 2589 | | |
2568 | 2590 | | |
2569 | 2591 | | |
2570 | 2592 | | |
2571 | 2593 | | |
2572 | 2594 | | |
2573 | | - | |
| 2595 | + | |
2574 | 2596 | | |
2575 | 2597 | | |
2576 | 2598 | | |
2577 | 2599 | | |
2578 | 2600 | | |
2579 | | - | |
| 2601 | + | |
2580 | 2602 | | |
2581 | 2603 | | |
2582 | 2604 | | |
2583 | 2605 | | |
2584 | | - | |
| 2606 | + | |
2585 | 2607 | | |
2586 | 2608 | | |
2587 | 2609 | | |
2588 | 2610 | | |
2589 | 2611 | | |
2590 | 2612 | | |
2591 | 2613 | | |
2592 | | - | |
| 2614 | + | |
2593 | 2615 | | |
2594 | 2616 | | |
2595 | 2617 | | |
2596 | 2618 | | |
2597 | 2619 | | |
2598 | 2620 | | |
2599 | 2621 | | |
| 2622 | + | |
| 2623 | + | |
| 2624 | + | |
| 2625 | + | |
2600 | 2626 | | |
2601 | 2627 | | |
2602 | 2628 | | |
2603 | 2629 | | |
| 2630 | + | |
| 2631 | + | |
2604 | 2632 | | |
| 2633 | + | |
| 2634 | + | |
2605 | 2635 | | |
2606 | | - | |
2607 | | - | |
| 2636 | + | |
| 2637 | + | |
| 2638 | + | |
| 2639 | + | |
2608 | 2640 | | |
| 2641 | + | |
| 2642 | + | |
| 2643 | + | |
| 2644 | + | |
| 2645 | + | |
| 2646 | + | |
| 2647 | + | |
| 2648 | + | |
2609 | 2649 | | |
2610 | 2650 | | |
2611 | 2651 | | |
2612 | 2652 | | |
2613 | 2653 | | |
2614 | 2654 | | |
2615 | 2655 | | |
2616 | | - | |
| 2656 | + | |
| 2657 | + | |
| 2658 | + | |
| 2659 | + | |
| 2660 | + | |
| 2661 | + | |
| 2662 | + | |
| 2663 | + | |
| 2664 | + | |
2617 | 2665 | | |
2618 | 2666 | | |
2619 | 2667 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
924 | 924 | | |
925 | 925 | | |
926 | 926 | | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
927 | 935 | | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
928 | 959 | | |
929 | 960 | | |
930 | 961 | | |
| |||
941 | 972 | | |
942 | 973 | | |
943 | 974 | | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
944 | 989 | | |
945 | 990 | | |
946 | 991 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
436 | 436 | | |
437 | 437 | | |
438 | 438 | | |
439 | | - | |
440 | | - | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
441 | 443 | | |
442 | 444 | | |
443 | 445 | | |
444 | 446 | | |
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 | | - | |
| 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 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
473 | 489 | | |
474 | 490 | | |
475 | 491 | | |
| |||
1356 | 1372 | | |
1357 | 1373 | | |
1358 | 1374 | | |
1359 | | - | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
1360 | 1385 | | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
1361 | 1402 | | |
1362 | | - | |
| 1403 | + | |
| 1404 | + | |
1363 | 1405 | | |
1364 | 1406 | | |
1365 | 1407 | | |
| |||
2100 | 2142 | | |
2101 | 2143 | | |
2102 | 2144 | | |
| 2145 | + | |
| 2146 | + | |
| 2147 | + | |
| 2148 | + | |
| 2149 | + | |
| 2150 | + | |
| 2151 | + | |
| 2152 | + | |
| 2153 | + | |
| 2154 | + | |
| 2155 | + | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
| 2159 | + | |
| 2160 | + | |
| 2161 | + | |
| 2162 | + | |
| 2163 | + | |
| 2164 | + | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
| 2169 | + | |
| 2170 | + | |
2103 | 2171 | | |
2104 | 2172 | | |
2105 | 2173 | | |
| |||
0 commit comments