-
Notifications
You must be signed in to change notification settings - Fork 438
cancel without a job id can cancel another Claude session's hidden running task #82
Copy link
Copy link
Open
manavagarwal123/codex-plugin-cc
#3Description
Summary
/codex:status without a job id is scoped to the current Claude session, but /codex:cancel without a job id is not. In a multi-session workspace, the current session can see running: [] and still cancel a different session's active background task.
Reproduction
- Create plugin state for a repository with one active task owned by Claude session
sess-other. - In a separate Claude session
sess-current, run:node scripts/codex-companion.mjs status --jsonnode scripts/codex-companion.mjs cancel --json
- Observe that
statusreports no running jobs forsess-current, butcancelsucceeds and marks thesess-otherjob ascancelled.
Expected
- Default cancellation with no explicit job id should be session-aware, just like
/codex:status. - If the current session has no active jobs,
cancelshould fail with a current-session-specific message instead of mutating another session's task. - Explicit
cancel <job-id>can still remain a precise cross-session override.
Actual
status --jsonshowsrunning: []for the current session.cancel --jsonstill cancels the other session's running task and rewrites persisted state tocancelled.
Suspected Cause
resolveCancelableJob(...) filters active jobs by status only. It ignores CODEX_COMPANION_SESSION_ID unless the caller passes an explicit job id.
Suggested Fix
Apply current-session filtering only for the implicit "cancel the default active task" path, while preserving the existing explicit job-id behavior for precise cancellation.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels