Skip to content

goals: keep pause transitions explicit#23088

Merged
etraut-openai merged 4 commits into
mainfrom
etraut/goal-unload-guard
May 18, 2026
Merged

goals: keep pause transitions explicit#23088
etraut-openai merged 4 commits into
mainfrom
etraut/goal-unload-guard

Conversation

@etraut-openai
Copy link
Copy Markdown
Collaborator

@etraut-openai etraut-openai commented May 16, 2026

Problem

This addresses several user-reported cases where active goals were paused even though the user had not explicitly asked for that transition:

  • the guardian approval-review circuit breaker interrupted a turn and implicitly paused the goal
  • a shutdown in one app-server instance could pause a goal while a second instance was still actively running the same thread
  • steering-style interrupts could also pause the goal even though they are meant to redirect work, not stop the goal lifecycle

The common problem was that core treated TurnAbortReason::Interrupted as an implicit request to transition the persisted goal to paused. That made unrelated interrupt paths mutate goal state as a side effect, and in the multi-app-server case it allowed stale process teardown to pause a live goal owned by another running client.

After this change, transitioning a goal to paused is always an explicit action performed by a client or another intentional goal-state mutation. It is never an implicit transition triggered by generic interrupt handling.

Refs #22884.

What changed

  • Remove the goal runtime path that paused active goals after interrupted task aborts.
  • Drop the now-unused abort reason from GoalRuntimeEvent::TaskAborted.
  • Update the focused regression coverage so an interrupted active goal still accounts usage but remains active.

@etraut-openai etraut-openai changed the title goals: make pause transitions explicit goals: keep pause transitions explicit May 16, 2026
@etraut-openai etraut-openai marked this pull request as ready for review May 16, 2026 23:03
@etraut-openai etraut-openai requested a review from a team as a code owner May 16, 2026 23:03
@jif-oai
Copy link
Copy Markdown
Collaborator

jif-oai commented May 18, 2026

@codex review

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: 9c6d28812b

ℹ️ 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/core/src/goals.rs

#[tokio::test]
async fn interrupt_accounts_active_goal_before_pausing() -> anyhow::Result<()> {
async fn interrupt_accounts_active_goal_without_pausing() -> anyhow::Result<()> {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we add a regression for the no-active-turn/unload path to?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yep. Done.

@etraut-openai etraut-openai merged commit 55f6bbc into main May 18, 2026
31 checks passed
@etraut-openai etraut-openai deleted the etraut/goal-unload-guard branch May 18, 2026 18:58
@github-actions github-actions Bot locked and limited conversation to collaborators May 18, 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.

2 participants