Skip to content

add codex goal command support#2877

Open
tarik02 wants to merge 2 commits into
pingdotgg:mainfrom
tarik02:feat/codex-goals
Open

add codex goal command support#2877
tarik02 wants to merge 2 commits into
pingdotgg:mainfrom
tarik02:feat/codex-goals

Conversation

@tarik02
Copy link
Copy Markdown
Contributor

@tarik02 tarik02 commented May 30, 2026

What Changed

Added support for /goal codex command.

Why

It's cool feature but only available in Codex desktop app and CLI.

UI Changes

2026-05-30.20.33.32.mov

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Medium Risk
Touches orchestration events, DB projection, and provider session RPCs across server and web; scope is large but largely additive with Codex-only goal requests.

Overview
Adds Codex thread goals end-to-end: users can drive goals from the web UI via /goal (set objective, status, pause, resume, clear) and from the plan sidebar, with goal state shown on thread rows and in the chat timeline.

Contracts & persistence: Introduces OrchestrationThreadGoal and thread.goal.request / goal update-clear events; threads and shells now carry optional goal. Migration 031 adds goal_json on projection_threads, with projection, snapshot queries, and client reducers updated to read/write it.

Server: The decider emits thread.goal-requested; ProviderCommandReactor forwards to Codex sendGoalRequest; Codex maps thread/goal/* notifications to runtime events; ProviderRuntimeIngestion turns those into orchestration goal commands and goal-related activities.

Web: Composer and ChatView dispatch goal commands; ThreadGoalPanel, sidebar labeling (“Goal”), and status indicators; timeline rows for goal lifecycle. Test fixtures across apps gain goal: null where needed.

Reviewed by Cursor Bugbot for commit a00b82b. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add /goal command support for Codex threads

  • Adds a /goal slash command to the chat composer for the Codex provider, supporting set, status, pause, resume, and clear subcommands
  • Introduces OrchestrationThreadGoal schema in contracts and propagates the goal field through threads, thread shells, sidebar summaries, and all projection/snapshot layers
  • New goal events (thread.goal-updated, thread.goal-cleared, thread.goal-requested) flow from provider runtime through the orchestration engine to the client state
  • PlanSidebar gains a ThreadGoalPanel showing goal objective, status badge, duration, token usage, and pause/resume/clear controls; thread rows show a color-coded goal icon
  • Goal events appear as first-class entries in the messages timeline via GoalTimelineRow
  • Adds DB migration 031_ProjectionThreadGoals.ts to add goal_json column to projection_threads
  • Risk: migration is additive and guarded by IF NOT EXISTS, but all thread-related test fixtures required a goal: null field addition to match the new required shape

Macroscope summarized a00b82b.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 30, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 0ce905fe-d3bf-41d3-ba91-dd1b8bedfb9a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XXL 1,000+ changed lines (additions + deletions). labels May 30, 2026
@tarik02
Copy link
Copy Markdown
Contributor Author

tarik02 commented May 30, 2026

Implements #2819

});
if (goalSlashCommand.kind === "status") {
showGoalStatusToast(activeThread.goal);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Status toast shows stale goal before provider responds

Medium Severity

When the user types /goal (status request), showGoalStatusToast(activeThread.goal) is called immediately after dispatching the command, displaying the locally cached goal state. The actual purpose of the "status" request is to fetch the fresh goal from the provider via thread/goal/get, but that response arrives asynchronously through the event stream — well after the toast is already shown and dismissed. If the goal was set or modified externally (e.g., via CLI), the toast will display stale or incorrect data, including "No active goal" even when one exists on the provider.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 54bc62d. Configure here.

Comment thread apps/web/src/components/ThreadStatusIndicators.tsx Outdated
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented May 30, 2026

Approvability

Verdict: Needs human review

This PR introduces a complete new feature (Codex goal commands) with new schema types, orchestration commands/events, database migration, provider integration, and UI components. New feature PRs of this scope warrant human review. Additionally, there is an unresolved medium-severity bug regarding stale toast display on goal status requests.

You can customize Macroscope's approvability policy. Learn more.

@tarik02 tarik02 force-pushed the feat/codex-goals branch from 54bc62d to ea90c59 Compare May 30, 2026 18:28
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ea90c59. Configure here.

Comment thread apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant