Skip to content

fix(monitor): use exact session ID for control agent continuation (OpenCode and Claude) #338

@proboscis

Description

@proboscis

Problem

When orch-monitor tries to reuse a previous control agent session, it uses generic continuation flags instead of explicit session IDs:

  • OpenCode: Uses --continue instead of --session <session_id>
  • Claude: May use --continue instead of --session-id <session_id>

This causes another running session to be attached as the control agent in orch-monitor, instead of the intended session.

Expected Behavior

orch-monitor should always use explicit session ID flags to resume the exact control agent session:

  • OpenCode: opencode --session <session_id>
  • Claude: claude --session-id <session_id>

Current Behavior

Uses --continue which attaches to whatever session the agent considers "most recent", which may be a different running session.

Fix

Ensure all control agent continuation commands use explicit session IDs:

# OpenCode - change from:
opencode --continue ...
# to:
opencode --session <session_id> ...

# Claude - change from:
claude --continue ...
# to:
claude --session-id <session_id> ...

This ensures the correct control agent session is resumed regardless of other running sessions.

Files to Check

  • orch-monitor-tui/orch_monitor/__main__.py - control agent launch logic
  • Any other files that launch or continue agent sessions for the monitor

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions