Skip to content

Codex Desktop: add opt-in visible inbox monitor with watchdog#375

Open
ryofukutani wants to merge 4 commits into
fujibee:mainfrom
ryofukutani:fix/374-codex-monitor-watchdog
Open

Codex Desktop: add opt-in visible inbox monitor with watchdog#375
ryofukutani wants to merge 4 commits into
fujibee:mainfrom
ryofukutani:fix/374-codex-monitor-watchdog

Conversation

@ryofukutani

Copy link
Copy Markdown

Summary

  • preserve the existing visible Codex.app bridge as the low-latency delivery path
  • add a session-scoped monitor lease for an opt-in thread heartbeat and independent project watchdog
  • reserve unread high-water marks without reading bodies, suppress duplicate wakes, and keep inbox.sh ownership in the target visible thread
  • deactivate leases on mode changes and SessionEnd so stale scheduled jobs cannot keep waking a stopped session
  • document the Codex Desktop automation contract and teardown behavior

This PR includes the visible Codex delivery groundwork from #263 and completes the scheduler/watchdog layer requested in #374.

Verification

  • bats -t tests/test_codex_monitor_lease.bats tests/test_codex_visible_monitor.bats — 15/15 passed
  • related Codex bridge/delivery/actas selection — 182/182 passed
  • full suite — 646/647 passed; the only failure is the pre-existing environment-sensitive whoami: defaults to claude-code when no env vars set, because the test process runs below Codex.app and process-tree auto-detection correctly finds codex
  • bash -n passed for changed shell entry points
  • shellcheck -S warning passed
  • git diff --check passed
  • pre-commit gitleaks passed

Closes #374
Related: #263

Ryo FUKUTANI and others added 4 commits July 12, 2026 04:26
Codex has no Monitor tool, and the PATH-shim/app-server bridge only
covers CLI-launched sessions. This adds a Desktop-friendly path:

- actas-monitor.sh: rebind monitor delivery to an explicit actas
  identity; app-server sessions keep the bridge, ordinary Codex.app
  threads fall back to codex-app-monitor.sh
- codex-app-monitor.sh: watch inbox rows for one identity and wake the
  originating Codex.app thread via 'codex exec resume <thread_id>'
- restore-actas-monitor.sh: global Codex SessionStart hook that
  restores the last actas monitor for the project
- codex-bridge.js: honor the inbox ids-file so inline-delivered
  messages are acknowledged read-integrity-safely; add --owner/--claim
  passthrough; require visible UI acknowledgement in the wake prompt
- watch-once.sh: --owner/--claim options for exclusivity claims
- dispatch.sh: run the type's actas-monitor hook on 'agmsg actas'
- template.md: document the Codex.app wake flow for delivery mode 3

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

Codex Desktop: opt-in inbox monitor with thread wake and watchdog

1 participant