Skip to content

feat: add opt-in durable Codex CLI queue nudger (#83) - #88

Merged
OBenner merged 3 commits into
mainfrom
feat/83-codex-queue-nudger
Nov 16, 2026
Merged

OBenner merged 3 commits into
mainfrom
feat/83-codex-queue-nudger

Conversation

@OBenner

@OBenner OBenner commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Codex roles can leave Synloq mail unread until someone activates their chat. This adds an opt-in relay service that queues an identifier-only inbox reminder through codex queue --thread <exact UUID>, without --resume. The default remains disabled.

The maximum observable claim is queue accepted: exit 0, recognized queue ID and exact target UUID echo. Versions are pinned to the two probed CLI versions. Unexpected output, UUID mismatch, timeout, rejection or process uncertainty stops automatic retries. No Desktop turn observer, app-server, session/writer contract or protocol v1 change is introduced.

The separate local SQLite journal reserves ownership before spawning, persists the role's 30-minute cooldown and each message's five-iteration cap, and prevents concurrent owners/restarts/binding changes from resetting that budget. Orphan reservations are never stolen. After five iterations without a real ack, it logs undelivered after 5 nudges and stops that head. Nudges never change message delivery state. Pause/quarantine/submitted heads block nudging; actual recipient ack remains authoritative. Codex placement and absence of a push conversation/active-delivery registration exclude overlap with #45.

Configuration, diagnostics, recovery and the live acceptance matrix are documented in docs/adapters/codex-queue.md and docs/runbooks/codex-queue-nudger.md. Configuration and the journal stay local to the existing project/Synloq home; no new dependency or main message schema migration is needed.

Validation: full pnpm verify on the final commit: 104 test files / 901 tests, formatting, import check, typecheck and build pass. Includes 54 new tests for strict CLI fixtures, real bounded child processes, concurrent owners, crash reservations, restarts, ack/cooldown/cap boundaries, shutdown, config/schema guards and host exclusion. The first sandboxed full run could not connect to loopback (EACCES); the complete run with local socket access passed.

Limitations: CLI acceptance is not delivery, independently verified queue persistence, or turn start. Unloaded chats may stay inactive. Integrated watcher live activation has not been performed; the earlier manual CLI probe matrix is cited separately and the runbook preserves this acceptance step. Manual sender-side reminders must be disabled for an enabled test role during that window, since external queue commands cannot share the journal's dedup. Local metadata is deliberately retained; uncertain/orphaned attempts require operator reconciliation, not a reset of the attempt budget.

Commits: (a) 21e5a64 wrapper/fixtures; (b) 4c96728 durable coordinator and relay lifecycle; (c) 3dcf044 conformance and runbook. Review: dev → CTO. Refs #83 (live acceptance remains explicit).

@OBenner

OBenner commented Nov 16, 2026

Copy link
Copy Markdown
Owner Author

Review (dev) — ACCEPT

Checked against the approved plan (dev-staff1-83-gate-lifted) and CTO decision (4e1d48d0):

  1. Scope exactness: queueCodexNudge asserts at most "queue accepted" — exit 0 + UUID-validated queueId + full-stdout equality + thread echo must equal the bound target (mismatch → QUEUE_OUTPUT_MISMATCH, uncertain, no retry). No --resume, no daemon, no turn observation anywhere. ✓
  2. CLI surface discipline: pinned versions 0.169.0 / 0.169.0-alpha.11.1 re-verified on every iteration (upgrade-safe), shell: false, 8 KB output cap, stderr drained but never exposed, abort propagates to SIGKILL with pipe teardown. ✓
  3. Durable ledger (nudge-ledger.ts): separate metadata DB (no message bodies), reserve() transactional reserve-before-spawn, single owner per role, 30 min cooldown, cap 5 per message that survives restarts and binding changes, terminal log claimed once. Uncertain/crashed ownership cannot be evaded by head/binding change — only ack or terminal accepted/cancelled releases it. ✓
  4. Dedup by synloq delivery state: isAcked gates re-reserve; acked messages are never re-nudged. Delivery remains proven only by real MCP read/ack, exactly as decided. ✓
  5. Fail-closed: unknown version/schema/config → nudger disabled (never the inbox); storage/eligibility failure stops the loop with a loud diagnostic instead of repeated CLI effects. ✓
  6. No contract drift: zero diff in src/transport/, relay-service.ts, src/mcp/, src/domain/ — session/wire/v1 untouched. Arch wire-review not triggered by the plan's own gate. ✓
  7. [P2] Stored-ping watcher: push a lightweight ping into a role's live chat when incoming mail sits unread #45 exclusion: eligibility requires codex-desktop placement + no push conversation + no activeDelivery session, re-checked in beforeQueue immediately before spawn. ✓
  8. Hygiene: nudge text is content-free (messageId + threadId + instruction); no task bodies, tokens or raw CLI output in args/logs/journal. ✓

Verified independently: pnpm install --frozen-lockfile, targeted 54/54 new tests, full pnpm verify — 104 files / 901 tests PASS in a detached review worktree. CI 3/3 on 3dcf044.

Non-blocking notes:

Passing to CTO for final.

@OBenner
OBenner merged commit 9b1328e into main Nov 16, 2026
3 checks passed
@OBenner
OBenner deleted the feat/83-codex-queue-nudger branch November 16, 2026 13:48
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.

1 participant