opencode-mission-control icon indicating copy to clipboard operation
opencode-mission-control copied to clipboard

feat: Two-way job messaging (inbox/outbox)

Open nigel-dev opened this issue 9 months ago • 1 comments

Source

Audit report — Section 9: Phase 3 Roadmap

Prerequisites

  • #74 — Notifications route to active session instead of launching session. Without session-aware routing, messages will be delivered to the wrong session when users multitask.

Description

Currently, communication between the main session and spawned jobs is one-directional: the main session can mc_capture output, and jobs can mc_report status. There is no structured messaging channel for the main session to send instructions to a running job or for jobs to request information.

Proposed Solution

Implement a simple inbox/outbox messaging system:

  1. Outbox (job → main): Jobs can post structured messages (not just status) — e.g., "Need clarification on X", "Found issue Y, should I fix?"
  2. Inbox (main → job): Main session can send messages to running jobs — e.g., "Also handle edge case Z", "Prioritize the auth fix"
  3. Message format: JSON with type, content, timestamp, read/unread status
  4. Storage: Per-job message files in the job's state directory
  5. Surfacing: Messages appear in mc_status, mc_overview, and notifications

Use Cases

  • Redirecting a running job without killing and relaunching
  • Job asking for clarification before proceeding
  • Main session providing additional context discovered after launch
  • Cross-job coordination in complex plans

Priority

P3 — nice to have. Current workaround is to kill and relaunch with updated prompt.

nigel-dev avatar Feb 13 '26 18:02 nigel-dev

Superseded by #65 (serve-based orchestration). The SDK + SSE approach in #65 Phase 4 provides native bidirectional communication — real-time event streams (job → main) and programmatic session control via client.session.prompt() (main → job) — making a file-based inbox/outbox unnecessary.

nigel-dev avatar Feb 14 '26 17:02 nigel-dev