mirror of
https://github.com/openai/codex.git
synced 2026-11-10 21:00:47 +00:00
Treat user shell turns as non-steerable
This commit is contained in:
@@ -216,6 +216,7 @@ impl SteerInputError {
|
||||
let turn_kind_label = match turn_kind {
|
||||
NonSteerableTurnKind::Review => "review",
|
||||
NonSteerableTurnKind::Compact => "compact",
|
||||
NonSteerableTurnKind::UserShell => "user shell",
|
||||
};
|
||||
ErrorEvent {
|
||||
message: format!("cannot steer a {turn_kind_label} turn"),
|
||||
@@ -2787,6 +2788,11 @@ impl Session {
|
||||
turn_kind: NonSteerableTurnKind::Compact,
|
||||
});
|
||||
}
|
||||
Some(crate::state::TaskKind::UserShell) => {
|
||||
return Err(SteerInputError::ActiveTurnNotSteerable {
|
||||
turn_kind: NonSteerableTurnKind::UserShell,
|
||||
});
|
||||
}
|
||||
None => return Err(SteerInputError::NoActiveTurn(input)),
|
||||
}
|
||||
|
||||
|
||||
@@ -5391,6 +5391,7 @@ async fn steer_input_rejects_non_regular_turns() {
|
||||
for (task_kind, turn_kind) in [
|
||||
(TaskKind::Review, NonSteerableTurnKind::Review),
|
||||
(TaskKind::Compact, NonSteerableTurnKind::Compact),
|
||||
(TaskKind::UserShell, NonSteerableTurnKind::UserShell),
|
||||
] {
|
||||
let (sess, _tc, _rx) = make_session_and_context_with_rx().await;
|
||||
let input = vec![UserInput::Text {
|
||||
|
||||
@@ -64,6 +64,7 @@ pub(crate) enum TaskKind {
|
||||
Regular,
|
||||
Review,
|
||||
Compact,
|
||||
UserShell,
|
||||
}
|
||||
|
||||
pub(crate) struct RunningTask {
|
||||
|
||||
@@ -63,7 +63,7 @@ impl UserShellCommandTask {
|
||||
|
||||
impl SessionTask for UserShellCommandTask {
|
||||
fn kind(&self) -> TaskKind {
|
||||
TaskKind::Regular
|
||||
TaskKind::UserShell
|
||||
}
|
||||
|
||||
fn span_name(&self) -> &'static str {
|
||||
|
||||
Reference in New Issue
Block a user