Remove Plan-mode gate from idle turn injection (#25577)

## Why

`try_start_turn_if_idle` is the core helper for starting injected input
only when the session is actually idle. It should stay focused on
generic turn-lifecycle safety. The previous `ModeKind::Plan` guard mixed
caller policy into that helper: Plan mode may choose not to auto-start
some extension work, but that decision belongs at the extension or
caller boundary rather than in the session injection primitive.

## What changed

- Removed the `ModeKind::Plan` early return from
`Session::try_start_turn_if_idle`.
- Removed the now-unused `ModeKind` import from
`core/src/session/inject.rs`.

## Testing

Not run locally.
This commit is contained in:
jif-oai
2026-06-01 11:06:38 +02:00
committed by GitHub
parent c875bc8a33
commit 48c16b8bcb

View File

@@ -4,7 +4,6 @@ use super::turn_context::TurnContext;
use crate::state::ActiveTurn;
use crate::state::TurnState;
use crate::tasks::RegularTask;
use codex_protocol::config_types::ModeKind;
use codex_protocol::models::ResponseItem;
use std::sync::Arc;
@@ -41,9 +40,6 @@ impl Session {
if input.is_empty() {
return Ok(());
}
if self.collaboration_mode().await.mode == ModeKind::Plan {
return Err(input);
}
if self.input_queue.has_trigger_turn_mailbox_items().await {
return Err(input);
}