Skip to content

Gate automatic idle turns in Plan mode#26147

Merged
jif-oai merged 3 commits into
mainfrom
jif/patch-goal-plan
Jun 4, 2026
Merged

Gate automatic idle turns in Plan mode#26147
jif-oai merged 3 commits into
mainfrom
jif/patch-goal-plan

Conversation

@jif-oai

@jif-oai jif-oai commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Why

Goal idle continuation is extension-triggered model-visible work, so it should follow one core-owned rule for when automatic work may start. In particular, it should not jump ahead of queued user/client work, start while another task is active, or inject a continuation turn while the thread is in Plan mode.

Keeping this policy in try_start_turn_if_idle avoids passing collaboration_mode or review-specific state through ThreadLifecycleContributor::on_thread_idle. Active /review is covered by the same active-task gate because Review turns are not steerable.

What Changed

  • Teach Session::try_start_turn_if_idle to reject automatic idle turns in Plan mode, both before reserving an idle turn and after building the turn context.
  • Document CodexThread::try_start_turn_if_idle as the extension-facing gate for automatic idle work, including Plan-mode and active Review-task behavior.
  • Add focused coverage for Plan-mode rejection and active Review-task rejection without queuing synthetic input.

Testing

  • just test -p codex-core try_start_turn_if_idle

@jif-oai jif-oai requested a review from a team as a code owner June 3, 2026 11:30
@jif-oai jif-oai changed the title fix: new goal and plan Gate automatic idle turns in Plan mode Jun 3, 2026

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

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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f5da38291b

ℹ️ 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/session/tests.rs
Comment thread codex-rs/core/src/session/inject.rs Outdated
@jif-oai

jif-oai commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

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

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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f5da38291b

ℹ️ 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/session/inject.rs Outdated
Comment thread codex-rs/core/src/session/tests.rs
Comment thread codex-rs/core/src/session/inject.rs Outdated
@jif-oai

jif-oai commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

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

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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fc0492a9a7

ℹ️ 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/runtime.rs Outdated
Comment thread codex-rs/core/src/session/tests.rs
Comment thread codex-rs/core/src/session/inject.rs

@etraut-openai etraut-openai left a comment

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.

Looks good overall. I think the bug that codex found is real. Should be straightforward to fix.

Comment thread codex-rs/ext/goal/src/runtime.rs Outdated
Comment thread codex-rs/core/src/session/inject.rs
@jif-oai

jif-oai commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. 👍

ℹ️ 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".

@jif-oai jif-oai merged commit d297616 into main Jun 4, 2026
31 checks passed
@jif-oai jif-oai deleted the jif/patch-goal-plan branch June 4, 2026 12:44
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 4, 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