Repository navigation
/goal end to end: stored goal, native Codex goal, header chip (#1531) - #1539
Conversation
/goal <objective> sets a standing thread goal through threads.setGoal; bare /goal or /goal clear clears it. Codex syncs it to the app-server native thread goal (thread/goal/get|set|clear), follows its continuation turns while the goal stays active, and parks it paused between runs so an idle active goal cannot start a turn that races turn/start. Status from thread/goal/updated lands on the thread. Other providers get the goal appended to each dispatched prompt. The header shows a truncated chip with status and a clear button. Co-Authored-By: Claude Opus 5.5 <[email protected]>
#1531) Co-Authored-By: Claude Opus 5.5 <[email protected]>
) A turn that completes before codex echoes the activation must still follow continuation turns and pause the goal on shutdown. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c525075b92
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const updated = await api.threads.setGoal({ | ||
| threadId, | ||
| goal: goalCmd.goal, | ||
| }); |
There was a problem hiding this comment.
Push mid-run goal changes into the live Codex session
When /goal <new objective> or /goal clear is submitted while a Codex thread is working, this call only updates the stored thread: the running adapter received a snapshot of thread.goal at launch and its live handle exposes no goal mutation. Consequently, the old native goal remains active and can keep launching autonomous continuation turns—and consuming tokens—even though the chip shows the new goal or disappears. Codex applies goal runtime effects immediately in its goal request processor, so route these mutations to the active app-server session or stop/resync that run rather than waiting for a next turn that may never arrive.
Useful? React with 👍 / 👎.
| if (!cur || cur.objective !== goal.objective) { | ||
| await client.send("thread/goal/set", { | ||
| threadId, | ||
| objective: goal.objective, | ||
| status: "paused", | ||
| }); |
There was a problem hiding this comment.
Pause pre-existing active goals before starting a turn
If a resumed native goal already has the same objective and status active, this condition sends no pause before turn/start. This occurs after an app quit or crash because shutdown deliberately skips the pause while isShuttingDown(); Codex documents in the goal processor that an active goal can immediately start an idle turn. Thus thread/resume can launch an autonomous continuation while this code races it with turn/start, causing a conflicting turn or failed run and leaving the goal active for repeated retries. Pause a matching active goal as well before issuing the explicit turn.
Useful? React with 👍 / 👎.
Part of #1531.
/goal <text>sets a goal stored on the thread (newthreads.setGoalIPC), and a bare/goalor/goal clearremoves it. The command is handled by Solenta and never sent to the model.thread/goal/{get,set,clear}methods and followsthread/goal/updated. I checked that these methods are incodex app-server generate-json-schemafor codex-cli 0.159.2.[Goal]note until it is marked complete.Tests are in
electron/test/goal.test.js,electron/test/codex-appserver.test.js,test/slashCommands.test.ts,test/threadView.test.tsxandtest/queuedFollowup.test.tsx.🤖 Generated with Claude Code