Skip to content

fix(comms): clear false r-q signal for silenced & callback-child jobs; raise comms limit to 20 - #395

Merged
SeemSeam merged 4 commits into
SeemSeam:mainfrom
nixecn:fix/comms-rq-and-delivery-stall
Oct 19, 2026
Merged

SeemSeam merged 4 commits into
SeemSeam:mainfrom
nixecn:fix/comms-rq-and-delivery-stall

Conversation

@nixecn

@nixecn nixecn commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Problem

In the sidebar Comms list, some terminal jobs stay stuck at r-q (execution_phase reply_queued / reason reply_delivery_pending) forever, and the operator sees agents as undelivered even though all queues are drained. Two job classes are affected:

  1. --silence jobs that completed successfully — by design they never deliver a reply (silence_on_success=True), but _expects_reply_delivery still projected reply_expected=True, so the phase stayed reply_queued with no delivery job to ever clear it.
  2. Callback (--callback/chain) child jobs — their reply feeds the parent through the callback continuation protocol with deliver_to_caller=False; they likewise never get a caller delivery job, so they sat at r-q forever.

Observed live: 4 rows across pm/ag2/ag3/gate stuck at r-q while every mailbox showed queue_depth=0, pending_reply=0 — display bug only, pipeline healthy.

Fix

  • _expects_reply_delivery now returns False for COMPLETED silence-on-success jobs and for callback-chain children.
  • Callback-child detection checks callback_edge_for_child_job, then falls back through the attempt store to callback_edge_for_child_message — chain continuation jobs are recorded as retries of the parent message, so message-id matching is essential.
  • Also raises PROJECT_VIEW_COMMS_LIMIT 8 → 20 so completed rows scroll into view instead of being truncated.

Commits (cherry-picked onto current main)

  1. feat(comms): surface pending reply deliveries and auto-repair stalled mailbox delivery — pending-reply projection + auto-repair for genuinely stalled deliveries (companion to the false-signal fix; shipped in our 8.7.9)
  2. fix(claude): accept titled composer borders in draft observation and fix(codex): recognize undimmed placeholders and status bars — draft-observation robustness fixes for provider draft detection
  3. fix(project-view): silence & callback-child jobs no longer stuck at r-q; comms limit 8->20 — the main fix

Testing

  • 2 new regression tests: test_project_view_comms_silence_success_not_reply_queued and test_project_view_comms_callback_child_not_reply_queued — both red on main, green with the fix.
  • test/test_ccbd_project_view.py bounded-tail / adaptive-budget expectations updated for the new limit.
  • 225 passing across the four affected suites on current main (2 known flaky rust-helper env tests pass in isolation; failures are pre-existing and unrelated).
  • Live verification: after the fix, previously stuck r-q rows project terminal.

🤖 Generated with Claude Code

nixecn and others added 4 commits October 18, 2026 10:30
… mailbox delivery

Two production stall fixes from the 2026-09-22 incident where 12 task_reply
events sat undelivered in gate's mailbox for 36h:

1. Pending delivery stall watchdog (repair.py): repair only covered
   'running' delivery jobs. A pending (accepted/queued) delivery whose
   mailbox claim keeps failing (conflicting lease, head race) stalled
   forever with no recovery path. repair_agent_reply_delivery_head now
   detects a pending delivery older than REPLY_DELIVERY_PENDING_STALL_SECONDS
   (300s), verifies it never reached the provider (no job_started /
   provider acceptance evidence, or claim blocked by a conflicting lease),
   and releases the reply head so the next tick re-prepares and re-claims
   the delivery. Emits reply_delivery_pending_stall_repaired for audit.

2. Comms visibility (project_view/service.py): _is_business_comms_job
   excluded reply_delivery jobs entirely, so queued replies were invisible
   in the Comms queue. Pending delivery jobs now appear as their own row
   (business_status=delivering) with reply_delivery_source_job_id linking
   back to the source ask. Terminal delivery jobs remain hidden behind the
   source row.

Tests: test_reply_delivery_pending_stall_repair.py covers stalled repair
after threshold, fresh pending untouched, and comms row surfacing.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Claude Code now renders the composer top border with an embedded session
title (e.g. '─── release-verification-closure-purring-key ─'). The strict
plain-dash border match failed closed with composer_layout_unknown, which
blocked all reply deliveries to claude agents and wedged mailboxes.

Accept border lines with a left dash run, optional embedded title text,
and a trailing dash run of any length. Verified against a live pane:
state empty / claude_blank (previously composer_layout_unknown).
…observation

Newer Codex builds (agt3 pane, Oct 2026) render the composer placeholder
('Implement {feature}') without the dim attribute and reword it, and render
model/workspace status fields ('combo/model default · ~/workspace') without
dimming the separator. Both layouts failed closed with
composer_layout_unknown, which wedged deliveries in clear_unconfirmed loops.

- Accept the known native placeholder texts ('Ask Codex to do anything',
  'Implement {feature}') regardless of dim attribute, at the initial cursor
  with an empty composer region below. Anything else still fails closed.
- Verified against a live pane: state empty / codex_placeholder.
- Update opaque-footer tests: a known placeholder at the initial cursor is
  empty evidence on its own; human draft lines still fail closed.
- Bump package.json to 8.7.9 (missed in the version bump commit).
…-q; comms limit 8->20

- _expects_reply_delivery now excludes COMPLETED silence_on_success jobs
  (no delivery obligation by design) and callback-chain children (their
  reply feeds the parent via continuation, deliver_to_caller=False).
  Callback-child detection checks callback edges by child_job_id and, via
  the attempt store, by child_message_id — chain continuation jobs share
  the parent message id.
- PROJECT_VIEW_COMMS_LIMIT 8 -> 20 so completed rows scroll instead of
  being truncated at the top of the Comms list.
- Regression tests: silence-success and callback-child COMPLETED jobs now
  project execution_phase=terminal instead of reply_queued; bounded-tail
  and adaptive-budget expectations updated for the new limit.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@SeemSeam
SeemSeam merged commit 1ff3144 into SeemSeam:main Oct 19, 2026
12 checks passed
spitzheffel pushed a commit to spitzheffel/claude_code_bridge that referenced this pull request Oct 19, 2026
spitzheffel pushed a commit to spitzheffel/claude_code_bridge that referenced this pull request Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants