mirror of
https://github.com/openai/codex.git
synced 2026-04-24 06:35:50 +00:00
Enable request_user_input in default mode
This commit is contained in:
@@ -412,7 +412,7 @@ async fn turn_start_accepts_collaboration_mode_override_v2() -> Result<()> {
|
||||
let payload = request.body_json();
|
||||
assert_eq!(payload["model"].as_str(), Some("mock-model-collab"));
|
||||
let payload_text = payload.to_string();
|
||||
assert!(payload_text.contains("The `request_user_input` tool is unavailable in Default mode."));
|
||||
assert!(payload_text.contains("The `request_user_input` tool is available in Default mode."));
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -117,9 +117,9 @@ mod tests {
|
||||
use pretty_assertions::assert_eq;
|
||||
|
||||
#[test]
|
||||
fn request_user_input_mode_availability_is_plan_only() {
|
||||
fn request_user_input_mode_availability_includes_default_mode() {
|
||||
assert!(ModeKind::Plan.allows_request_user_input());
|
||||
assert!(!ModeKind::Default.allows_request_user_input());
|
||||
assert!(ModeKind::Default.allows_request_user_input());
|
||||
assert!(!ModeKind::Execute.allows_request_user_input());
|
||||
assert!(!ModeKind::PairProgramming.allows_request_user_input());
|
||||
}
|
||||
@@ -129,7 +129,7 @@ mod tests {
|
||||
assert_eq!(request_user_input_unavailable_message(ModeKind::Plan), None);
|
||||
assert_eq!(
|
||||
request_user_input_unavailable_message(ModeKind::Default),
|
||||
Some("request_user_input is unavailable in Default mode".to_string())
|
||||
None
|
||||
);
|
||||
assert_eq!(
|
||||
request_user_input_unavailable_message(ModeKind::Execute),
|
||||
@@ -142,10 +142,10 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn request_user_input_tool_description_mentions_plan_only() {
|
||||
fn request_user_input_tool_description_mentions_default_and_plan() {
|
||||
assert_eq!(
|
||||
request_user_input_tool_description(),
|
||||
"Request user input for one to three short questions and wait for the response. This tool is only available in Plan mode.".to_string()
|
||||
"Request user input for one to three short questions and wait for the response. This tool is only available in Default or Plan mode.".to_string()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,4 +8,4 @@ Your active mode changes only when new developer instructions with a different `
|
||||
|
||||
{{REQUEST_USER_INPUT_AVAILABILITY}}
|
||||
|
||||
If a decision is necessary and cannot be discovered from local context, ask the user directly. However, in Default mode you should strongly prefer executing the user's request rather than stopping to ask questions.
|
||||
In Default mode, strongly prefer making reasonable assumptions and executing the user's request rather than stopping to ask questions. If you absolutely must ask a question because the answer cannot be discovered from local context and a reasonable assumption would be risky, prefer using the `request_user_input` tool rather than writing a multiple choice question as a textual assistant message. Never write a multiple choice question as a textual assistant message.
|
||||
|
||||
@@ -290,16 +290,8 @@ async fn request_user_input_rejected_in_execute_mode_alias() -> anyhow::Result<(
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||
async fn request_user_input_rejected_in_default_mode() -> anyhow::Result<()> {
|
||||
assert_request_user_input_rejected("Default", |model| CollaborationMode {
|
||||
mode: ModeKind::Default,
|
||||
settings: Settings {
|
||||
model,
|
||||
reasoning_effort: None,
|
||||
developer_instructions: None,
|
||||
},
|
||||
})
|
||||
.await
|
||||
async fn request_user_input_round_trip_in_default_mode() -> anyhow::Result<()> {
|
||||
request_user_input_round_trip_for_mode(ModeKind::Default).await
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||
|
||||
@@ -210,7 +210,7 @@ impl ModeKind {
|
||||
}
|
||||
|
||||
pub const fn allows_request_user_input(self) -> bool {
|
||||
matches!(self, Self::Plan)
|
||||
matches!(self, Self::Plan | Self::Default)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user