Skip to content

feat: account active goal progress in the goal extension#23696

Merged
jif-oai merged 2 commits into
mainfrom
jif/push-goal-further
May 20, 2026
Merged

feat: account active goal progress in the goal extension#23696
jif-oai merged 2 commits into
mainfrom
jif/push-goal-further

Conversation

@jif-oai
Copy link
Copy Markdown
Collaborator

@jif-oai jif-oai commented May 20, 2026

Why

The goal extension can create and surface goals, but the live turn-accounting path still stopped short of persisting active-goal progress. That leaves token and wall-clock usage, plus ThreadGoalUpdated events, out of sync with the extension boundary once work actually advances or a goal transitions out of active state.

What changed

  • Teach GoalAccountingState to track the current turn, active goal, token deltas, and wall-clock progress snapshots against the persisted goal id.
  • Flush active-goal accounting from tool-finish, turn-stop, and turn-abort lifecycle hooks, and emit ThreadGoalUpdated events when persisted progress changes.
  • Route create_goal and update_goal through the same accounting state so new goals start from the right baseline, final progress is flushed before status changes, and update_goal can mark a goal blocked as well as complete.
  • Keep budget-limited goals accruing through the end of the turn while clearing local active-goal state once a turn or explicit update is finished.
  • Expand backend and lifecycle coverage around store ids, baseline reset, tool-finish accounting, budget-limited carry-through, and blocked-goal updates.

Testing

  • Added focused backend coverage in codex-rs/ext/goal/tests/goal_extension_backend.rs for baseline reset, tool-finish accounting, budget-limited turns, and blocked-goal updates.
  • Extended codex-rs/core/src/session/tests.rs to assert that lifecycle inputs expose the expected session, thread, and turn store ids.

@jif-oai jif-oai requested a review from a team as a code owner May 20, 2026 14:04
@jif-oai
Copy link
Copy Markdown
Collaborator Author

jif-oai commented May 20, 2026

@codex review

@jif-oai jif-oai changed the title feat: push goal ext further feat: account active goal progress in the goal extension May 20, 2026
Copy link
Copy Markdown
Contributor

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

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: 29c43317d5

ℹ️ 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 codex-rs/ext/goal/src/accounting.rs
Comment thread codex-rs/ext/goal/src/extension.rs
Comment thread codex-rs/ext/goal/src/extension.rs
Comment thread codex-rs/ext/goal/src/extension.rs
Comment thread codex-rs/ext/goal/src/extension.rs
@jif-oai jif-oai merged commit d4f842f into main May 20, 2026
31 checks passed
@jif-oai jif-oai deleted the jif/push-goal-further branch May 20, 2026 16:36
@github-actions github-actions Bot locked and limited conversation to collaborators May 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant