Summary
/opencode:status is scoped to the current Claude session, but implicit /opencode:result and /opencode:cancel are not. In a multi-session workspace, one Claude session can hide another session's running jobs in status but still cancel or display them through the implicit default selection path.
Local evidence
handleStatus() passes { sessionId } to buildStatusSnapshot(...).
handleResult() calls resolveResultJob(state.jobs ?? [], ref) without session filtering.
handleCancel() calls resolveCancelableJob(state.jobs ?? [], ref) without session filtering.
The underlying helpers in plugins/opencode/scripts/lib/job-control.mjs also do not accept a session-id option.
Expected behavior
- With no explicit job id,
result and cancel should use the same current-session visibility rules as status.
- If the current session has no matching job, implicit
result/cancel should say so rather than selecting another session's job.
- Explicit
result <job-id> and cancel <job-id> can remain cross-session precision operations.
Suggested fix
Filter jobs by getClaudeSessionId() in handleResult() and handleCancel() only when ref is omitted. Keep exact/prefix explicit references searching all jobs.
Add tests for:
status hides another session's jobs.
- implicit
cancel does not cancel another session's running job.
- implicit
result does not show another session's latest finished job.
- explicit job-id lookup still works across sessions.
Upstream references
Derived from openai/codex-plugin-cc#82 and related session-scoping behavior from #81.
Summary
/opencode:statusis scoped to the current Claude session, but implicit/opencode:resultand/opencode:cancelare not. In a multi-session workspace, one Claude session can hide another session's running jobs in status but still cancel or display them through the implicit default selection path.Local evidence
handleStatus()passes{ sessionId }tobuildStatusSnapshot(...).handleResult()callsresolveResultJob(state.jobs ?? [], ref)without session filtering.handleCancel()callsresolveCancelableJob(state.jobs ?? [], ref)without session filtering.The underlying helpers in
plugins/opencode/scripts/lib/job-control.mjsalso do not accept a session-id option.Expected behavior
resultandcancelshould use the same current-session visibility rules asstatus.result/cancelshould say so rather than selecting another session's job.result <job-id>andcancel <job-id>can remain cross-session precision operations.Suggested fix
Filter jobs by
getClaudeSessionId()inhandleResult()andhandleCancel()only whenrefis omitted. Keep exact/prefix explicit references searching all jobs.Add tests for:
statushides another session's jobs.canceldoes not cancel another session's running job.resultdoes not show another session's latest finished job.Upstream references
Derived from openai/codex-plugin-cc#82 and related session-scoping behavior from #81.