Reduce the surface of collaboration modes (#20149)

Collaboration modes were slightly invasive both into ThreadManager
construction and ModelProvider
This commit is contained in:
pakrym-oai
2026-04-29 17:22:41 -07:00
committed by GitHub
parent c8abcbf925
commit fedcefe9da
41 changed files with 121 additions and 346 deletions

View File

@@ -1,8 +1,7 @@
//! Validates that the collaboration mode list endpoint returns the expected default presets.
//!
//! The test drives the app server through the MCP harness and asserts that the list response
//! includes the plan and default modes with their default model and reasoning effort
//! settings, which keeps the API contract visible in one place.
//! includes the plan and default modes, which keeps the API contract visible in one place.
#![allow(clippy::unwrap_used)]

View File

@@ -969,7 +969,7 @@ async fn turn_start_accepts_collaboration_mode_override_v2() -> Result<()> {
codex_home.path(),
&server.uri(),
"never",
&BTreeMap::from([(Feature::DefaultModeRequestUserInput, true)]),
&BTreeMap::default(),
)?;
let mut mcp = McpProcess::new(codex_home.path()).await?;
@@ -1029,13 +1029,15 @@ 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 available in Default mode."));
assert!(payload_text.contains(
"Use the `request_user_input` tool only when it is listed in the available tools"
));
Ok(())
}
#[tokio::test]
async fn turn_start_uses_thread_feature_overrides_for_collaboration_mode_instructions_v2()
async fn turn_start_uses_thread_feature_overrides_for_request_user_input_tool_description_v2()
-> Result<()> {
skip_if_no_network!(Ok(()));
@@ -1114,7 +1116,7 @@ async fn turn_start_uses_thread_feature_overrides_for_collaboration_mode_instruc
let request = response_mock.single_request();
let payload_text = request.body_json().to_string();
assert!(payload_text.contains("The `request_user_input` tool is available in Default mode."));
assert!(payload_text.contains("This tool is only available in Default or Plan mode."));
Ok(())
}