Repository navigation
Conversation
deliver=bot-chat used to spawn hermes chat against a session CLI/TUI/ Desktop already owned, which failed with exit 1 and dropped the job output. Admit the turn durably first, skip the second runner while the lease is held, and retry on later scheduler ticks.
This PR makes cron→Bot Chat delivery durable (#99956). A new
Verdict: LGTM |
Adapt FalconOrtiz's owner-mailbox proposal from #101564 onto the current notification poller and topical modules. The durable mailbox is cross-process ingress only: the existing owner admits its normal prompt turn after the current turn and human FIFO clear. Retain immutable receipts, stable admission identities, capability and lease fencing, compression lineage, and disable blind recovery replay of imported turns. The original stale server hunks and expiring receipt protocol were rebuilt rather than cherry-picked: the current facade decomposition and durable busy admission contract differ. Credit the earlier owner-mailbox work in #100544 and durable producer work in #100319. Co-authored-by: fangliquanflq <fangliquan@qq.com> Co-authored-by: 686f6c61 <github@00b.tech>
|
Thanks @686f6c61 for the durable producer-admission and ownership-aware retry work. #105442 has merged at Leaving this PR open: its general queue-before-subprocess and later scheduler-tick drain also preserve/retry delivery after unsupported or CLI-only owners release, and after failures in the unowned CLI lane. The merged live-consumer path does not provide that general fallback queue. That surviving behavior needs separate consideration, including the at-least-once/ambiguous-retry concerns already discussed here; it is not fully superseded by the Desktop/TUI fix. |
Adapt FalconOrtiz's owner-mailbox proposal from NousResearch#101564 onto the current notification poller and topical modules. The durable mailbox is cross-process ingress only: the existing owner admits its normal prompt turn after the current turn and human FIFO clear. Retain immutable receipts, stable admission identities, capability and lease fencing, compression lineage, and disable blind recovery replay of imported turns. The original stale server hunks and expiring receipt protocol were rebuilt rather than cherry-picked: the current facade decomposition and durable busy admission contract differ. Credit the earlier owner-mailbox work in NousResearch#100544 and durable producer work in NousResearch#100319. Co-authored-by: fangliquanflq <fangliquan@qq.com> Co-authored-by: 686f6c61 <github@00b.tech>
|
#105442 landed the Desktop/TUI live-owner path and closed #99956. Leaving this open for the residual: queue-before-subprocess for CLI-only / unsupported owners, and drain after unowned-CLI failure. Not rebasing the landed live-consumer path onto this branch. At-least-once / ambiguous-retry stays open. Dropped |
Keep never-started output behind unsupported owners and drain in admission order after release. Persist claims before execution and never replay uncertain started turns. Existing supported-owner receipts keep their authority. Credits 686f6c61's residual queue proposal in #100319. This is a scoped implementation, not general retry of failed CLI subprocesses. Native Electron before/after: CLI-owned target previously returned SESSION_NOT_OWNED and remained empty after release/tick; now its queued output and reply appear once in the target Bot Chat. Nested quiet CLI message_agent delivery to a named Desktop owner also passes on base.
Keep never-started output behind unsupported owners and drain in admission order after release. Persist claims before execution and never replay uncertain started turns. Existing supported-owner receipts keep their authority. Credits 686f6c61's residual queue proposal in #100319. This is a scoped implementation, not general retry of failed CLI subprocesses. Native Electron before/after: CLI-owned target previously returned SESSION_NOT_OWNED and remained empty after release/tick; now its queued output and reply appear once in the target Bot Chat. Nested quiet CLI message_agent delivery to a named Desktop owner also passes on base.
|
Thanks @686f6c61. The surviving CLI-only-owner deferral now landed in #111273 at 8f78531 with credit. Real CLI owner + Electron + scheduler tick A/B passed, including custom roots, concurrent drain claims and exception isolation. Leaving this PR open only for its distinct arbitrary unowned-CLI failure retry proposal: the landed path deliberately never replays an already-claimed/uncertain attempt, so it is not a complete supersession of that policy. |
What does this PR do?
#105442 landed the Desktop/TUI live-owner path and closed #99956. Cron can now admit into an advertised Desktop/TUI Bot Chat owner; that work is not repeated here.
This PR is the leftover that merge did not take: a general queue-before-subprocess for CLI-only / unsupported owners, plus scheduler-tick drain after the unowned CLI lane fails. While a live owner holds the session the one-shot
hermes chatrunner is skipped; after release (or after a CLI-lane failure) later ticks retry from the durable queue. It does not inject into the live transcript (that is #70406).The branch still carries the original combined patch and conflicts with current main. It is not rebased onto the landed live-consumer path. At-least-once / ambiguous-retry behavior needs separate consideration before this residual should land.
Related Issue
#99956 (completed by #105442). Residual only: CLI-only / unsupported owners and unowned-CLI failure drain.
Type of Change
Changes Made
cron/bot_chat_delivery.py: durable queue, live-owner probe, draincron/scheduler.py:_deliver_to_bot_chatadmits then drains; idle ticks retry the queuetests/cron/test_cron_bot_chat_delivery.py: live-owner defers without a second subprocess; drain after CLI failureHow to Test
Not runtime-tested against a live Desktop or CLI owner. Not re-run against current main (CONFLICTING).
Checklist
Code
fix(scope):,feat(scope):, etc.)Documentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs
N/A