Skip to content

/goal end to end: stored goal, native Codex goal, header chip (#1531) - #1539

Merged
currentbits merged 3 commits into
mainfrom
coder/1531-goal-end-to-end-b7e751
Oct 9, 2026
Merged

currentbits merged 3 commits into
mainfrom
coder/1531-goal-end-to-end-b7e751

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Part of #1531.

  • /goal <text> sets a goal stored on the thread (new threads.setGoal IPC), and a bare /goal or /goal clear removes it. The command is handled by Solenta and never sent to the model.
  • Codex: uses the app-server's own thread/goal/{get,set,clear} methods and follows thread/goal/updated. I checked that these methods are in codex app-server generate-json-schema for codex-cli 0.159.2.
    • With an active goal, Codex keeps taking turns on its own until the goal is done. The run follows those turns.
    • Between runs the goal is paused, so an idle thread doesn't start a turn by itself.
  • Other providers: the goal is added to each prompt as a [Goal] note until it is marked complete.
  • Header: a goal chip shows the goal and its status (active, paused or complete), with a clear (×) button.

Tests are in electron/test/goal.test.js, electron/test/codex-appserver.test.js, test/slashCommands.test.ts, test/threadView.test.tsx and test/queuedFollowup.test.tsx.

🤖 Generated with Claude Code

Willem and others added 3 commits October 9, 2026 13:33
/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]>
)

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]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T12:08:43.545841Z c525075 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/coder/useCoderRuns.ts
Comment on lines +204 to +207
const updated = await api.threads.setGoal({
threadId,
goal: goalCmd.goal,
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +415 to +420
if (!cur || cur.objective !== goal.objective) {
await client.send("thread/goal/set", {
threadId,
objective: goal.objective,
status: "paused",
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@currentbits
currentbits merged commit 860aebd into main Oct 9, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant