openai / openai/codex-plugin-cc
`result <id>` on a queued/running job reports "No job found" — the still-running message is unreachable when a reference is given
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 33.3k
- Forks
- 2.3k
- PR merge metrics
- No merged PRs in 30d
Description
On 1.0.6 (macOS), asking for the result of a job that is still running reports the job as nonexistent:
$ node codex-companion.mjs result task-mrkxdpsi-mij20h --cwd /Users/me/repo
No job found for "task-mrkxdpsi-mij20h". Run /codex:status to list known jobs.
$ echo $?
1
$ node codex-companion.mjs status task-mrkxdpsi-mij20h --cwd /Users/me/repo
- task-mrkxdpsi-mij20h | running | rescue | Codex Task
There is code in resolveResultJob that intends to say Job X is still running. Check /codex:status and try again once it finishes. — but it is unreachable when a job id is passed.
scripts/lib/job-control.mjs (line numbers at current main):
resolveResultJob(line 256) first callsmatchJobReference(jobs, reference, terminalPredicate)with the predicate filtering tocompleted/failed/cancelled.matchJobReference(line 191) applies the predicate, then matches the reference against the filtered list, and throwsNo job found for "<ref>"(line 210) when nothing matches.- So for a queued/running job looked up by id, the throw fires inside the first call and the
activecheck at line 269 never runs. The "still running" message is reachable only in the no-reference path, wherematchJobReferencereturnsfiltered[0] ?? nullinstead of throwing.
This is worse than a cosmetic wrong message because No job found is the same string the cwd-mismatch case produces. A caller polling result <id> cannot distinguish "wrong workspace" from "not finished yet" from "no such job", and the natural reading — the job does not exist — is the one that is false. We traced a real incident to an orchestrator concluding from this exact string that a dispatched job had never run, and redoing the work while the job was still going.
Possible fixes, either works:
- Make
matchJobReferencereturnnullwhen a reference matches nothing, and let each caller produce its own error message (resolveResultJobalready has the branching to do this correctly). - Or in
resolveResultJob, match the reference against the unfiltered job list first, then check the status of the match — producing "still running" for active jobs, "No finished job" only when the id genuinely is not in the workspace.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read scripts/lib/job-control.mjs, starting with matchJobReference and resolveResultJob, then reproduce result for the running job described in the issue. The fix is done when a queued or running reference reports that it is still running, while unknown and wrong-workspace references retain distinct not-found behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100