Defer built-in Default mode instructions until after Plan mode (#62857)

## Why

Threads that stay in Default mode carry a collaboration-mode prompt even
though they have no Plan mode instructions to supersede.

## What changed

Omit bundled and model-catalog Default mode instructions until a thread
uses Plan mode. Emit Plan mode instructions on entry and Default mode
instructions when switching back. Preserve eligible caller-provided
instructions and carry the active mode through compaction and resume.

## Testing

Cover prompt contents before, during, and after Plan mode in core and
app-server tests, including compaction and resume in the core tests.

GitOrigin-RevId: b734767da15be53c4eccae71994e46eba63a9ecc
This commit is contained in:
Dylan Hurd
2026-11-20 23:12:16 +00:00
committed by copyberry
parent 548dd628df
commit 941e1dcade
61 changed files with 530 additions and 1064 deletions
+25 -5
View File
@@ -27,10 +27,9 @@ async fn prompt_prefix_matches_release() -> Result<()> {
// current catalog so normal model and prompt updates cannot cause skew.
let catalog_dir = TempDir::new()?;
let catalog_path = catalog_dir.path().join("models.json");
std::fs::write(
&catalog_path,
serde_json::to_vec(&codex_models_manager::bundled_models_response()?)?,
)?;
const MODEL: &str = "gpt-6-astra";
let catalog = codex_models_manager::bundled_models_response()?;
std::fs::write(&catalog_path, serde_json::to_vec(&catalog)?)?;
let mut prefixes = Vec::new();
for program in [release.as_deref(), None] {
@@ -46,7 +45,7 @@ async fn prompt_prefix_matches_release() -> Result<()> {
.await;
let home = TempDir::new()?;
MockResponsesConfig::new(&server.uri())
.with_model("gpt-6-astra")
.with_model(MODEL)
.with_root_config(&format!(
"model_catalog_json = {}",
serde_json::to_string(&catalog_path)?
@@ -130,6 +129,27 @@ async fn prompt_prefix_matches_release() -> Result<()> {
let current: Value = serde_json::from_str(&prefixes[1])?;
accept_spawn_agent_shortlist_rollout(&mut released, &current);
accept_default_tool_description_rollouts(&mut released, &current);
// Releases before #19024 append the catalog's Default block after permissions.
// Accept only its removal from this position in the startup developer message.
if let Some(default) = catalog
.models
.iter()
.find(|model| model.slug == MODEL)
.and_then(|model| model.model_messages.as_ref())
.and_then(|messages| messages.collaboration_modes.as_ref())
.and_then(|modes| modes.default.as_deref())
&& released["input"][2]["role"] == "developer"
&& current.pointer("/input/2/content/1").is_none()
&& let Some(content) = released["input"][2]["content"].as_array_mut()
&& content.len() == 2
&& content[1]
== json!({
"type": "input_text",
"text": format!("<collaboration_mode>{default}</collaboration_mode>"),
})
{
content.pop();
}
prefixes[0] = serde_json::to_string_pretty(&released)?;
}
assert_eq!(
@@ -2630,17 +2630,10 @@ async fn turn_start_emits_notifications_and_accepts_model_override() -> Result<(
}
#[tokio::test]
async fn turn_start_accepts_collaboration_mode_override_v2() -> Result<()> {
async fn turn_start_applies_default_mode_instructions_only_after_plan_v2() -> Result<()> {
skip_if_no_network!(Ok(()));
let server = responses::start_mock_server().await;
let body = responses::sse(vec![
responses::ev_response_created("resp-1"),
responses::ev_assistant_message("msg-1", "Done"),
responses::ev_completed("resp-1"),
]);
let response_mock = responses::mount_sse_once(&server, body).await;
let codex_home = TempDir::new()?;
MockResponsesConfig::new(&server.uri()).write(codex_home.path())?;
@@ -2649,55 +2642,65 @@ async fn turn_start_accepts_collaboration_mode_override_v2() -> Result<()> {
.build_initialized()
.await?;
let model = "mock-model-collab";
let ThreadStartResponse { thread, .. } = mcp
.start_thread(ThreadStartParams {
model: Some("gpt-5.4".to_string()),
model: Some(model.to_string()),
..Default::default()
})
.await?;
let collaboration_mode = CollaborationMode {
mode: ModeKind::Default,
settings: Settings {
model: "mock-model-collab".to_string(),
reasoning_effort: Some(ReasoningEffort::High),
developer_instructions: None,
},
};
let _turn: TurnStartResponse = mcp
.request(|request_id| ClientRequest::TurnStart {
request_id,
params: TurnStartParams {
thread_id: thread.id.clone(),
client_user_message_id: None,
input: vec![V2UserInput::Text {
text: "Hello".to_string(),
text_elements: Vec::new(),
}],
model: Some("mock-model-override".to_string()),
effort: Some(ReasoningEffort::Low),
summary: Some(ReasoningSummary::Auto),
output_schema: None,
collaboration_mode: Some(collaboration_mode),
..Default::default()
let plan = "# Plan Mode (Conversational)";
let default = "# Collaboration Mode: Default";
for (prompt, mode, expected) in [
("Start", None, vec![]),
("Continue", Some(ModeKind::Default), vec![]),
("Plan the changes", Some(ModeKind::Plan), vec![plan]),
("Refine the plan", None, vec![plan]),
("Implement it", Some(ModeKind::Default), vec![plan, default]),
("Check the changes", None, vec![plan, default]),
] {
let response_mock = responses::mount_sse_once(
&server,
responses::sse(vec![
responses::ev_response_created(prompt),
responses::ev_completed(prompt),
]),
)
.await;
let collaboration_mode = mode.map(|mode| CollaborationMode {
mode,
settings: Settings {
model: model.to_string(),
reasoning_effort: Some(ReasoningEffort::High),
developer_instructions: None,
},
});
mcp.start_turn_and_wait_for_completion(TurnStartParams {
thread_id: thread.id.clone(),
input: vec![V2UserInput::Text {
text: prompt.to_string(),
text_elements: Vec::new(),
}],
model: collaboration_mode
.as_ref()
.map(|_| "mock-model-override".to_string()),
effort: Some(ReasoningEffort::Low),
collaboration_mode,
..Default::default()
})
.await?;
timeout(
DEFAULT_READ_TIMEOUT,
mcp.read_stream_until_notification_message("turn/completed"),
)
.await??;
let request = response_mock.single_request();
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(
"Use the `request_user_input` tool only when it is listed in the available tools"
));
let request = response_mock.single_request();
assert_eq!(request.body_json()["model"].as_str(), Some(model));
let texts = request.message_input_texts("developer");
let headers = texts
.iter()
.filter_map(|text| text.strip_prefix("<collaboration_mode>"))
.map(|text| text.lines().next().unwrap())
.collect::<Vec<_>>();
assert_eq!(headers, expected, "{prompt}");
}
Ok(())
}
@@ -7,8 +7,8 @@ use crate::context::ContextualUserFragment;
use codex_prompts::ResolvedCollaborationModeMessages;
use codex_prompts::ResolvedModelMessages;
use codex_prompts::without_update_plan_instructions;
use codex_protocol::config_types::CollaborationMode;
use codex_protocol::config_types::ModeKind;
use codex_protocol::config_types::Settings;
use codex_protocol::models::ContentItem;
use codex_protocol::models::ContentItemKind;
use codex_protocol::models::input_text;
@@ -26,24 +26,26 @@ pub(crate) struct CollaborationModeState {
impl CollaborationModeState {
pub(crate) fn from_collaboration_mode(
collaboration_mode: &CollaborationMode,
mode: Option<ModeKind>,
settings: &Settings,
messages: ResolvedCollaborationModeMessages<'_>,
update_plan_enabled: bool,
custom_model_catalog: bool,
) -> Self {
let catalog_instructions = match collaboration_mode.mode {
ModeKind::Default => messages.default,
ModeKind::Plan => messages.plan,
}
.catalog_override();
let instructions = catalog_instructions.map(str::to_string).or_else(|| {
collaboration_mode
.settings
.developer_instructions
.clone()
.filter(|instructions| !instructions.is_empty())
let bundled = ResolvedModelMessages::bundled().collaboration_modes();
let catalog_instructions = match mode {
None => None,
Some(ModeKind::Default) => messages.default.catalog_override(),
Some(ModeKind::Plan) => messages.plan.catalog_override(),
};
// Before Plan, preserve custom caller text only when it would win over the catalog.
let supplied = settings.developer_instructions.as_deref().filter(|text| {
!text.is_empty()
&& (mode.is_some()
|| (messages.default.catalog_override().is_none()
&& *text != bundled.default.text()))
});
let instructions = catalog_instructions.or(supplied).map(str::to_string);
let instructions = instructions.map(|instructions| {
if update_plan_enabled {
return instructions;
@@ -55,7 +57,6 @@ impl CollaborationModeState {
// preset or custom text. Compare whole strings against bundled presets
// only to recognize built-in text whose disabled update_plan guidance
// we can strip; custom instructions stay unchanged.
let bundled = ResolvedModelMessages::bundled().collaboration_modes();
instructions == bundled.default.text() || instructions == bundled.plan.text()
}
};
@@ -70,8 +71,8 @@ impl CollaborationModeState {
instructions: instructions.clone().unwrap_or_default(),
};
let snapshot = CollaborationModeSnapshot::Current {
mode: collaboration_mode.mode,
model: collaboration_mode.settings.model.clone(),
mode: mode.unwrap_or(ModeKind::Default),
model: settings.model.clone(),
instructions: Some(WorldStateHash::from_fragment(&fragment)),
};
Self {
@@ -48,7 +48,8 @@ fn instruction_updates_are_applied_once_in_retained_history() {
for instructions in [Some("old instructions"), Some("new instructions"), None] {
let mut world_state = WorldState::default();
world_state.add_section(CollaborationModeState::from_collaboration_mode(
&collaboration_mode(ModeKind::Default, instructions),
Some(ModeKind::Default),
&settings(instructions),
ResolvedModelMessages::bundled().collaboration_modes(),
/*update_plan_enabled*/ true,
/*custom_model_catalog*/ false,
@@ -101,7 +102,8 @@ fn catalog_collaboration_messages_select_mode_variant() {
for (mode, expected) in [(ModeKind::Default, default), (ModeKind::Plan, plan)] {
let state = CollaborationModeState::from_collaboration_mode(
&collaboration_mode(mode, Some("legacy instructions")),
Some(mode),
&settings(Some("legacy instructions")),
messages,
/*update_plan_enabled*/ true,
/*custom_model_catalog*/ false,
@@ -119,7 +121,8 @@ fn empty_catalog_collaboration_message_suppresses_legacy_instructions() {
..ResolvedModelMessages::bundled().collaboration_modes()
};
let state = CollaborationModeState::from_collaboration_mode(
&collaboration_mode(ModeKind::Plan, Some("legacy plan instructions")),
Some(ModeKind::Plan),
&settings(Some("legacy plan instructions")),
messages,
/*update_plan_enabled*/ true,
/*custom_model_catalog*/ false,
@@ -144,7 +147,8 @@ fn missing_catalog_collaboration_message_uses_legacy_instructions() {
};
for instructions in [Some("legacy plan instructions"), Some(""), None] {
let state = CollaborationModeState::from_collaboration_mode(
&collaboration_mode(ModeKind::Plan, instructions),
Some(ModeKind::Plan),
&settings(instructions),
messages,
/*update_plan_enabled*/ true,
/*custom_model_catalog*/ false,
@@ -168,7 +172,8 @@ fn legacy_collaboration_mode_snapshots_refresh_catalog_messages_once() {
..ResolvedModelMessages::bundled().collaboration_modes()
};
let state = CollaborationModeState::from_collaboration_mode(
&collaboration_mode(ModeKind::Default, Some("stale legacy instructions")),
Some(ModeKind::Default),
&settings(Some("stale legacy instructions")),
messages,
/*update_plan_enabled*/ true,
/*custom_model_catalog*/ false,
@@ -200,20 +205,18 @@ fn legacy_collaboration_mode_snapshots_refresh_catalog_messages_once() {
}
}
fn collaboration_mode(mode: ModeKind, instructions: Option<&str>) -> CollaborationMode {
CollaborationMode {
mode,
settings: Settings {
model: "test-model".to_string(),
reasoning_effort: None,
developer_instructions: instructions.map(str::to_string),
},
fn settings(instructions: Option<&str>) -> Settings {
Settings {
model: "test-model".to_string(),
reasoning_effort: None,
developer_instructions: instructions.map(str::to_string),
}
}
fn collaboration_mode_state(mode: ModeKind, instructions: &str) -> CollaborationModeState {
CollaborationModeState::from_collaboration_mode(
&collaboration_mode(mode, Some(instructions)),
Some(mode),
&settings(Some(instructions)),
ResolvedModelMessages::bundled().collaboration_modes(),
/*update_plan_enabled*/ true,
/*custom_model_catalog*/ false,
+5 -1
View File
@@ -584,7 +584,11 @@ impl ContextManager {
}
pub(crate) fn reference_context_item(&self) -> Option<TurnContextItem> {
self.reference_context_item.clone()
self.reference_context_item_ref().cloned()
}
pub(crate) fn reference_context_item_ref(&self) -> Option<&TurnContextItem> {
self.reference_context_item.as_ref()
}
pub(crate) fn render_step_world_state(
+8 -3
View File
@@ -4430,15 +4430,19 @@ impl Session {
// Read the step's model and record its environments together so an update cannot split them.
// Match apply_turn_settings and activate_turn_environments: active_turn before state.
// Wait for executor startup below, after releasing both locks.
let (mut settings, environments, inherited_environments) = {
let (mut settings, active_collaboration_mode, environments, inherited_environments) = {
let _active = self
.active_turn
.lock()
.or_cancel(cancellation_token)
.await?;
let _state = self.state.lock().or_cancel(cancellation_token).await?;
let state = self.state.lock().or_cancel(cancellation_token).await?;
let settings = turn_context.next_step_settings.load_full();
let active_collaboration_mode =
settings.active_collaboration_mode(state.history.reference_context_item_ref());
(
turn_context.next_step_settings.load_full(),
settings,
active_collaboration_mode,
self.services.turn_environments.snapshot(),
self.features
.enabled(Feature::SubagentThreadEnvironments)
@@ -4706,6 +4710,7 @@ impl Session {
}
let (executor_hook_sources, mcp, tool_router, extension_data) = prepared_tools??;
Ok(Arc::new(StepContext {
active_collaboration_mode,
sampled_through_sequence: None,
serving_assessment: None,
guardian_probe: None,
+7 -1
View File
@@ -19,6 +19,7 @@ use codex_model_provider_info::AMAZON_BEDROCK_RUNTIME_PROVIDER_ID;
use codex_model_provider_info::GCP_PROVIDER_ID;
use codex_otel::SessionTelemetry;
use codex_plugin::ExecutorPluginHookSource;
use codex_protocol::config_types::ModeKind;
use codex_protocol::items::ModelInvocationContext;
use codex_protocol::protocol::TurnContextItem;
use tokio_util::sync::CancellationToken;
@@ -41,6 +42,8 @@ pub(crate) struct StepContext {
pub(crate) realtime: RealtimeConversationSnapshot,
/// One immutable settings version captured before request preparation.
pub(crate) settings: Arc<ResolvedStepSettings>,
/// None until the first Plan turn. Carried into replacement context during compaction.
pub(crate) active_collaboration_mode: Option<ModeKind>,
/// Frozen turn preferences resolved against this step's captured model.
pub(crate) token_budget: Option<TokenBudgetConfig>,
/// Telemetry context tagged with this sampling request's model.
@@ -102,7 +105,10 @@ impl StepContext {
/// Persist the context captured for this request, even after a live update.
pub(crate) fn to_turn_context_item(&self) -> TurnContextItem {
let mut item = self.turn.to_turn_context_item();
let mut item = self.turn.context_item_with_mode(
self.active_collaboration_mode
.map(|_| self.settings.effective_collaboration_mode()),
);
item.realtime_active = Some(self.realtime.active);
item
}
@@ -11,6 +11,7 @@ use codex_otel::SessionTelemetry;
use codex_protocol::RequestCountry;
use codex_protocol::config_types::ApprovalsReviewer;
use codex_protocol::config_types::CollaborationMode;
use codex_protocol::config_types::ModeKind;
use codex_protocol::config_types::Personality;
use codex_protocol::config_types::ReasoningSummary;
use codex_protocol::config_types::SERVICE_TIER_DEFAULT_REQUEST_VALUE;
@@ -18,6 +19,7 @@ use codex_protocol::config_types::ServiceTier;
use codex_protocol::openai_models::CatalogModel;
use codex_protocol::openai_models::ReasoningEffort;
use codex_protocol::protocol::AskForApproval;
use codex_protocol::protocol::TurnContextItem;
use std::sync::Arc;
/// Model and execution settings selected for an individual model step within
@@ -94,6 +96,15 @@ impl ResolvedStepSettings {
.cloned()
}
pub(super) fn active_collaboration_mode(
&self,
previous: Option<&TurnContextItem>,
) -> Option<ModeKind> {
let mode = self.selected.collaboration_mode.mode;
(mode == ModeKind::Plan || previous.is_some_and(|item| item.collaboration_mode.is_some()))
.then_some(mode)
}
pub(crate) fn effective_collaboration_mode(&self) -> CollaborationMode {
let mut collaboration_mode = self.selected.collaboration_mode.clone();
collaboration_mode.settings.model = self.model_info.slug.clone();
+11
View File
@@ -299,6 +299,7 @@ impl StepContext {
});
settings.service_tier = turn.config.service_tier.clone();
Arc::new(Self {
active_collaboration_mode: settings.active_collaboration_mode(/*previous*/ None),
sampled_through_sequence: None,
turn_cancellation: tokio_util::sync::CancellationToken::new(),
preempt: turn
@@ -13479,3 +13480,13 @@ async fn rejected_mcp_refresh_then_corrected_user_config_blocks_ordinary_replace
"rejection must not permit same-name ordinary-auth replacement in this session"
);
}
impl TurnContext {
pub(crate) fn to_turn_context_item(&self) -> TurnContextItem {
self.context_item_with_mode(
self.initial_settings
.active_collaboration_mode(/*previous*/ None)
.map(|_| self.collaboration_mode()),
)
}
}
+5 -2
View File
@@ -938,7 +938,10 @@ impl TurnContext {
}
}
pub(crate) fn to_turn_context_item(&self) -> TurnContextItem {
pub(super) fn context_item_with_mode(
&self,
collaboration_mode: Option<CollaborationMode>,
) -> TurnContextItem {
#[allow(deprecated)]
let cwd = self.cwd.clone();
TurnContextItem {
@@ -959,7 +962,7 @@ impl TurnContext {
),
model: self.model_info().slug.clone(),
comp_hash: self.model_info().comp_hash.clone(),
collaboration_mode: Some(self.collaboration_mode()),
collaboration_mode,
multi_agent_version: Some(self.multi_agent_version),
realtime_active: Some(self.realtime_active),
cyber_access_program: self.cyber_access_program,
+2 -1
View File
@@ -342,7 +342,8 @@ impl Session {
}
if turn_context.config.include_collaboration_mode_instructions {
world_state.add_section(CollaborationModeState::from_collaboration_mode(
&settings.effective_collaboration_mode(),
step_context.active_collaboration_mode,
&settings.effective_collaboration_mode().settings,
model_messages.collaboration_modes(),
turn_context.config.update_plan_enabled,
turn_context.config.model_catalog.is_some(),
@@ -159,81 +159,78 @@ async fn catalog_collaboration_messages_track_mode_changes() -> Result<()> {
skip_if_no_network!(Ok(()));
let server = start_mock_server().await;
let req1 = mount_sse_once(
&server,
sse(vec![ev_response_created("resp-1"), ev_completed("resp-1")]),
)
.await;
let req2 = mount_sse_once(
&server,
sse(vec![ev_response_created("resp-2"), ev_completed("resp-2")]),
)
.await;
let model_slug = "catalog-collaboration-model";
let default_text = "## Plan tool\nPreserve the custom default policy.\n";
let plan_text = "## `update_plan`\nPreserve the custom Plan Mode policy.\n";
let model = model_with_collaboration_messages(model_slug, Some(default_text), Some(plan_text));
let mut builder = test_codex()
.with_model(model_slug)
.with_config(move |config| {
config.model_catalog = Some(ModelsResponse {
models: vec![model],
});
});
let test = builder.build(&server).await?;
core_test_support::submit_thread_settings(
&test.codex,
ThreadSettingsOverrides {
collaboration_mode: Some(collab_mode_for_model(
ModeKind::Default,
model_slug,
Some("legacy default instructions"),
)),
..Default::default()
},
)
.await?;
test.submit_text_turn("default turn").await?;
let first_dev_texts = developer_texts(&req1.single_request().input());
assert_eq!(
count_messages_containing(&first_dev_texts, &collab_xml(default_text)),
1
);
assert_eq!(
count_messages_containing(&first_dev_texts, "legacy default instructions"),
0
);
core_test_support::submit_thread_settings(
&test.codex,
ThreadSettingsOverrides {
collaboration_mode: Some(collab_mode_for_model(
ModeKind::Plan,
model_slug,
Some("legacy plan instructions"),
)),
..Default::default()
},
)
.await?;
test.submit_text_turn("plan turn").await?;
let second_dev_texts = developer_texts(&req2.single_request().input());
assert_eq!(
count_messages_containing(&second_dev_texts, &collab_xml(default_text)),
1
);
assert_eq!(
count_messages_containing(&second_dev_texts, &collab_xml(plan_text)),
1
);
assert_eq!(
count_messages_containing(&second_dev_texts, "legacy plan instructions"),
0
);
let builder = || {
let mut model =
model_with_collaboration_messages(model_slug, Some(default_text), Some(plan_text));
model.auto_compact_token_limit = Some(50_000);
test_codex()
.with_model(model_slug)
.with_config(move |config| {
config.model_catalog = Some(ModelsResponse {
models: vec![model],
});
})
};
let mut test = builder().build_with_auto_env(&server).await?;
let fallback = "legacy caller instructions";
let mut compact = false;
for (turn, mode, tokens, resume, expected) in [
("startup", ModeKind::Default, 10, false, (0, 0)),
("resume before Plan", ModeKind::Default, 10, true, (0, 0)),
("plan", ModeKind::Plan, 60_000, false, (1, 0)),
("exit Plan", ModeKind::Default, 60_000, false, (0, 1)),
("continue", ModeKind::Default, 10, false, (0, 1)),
("resume after Plan", ModeKind::Default, 10, true, (0, 1)),
] {
core_test_support::submit_thread_settings(
&test.codex,
ThreadSettingsOverrides {
collaboration_mode: Some(collab_mode_for_model(mode, model_slug, Some(fallback))),
..Default::default()
},
)
.await?;
if resume {
test = builder().restart_with_auto_env(&server, &test).await?;
}
if compact {
mount_sse_once(
&server,
sse(vec![
ev_response_created("compact"),
json!({
"type": "response.output_item.done",
"item": {"type": "compaction", "encrypted_content": "summary"},
}),
ev_completed("compact"),
]),
)
.await;
}
compact = tokens > 50_000;
let response = mount_sse_once(
&server,
sse(vec![
ev_response_created(turn),
core_test_support::responses::ev_completed_with_tokens(turn, tokens),
]),
)
.await;
test.submit_text_turn(turn).await?;
let texts = developer_texts(&response.single_request().input());
assert_eq!(
(
count_messages_containing(&texts, &collab_xml(plan_text)),
count_messages_containing(&texts, &collab_xml(default_text))
),
expected,
"{turn}"
);
assert_eq!(count_messages_containing(&texts, fallback), 0, "{turn}");
}
Ok(())
}
@@ -281,6 +278,27 @@ async fn catalog_collaboration_messages_refresh_without_mode_or_model_change(
.build_with_auto_env(&server)
.await?;
if mode == ModeKind::Default {
core_test_support::submit_thread_settings(
&test.codex,
ThreadSettingsOverrides {
collaboration_mode: Some(collab_mode_for_model(
ModeKind::Plan,
MODEL,
/*instructions*/ None,
)),
..Default::default()
},
)
.await?;
mount_sse_once(
&server,
sse(vec![ev_response_created("plan"), ev_completed("plan")]),
)
.await;
test.submit_text_turn("plan").await?;
}
core_test_support::submit_thread_settings(
&test.codex,
ThreadSettingsOverrides {
@@ -326,7 +344,12 @@ async fn catalog_collaboration_messages_refresh_without_mode_or_model_change(
.0
})
.collect::<Vec<_>>();
assert_eq!(collaboration_instructions.as_slice(), expected, "{turn}");
let mut expected_history = Vec::new();
if mode == ModeKind::Default {
expected_history.push(INACTIVE);
}
expected_history.extend_from_slice(expected);
assert_eq!(collaboration_instructions, expected_history, "{turn}");
requests.push(request);
}
@@ -360,11 +383,10 @@ async fn empty_collaboration_guidance_clears_prior_instructions_once(
let server = start_mock_server().await;
let model_slug = "catalog-collaboration-clear-model";
let empty_model_slug = "catalog-collaboration-empty-model";
let default_text = "catalog default instructions";
let plan_text = "catalog plan instructions";
let fallback_text = "legacy fallback instructions";
let fallback = empty_instructions.map(|_| fallback_text);
let model =
model_with_collaboration_messages(model_slug, Some(default_text), empty_instructions);
let model = model_with_collaboration_messages(model_slug, empty_instructions, Some(plan_text));
let empty_model =
model_with_collaboration_messages(empty_model_slug, empty_instructions, empty_instructions);
let mut builder = test_codex()
@@ -377,11 +399,11 @@ async fn empty_collaboration_guidance_clears_prior_instructions_once(
let test = builder.build_with_auto_env(&server).await?;
for (turn, mode, model, clear_count) in [
("default", ModeKind::Default, model_slug, 0),
("clear", ModeKind::Plan, model_slug, 1),
("still-clear", ModeKind::Plan, model_slug, 1),
("change-model", ModeKind::Plan, empty_model_slug, 1),
("change-mode", ModeKind::Default, empty_model_slug, 1),
("plan", ModeKind::Plan, model_slug, 0),
("clear", ModeKind::Default, model_slug, 1),
("still-clear", ModeKind::Default, model_slug, 1),
("change-model", ModeKind::Default, empty_model_slug, 1),
("change-mode", ModeKind::Plan, empty_model_slug, 1),
] {
let response = mount_sse_once(
&server,
@@ -401,7 +423,7 @@ async fn empty_collaboration_guidance_clears_prior_instructions_once(
let dev_texts = response.single_request().message_input_texts("developer");
assert_eq!(
(
count_messages_containing(&dev_texts, &collab_xml(default_text)),
count_messages_containing(&dev_texts, &collab_xml(plan_text)),
count_messages_containing(&dev_texts, &collab_xml("")),
count_messages_containing(&dev_texts, fallback_text),
),
@@ -433,9 +455,10 @@ async fn model_change_appends_new_catalog_collaboration_message() -> Result<()>
let second_slug = "catalog-collaboration-model-b";
let first_text = "model A collaboration instructions";
let second_text = "model B collaboration instructions";
let first = model_with_collaboration_messages(first_slug, Some(first_text), /*plan*/ None);
let first =
model_with_collaboration_messages(first_slug, /*default*/ None, Some(first_text));
let second =
model_with_collaboration_messages(second_slug, Some(second_text), /*plan*/ None);
model_with_collaboration_messages(second_slug, /*default*/ None, Some(second_text));
let mut builder = test_codex()
.with_model(first_slug)
.with_config(move |config| {
@@ -449,7 +472,7 @@ async fn model_change_appends_new_catalog_collaboration_message() -> Result<()>
&test.codex,
ThreadSettingsOverrides {
collaboration_mode: Some(collab_mode_for_model(
ModeKind::Default,
ModeKind::Plan,
first_slug,
Some("legacy instructions"),
)),
@@ -1013,9 +1036,8 @@ async fn cold_resume_refreshes_legacy_collaboration_snapshot_once(
const MODEL: &str = "catalog-collaboration-resume-model";
const ORIGINAL: &str = "original collaboration instructions";
const CURRENT: &str = "current collaboration instructions";
let builder_with_instructions = |instructions: &str| {
let model =
model_with_collaboration_messages(MODEL, Some(instructions), /*plan*/ None);
let builder_with_instructions = |instructions| {
let model = model_with_collaboration_messages(MODEL, instructions, /*plan*/ None);
test_codex().with_model(MODEL).with_config(move |config| {
config.model_catalog = Some(ModelsResponse {
models: vec![model],
@@ -1032,9 +1054,21 @@ async fn cold_resume_refreshes_legacy_collaboration_snapshot_once(
]),
)
.await;
let initial = builder_with_instructions(ORIGINAL)
let initial = builder_with_instructions(None)
.build_with_auto_env(&server)
.await?;
core_test_support::submit_thread_settings(
&initial.codex,
ThreadSettingsOverrides {
collaboration_mode: Some(collab_mode_for_model(
ModeKind::Default,
MODEL,
Some(ORIGINAL),
)),
..Default::default()
},
)
.await?;
initial.submit_text_turn("before upgrading").await?;
let home = initial.home.clone();
@@ -1049,6 +1083,14 @@ async fn cold_resume_refreshes_legacy_collaboration_snapshot_once(
.lines()
.map(|original_line| {
let mut line = codex_rollout::parse_rollout_line(original_line)?;
if let RolloutItem::TurnContext(context) = &mut line.item {
context.collaboration_mode = Some(collab_mode_for_model(
ModeKind::Default,
MODEL,
Some(ORIGINAL),
));
return serde_json::to_string(&line);
}
if let RolloutItem::WorldState(world_state) = &mut line.item
&& let Some(snapshot) = world_state.state.get_mut("collaboration_mode")
{
@@ -1067,7 +1109,7 @@ async fn cold_resume_refreshes_legacy_collaboration_snapshot_once(
);
std::fs::write(&rollout_path, format!("{legacy_rollout}\n"))?;
let resumed = builder_with_instructions(CURRENT)
let resumed = builder_with_instructions(Some(CURRENT))
.resume(&server, home, rollout_path)
.await?;
let mut previous_input = initial_response.single_request().input();
+3 -12
View File
@@ -834,18 +834,9 @@ async fn review_uses_updated_turn_permissions_and_approval_policy() {
review_context.approvals_reviewer,
Some(ApprovalsReviewer::User)
);
// The review delegate still starts in its own default mode, not the parent's Plan mode.
assert_eq!(
review_context.collaboration_mode,
Some(CollaborationMode {
mode: ModeKind::Default,
settings: Settings {
model: "gpt-5.4".to_string(),
reasoning_effort: Some(ReasoningEffort::Medium),
developer_instructions: None,
},
})
);
assert_eq!(review_context.collaboration_mode, None);
assert_eq!(review_context.model, "gpt-5.4");
assert_eq!(review_context.effort, Some(ReasoningEffort::Medium));
let _codex_home_guard = codex_home;
server.verify().await;
+8 -4
View File
@@ -4299,13 +4299,15 @@ async fn astra_async_compaction_keeps_work_added_after_its_snapshot(
assert_eq!(positions.len(), 1, "{text}");
positions[0]
};
let default = position("# Collaboration Mode: Default");
let permissions = position("<permissions instructions>");
let draft = position("Draft the launch notes.");
let compaction = position("ASYNC_LAUNCH_CHECKPOINT");
let plan = position("Plan Mode");
if matches!(suffix, LiveSuffix::User) {
let user = position("Check who can finish the notes.");
assert!(draft < compaction && compaction < default && default < plan && plan < user);
assert!(
draft < compaction && compaction < permissions && permissions < plan && plan < user
);
let entries = requests.iter().map(SnapshotEntry::body).collect::<Vec<_>>();
insta::assert_snapshot!(
"astra_async_compaction_with_live_suffix",
@@ -4321,9 +4323,11 @@ async fn astra_async_compaction_keeps_work_added_after_its_snapshot(
suffix,
LiveSuffix::RetainedTool | LiveSuffix::OverBudgetRetainedTool
) {
assert!(draft < compaction && compaction < default && default < plan && plan < tool);
assert!(
draft < compaction && compaction < permissions && permissions < plan && plan < tool
);
} else {
assert!(default < draft && draft < compaction && compaction < plan && plan < tool);
assert!(permissions < draft && draft < compaction && compaction < plan && plan < tool);
}
let assistant = position("I will check who is available.");
let call = input
@@ -35,9 +35,8 @@ Scenario: Permission discovery preserves legacy output, exposes reply-only acces
- function/wait_agent
01:message/developer:
<MODEL_INSTRUCTIONS>
02:message/developer[2]:
[01] <PERMISSIONS_INSTRUCTIONS>
[02] <COLLABORATION_MODE>
02:message/developer:
<PERMISSIONS_INSTRUCTIONS>
03:message/developer:
<MULTI_AGENT_ROLE>
04:message/developer:
@@ -39,7 +39,7 @@ Scenario: Astra sees two environments with different permissions. Only the secon
A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f]
02:message/developer[3]:
02:message/developer[2]:
[01] <permissions instructions><environment id="environment-a">
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `read-only`: The san... permits reading files. Network access is restricted. [hash=be7da4425f89053c]
@@ -74,22 +74,6 @@ Scenario: Astra sees two environments with different permissions. Only the secon
- ["cargo", "test"]
The writable root is `<CWD 2>`.
</environment></permissions instructions>
[03] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
03:message/developer:
<multi_agent_role>You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals.
@@ -23,10 +23,9 @@ Scenario: Astra compacts a completed launch-notes turn in the background. The us
- function/wait_agent
01:message/developer:
<MODEL_INSTRUCTIONS>
02:message/developer[3]:
02:message/developer[2]:
[01] <PERMISSIONS_INSTRUCTIONS>
[02] <COLLABORATION_MODE>
[03] install_budget: 400 tokens remain.
[02] install_budget: 400 tokens remain.
03:message/developer:
<MULTI_AGENT_ROLE>
04:message/developer:
@@ -62,10 +61,9 @@ Scenario: Astra compacts a completed launch-notes turn in the background. The us
- function/wait_agent
01:message/developer:
<MODEL_INSTRUCTIONS>
02:message/developer[3]:
02:message/developer[2]:
[01] <PERMISSIONS_INSTRUCTIONS>
[02] <COLLABORATION_MODE>
[03] install_budget: 400 tokens remain.
[02] install_budget: 400 tokens remain.
03:message/developer:
<MULTI_AGENT_ROLE>
04:message/developer:
@@ -108,10 +106,9 @@ Scenario: Astra compacts a completed launch-notes turn in the background. The us
02:message/user:
Draft the launch notes.
03:compaction:encrypted=true; chars=23; hash=159cfcb231cc70f0
04:message/developer[3]:
04:message/developer[2]:
[01] <PERMISSIONS_INSTRUCTIONS>
[02] <COLLABORATION_MODE>
[03] install_budget: 400 tokens remain.
[02] install_budget: 400 tokens remain.
05:message/developer:
<MULTI_AGENT_ROLE>
06:message/developer:
@@ -23,9 +23,8 @@ Scenario: Astra uses the catalog question schema to ask who a launch update is f
- function/wait_agent
01:message/developer:
<MODEL_INSTRUCTIONS>
02:message/developer[2]:
[01] <PERMISSIONS_INSTRUCTIONS>
[02] <COLLABORATION_MODE>
02:message/developer:
<PERMISSIONS_INSTRUCTIONS>
03:message/developer:
<MULTI_AGENT_ROLE>
04:message/developer:
@@ -39,27 +39,11 @@ Scenario: Astra reads code-mode timings and the collector notice even at zero to
A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f]
02:message/developer[2]:
[01] <permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
[02] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
02:message/developer:
<permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
03:message/developer:
<multi_agent_role>You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals.
@@ -49,7 +49,7 @@ Settings:
A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f]
02:message/developer[3]:
02:message/developer[2]:
[01] <permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `read-only`: The san... permits reading files. Network access is restricted. [hash=be7da4425f89053c]
# Escalation Requests
@@ -67,23 +67,7 @@ Settings:
- ["gh", "pr", "check"]
- ["cargo", "test"]
</permissions instructions>
[02] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
[03] <skills_instructions>
[02] <skills_instructions>
## Skills
A skill is a set of instructions provided through a `SKILL.md` source. Below is the list of skills that ...locators can be expanded using the skill roots table. [hash=f00d6a4d3e192f06]
### Skill roots
@@ -49,7 +49,7 @@ Settings:
A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f]
02:message/developer[3]:
02:message/developer[2]:
[01] <permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `read-only`: The san... permits reading files. Network access is restricted. [hash=be7da4425f89053c]
# Escalation Requests
@@ -67,23 +67,7 @@ Settings:
- ["gh", "pr", "check"]
- ["cargo", "test"]
</permissions instructions>
[02] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
[03] <skills_instructions>
[02] <skills_instructions>
## Skills
A skill is a set of instructions provided through a `SKILL.md` source. Below is the list of skills that ...locators can be expanded using the skill roots table. [hash=f00d6a4d3e192f06]
### Skill roots
@@ -23,9 +23,8 @@ Scenario: Astra receives new user input after its unfinished response is interru
- function/wait_agent
01:message/developer:
<MODEL_INSTRUCTIONS>
02:message/developer[2]:
[01] <PERMISSIONS_INSTRUCTIONS>
[02] <COLLABORATION_MODE>
02:message/developer:
<PERMISSIONS_INSTRUCTIONS>
03:message/developer:
<MULTI_AGENT_ROLE>
04:message/developer:
@@ -39,40 +39,24 @@ Scenario: Astra continues after new user input yields a running code cell, then
A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f]
02:message/developer[2]:
[01] <permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `read-only`: The san... permits reading files. Network access is restricted. [hash=be7da4425f89053c]
# Escalation Requests
02:message/developer:
<permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `read-only`: The san... permits reading files. Network access is restricted. [hash=be7da4425f89053c]
# Escalation Requests
Commands are run outside the sandbox if they are approved by the user, or match an existing rule that al...hell control operators, including but not limited to: [hash=d24ebf5fa4e4b9bb]
Commands are run outside the sandbox if they are approved by the user, or match an existing rule that al...hell control operators, including but not limited to: [hash=d24ebf5fa4e4b9bb]
- Pipes: |
- Logical operators: &&, ||
<OMITTED 44 LINES; ~790 TOKENS; hash=3a8900343e968d61>
NEVER provide a prefix_rule if your command uses a heredoc or herestring.
- Pipes: |
- Logical operators: &&, ||
<OMITTED 44 LINES; ~790 TOKENS; hash=3a8900343e968d61>
NEVER provide a prefix_rule if your command uses a heredoc or herestring.
### Examples
Good examples of prefixes:
- ["npm", "run", "dev"]
- ["gh", "pr", "check"]
- ["cargo", "test"]
</permissions instructions>
[02] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
### Examples
Good examples of prefixes:
- ["npm", "run", "dev"]
- ["gh", "pr", "check"]
- ["cargo", "test"]
</permissions instructions>
03:message/developer:
<multi_agent_role>You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals.
@@ -49,7 +49,7 @@ Settings:
A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f]
02:message/developer[3]:
02:message/developer[2]:
[01] <skills_instructions>
## Skills
A skill is a set of local instructions to follow that is stored in a `SKILL.md` file. Below is the list ...ed into an absolute path using the skill roots table. [hash=ca27c3957f42502b]
@@ -79,22 +79,6 @@ Settings:
- ["gh", "pr", "check"]
- ["cargo", "test"]
</permissions instructions>
[03] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
03:message/developer:
<multi_agent_role>You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals.
@@ -223,7 +207,7 @@ Settings: same as window 1
02:message/user:
Plan a team kickoff for Friday using $outline and $calendar:agenda.
03:message/developer[3]:
03:message/developer[2]:
[01] <skills_instructions>
## Skills
A skill is a set of local instructions to follow that is stored in a `SKILL.md` file. Below is the list ...ed into an absolute path using the skill roots table. [hash=ca27c3957f42502b]
@@ -253,22 +237,6 @@ Settings: same as window 1
- ["gh", "pr", "check"]
- ["cargo", "test"]
</permissions instructions>
[03] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
04:message/developer:
<multi_agent_role>You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals.
@@ -49,7 +49,7 @@ Settings:
A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f]
02:message/developer[3]:
02:message/developer[2]:
[01] <skills_instructions>
## Skills
A skill is a set of local instructions to follow that is stored in a `SKILL.md` file. Below is the list ...ed into an absolute path using the skill roots table. [hash=ca27c3957f42502b]
@@ -65,22 +65,6 @@ Settings:
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
[03] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
03:message/developer:
<multi_agent_role>You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals.
@@ -49,7 +49,7 @@ Settings:
A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f]
02:message/developer[3]:
02:message/developer[2]:
[01] <skills_instructions>
## Skills
A skill is a set of local instructions to follow that is stored in a `SKILL.md` file. Below is the list ...ed into an absolute path using the skill roots table. [hash=d516c00c9246c269]
@@ -65,22 +65,6 @@ Settings:
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
[03] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
03:message/developer:
<multi_agent_role>You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals.
@@ -49,27 +49,11 @@ Settings:
A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f]
02:message/developer[2]:
[01] <permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
[02] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
02:message/developer:
<permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
03:message/developer:
<multi_agent_role>You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals.
@@ -49,27 +49,11 @@ Settings:
A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f]
02:message/developer[2]:
[01] <permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
[02] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
02:message/developer:
<permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
03:message/developer:
<multi_agent_role>You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals.
@@ -49,28 +49,12 @@ Settings:
A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f]
02:message/developer[3]:
02:message/developer[2]:
[01] <permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
[02] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
[03] <tools>
[02] <tools>
Deferred tool namespaces:
- mcp__rmcp: Use these tools to exercise the rmcp test server.
</tools>
@@ -39,7 +39,7 @@ Scenario: A side chat receives the parent turn as reference, adds its own turn,
A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f]
02:message/developer[3]:
02:message/developer[2]:
[01] Use plain language.
[02] <permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `read-only`: The san... permits reading files. Network access is restricted. [hash=be7da4425f89053c]
@@ -58,22 +58,6 @@ Scenario: A side chat receives the parent turn as reference, adds its own turn,
- ["gh", "pr", "check"]
- ["cargo", "test"]
</permissions instructions>
[03] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
03:message/developer:
<multi_agent_role>You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals.
@@ -141,7 +125,7 @@ Scenario: A side chat receives the parent turn as reference, adds its own turn,
A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f]
02:message/developer[3]:
02:message/developer[2]:
[01] Use plain language.
[02] <permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `read-only`: The san... permits reading files. Network access is restricted. [hash=be7da4425f89053c]
@@ -160,22 +144,6 @@ Scenario: A side chat receives the parent turn as reference, adds its own turn,
- ["gh", "pr", "check"]
- ["cargo", "test"]
</permissions instructions>
[03] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
03:message/developer:
<multi_agent_role>You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals.
@@ -23,9 +23,8 @@ Scenario: Core renders the host's roster with native World State cadence. Compac
- function/wait_agent
01:message/developer:
<MODEL_INSTRUCTIONS>
02:message/developer[2]:
[01] <PERMISSIONS_INSTRUCTIONS>
[02] <COLLABORATION_MODE>
02:message/developer:
<PERMISSIONS_INSTRUCTIONS>
03:message/developer:
<MULTI_AGENT_ROLE>
04:message/developer:
@@ -84,9 +83,8 @@ Scenario: Core renders the host's roster with native World State cadence. Compac
Start planning the release.
03:message/user:
Continue planning.
04:message/developer[2]:
[01] <PERMISSIONS_INSTRUCTIONS>
[02] <COLLABORATION_MODE>
04:message/developer:
<PERMISSIONS_INSTRUCTIONS>
05:message/developer:
<MULTI_AGENT_ROLE>
06:message/developer:
@@ -33,9 +33,8 @@ Settings:
- function/wait_agent
01:message/developer:
<MODEL_INSTRUCTIONS>
02:message/developer[2]:
[01] <PERMISSIONS_INSTRUCTIONS>
[02] <COLLABORATION_MODE>
02:message/developer:
<PERMISSIONS_INSTRUCTIONS>
03:message/developer:
<MULTI_AGENT_ROLE>
04:message/developer:
@@ -70,9 +69,8 @@ Settings: same as window 1
- function/wait_agent
01:message/developer:
<MODEL_INSTRUCTIONS>
02:message/developer[2]:
[01] <PERMISSIONS_INSTRUCTIONS>
[02] <COLLABORATION_MODE>
02:message/developer:
<PERMISSIONS_INSTRUCTIONS>
03:message/developer:
<MULTI_AGENT_ROLE>
04:message/developer:
@@ -49,28 +49,12 @@ Settings:
A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f]
01:message/developer[3]:
01:message/developer[2]:
[01] <permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
[02] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
[03] <tools>
[02] <tools>
Deferred tool namespaces:
- mcp__codex_apps__calendar: Plan events and manage your calendar.
</tools>
@@ -49,28 +49,12 @@ Settings:
A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f]
01:message/developer[3]:
01:message/developer[2]:
[01] <permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
[02] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
[03] <tools>
[02] <tools>
Deferred tool namespaces:
- mcp__codex_apps__calendar: Plan events and manage your calendar.
</tools>
@@ -23,9 +23,8 @@ Scenario: Settlement helpers deliver fulfilled and rejected records with input i
- function/wait_agent
01:message/developer:
<MODEL_INSTRUCTIONS>
02:message/developer[2]:
[01] <PERMISSIONS_INSTRUCTIONS>
[02] <COLLABORATION_MODE>
02:message/developer:
<PERMISSIONS_INSTRUCTIONS>
03:message/developer:
<MULTI_AGENT_ROLE>
04:message/developer:
@@ -23,13 +23,12 @@ Scenario: A Code Mode script drops its command handle. WorldState retains it whi
- function/wait_agent
01:message/developer:
<MODEL_INSTRUCTIONS>
02:message/developer[3]:
02:message/developer[2]:
[01] <command_sessions>
Current command sessions for this thread (supersedes earlier snapshots). Exited sessions retain results ... busy with a tool interaction or result finalization. [hash=e247ea1c0c96e976]
None.
</command_sessions>
[02] <PERMISSIONS_INSTRUCTIONS>
[03] <COLLABORATION_MODE>
03:message/developer:
<MULTI_AGENT_ROLE>
04:message/developer:
@@ -75,13 +74,12 @@ Scenario: A Code Mode script drops its command handle. WorldState retains it whi
- function/wait_agent
01:message/developer:
<MODEL_INSTRUCTIONS>
02:message/developer[3]:
02:message/developer[2]:
[01] <command_sessions>
Current command sessions for this thread (supersedes earlier snapshots). Exited sessions retain results ... busy with a tool interaction or result finalization. [hash=e247ea1c0c96e976]
None.
</command_sessions>
[02] <PERMISSIONS_INSTRUCTIONS>
[03] <COLLABORATION_MODE>
03:message/developer:
<MULTI_AGENT_ROLE>
04:message/developer:
@@ -120,13 +118,11 @@ Scenario: A Code Mode script drops its command handle. WorldState retains it whi
<model_instructions>
The current model is no-command-polling.
</model_instructions>
16:message/developer:
<COLLABORATION_MODE>
17:message/user:
16:message/user:
Check the command while polling is unavailable.
18:configuration_update:reasoning={"effort":"low"}
17:configuration_update:reasoning={"effort":"low"}
-- request 5 (compaction) --
19:compaction_trigger
18:compaction_trigger
## Window 3 (after request 5: input diverged at item 00, settings changed (model))
-- request 6 (turn) --
@@ -151,14 +147,13 @@ Scenario: A Code Mode script drops its command handle. WorldState retains it whi
Start the command and print only its output.
03:message/user:
Keep the command running.
04:message/developer[3]:
04:message/developer[2]:
[01] <command_sessions>
Current command sessions for this thread (supersedes earlier snapshots). Exited sessions retain results ... busy with a tool interaction or result finalization. [hash=e247ea1c0c96e976]
write_stdin is unavailable with the current tool set.
1000: running
</command_sessions>
[02] <PERMISSIONS_INSTRUCTIONS>
[03] <COLLABORATION_MODE>
05:message/developer:
<MULTI_AGENT_ROLE>
06:message/developer:
@@ -182,56 +177,54 @@ Scenario: A Code Mode script drops its command handle. WorldState retains it whi
<model_instructions>
The current model is gpt-6-astra.
</model_instructions>
14:message/developer:
<COLLABORATION_MODE>
15:message/user:
14:message/user:
Check the command after compaction with polling restored.
-- request 7 (turn) --
16:message/developer:
15:message/developer:
<command_sessions>
Current command sessions for this thread (supersedes earlier snapshots). Exited sessions retain results ... busy with a tool interaction or result finalization. [hash=e247ea1c0c96e976]
1000: exited; poll to collect
</command_sessions>
17:message/user:
16:message/user:
Check the command after it exits.
-- request 8 (turn) --
18:message/user:
17:message/user:
Collect the final command result.
-- request 9 (turn) --
19:custom_tool_call/exec:const result = await tools.write_stdin({session_id: 1000, chars: ""}); text({output: result.output, exit_code: result.exit_code});
20:custom_tool_call_output:Script completed
18:custom_tool_call/exec:const result = await tools.write_stdin({session_id: 1000, chars: ""}); text({output: result.output, exit_code: result.exit_code});
19:custom_tool_call_output:Script completed
Wall time <DURATION> seconds
Output:
| {"output":"finished","exit_code":7}
21:message/developer:
20:message/developer:
<command_sessions>
Current command sessions for this thread (supersedes earlier snapshots). Exited sessions retain results ... busy with a tool interaction or result finalization. [hash=e247ea1c0c96e976]
None.
</command_sessions>
-- request 10 (turn) --
22:message/user:
21:message/user:
Start another command before restarting.
-- request 11 (turn) --
23:custom_tool_call/exec:// @exec: {"yield_time_ms": 30000}
22:custom_tool_call/exec:// @exec: {"yield_time_ms": 30000}
const result = await tools.exec_command({cmd: "while [ ! -f release-second-command ]; do sleep 0.02; don...inished; exit 7", login: false, yield_time_ms: 250}); [hash=f914f064e7e2bfce]
text(result.output);
24:custom_tool_call_output:Script completed
23:custom_tool_call_output:Script completed
Wall time <DURATION> seconds
Output:
25:message/developer:
24:message/developer:
<command_sessions>
Current command sessions for this thread (supersedes earlier snapshots). Exited sessions retain results ... busy with a tool interaction or result finalization. [hash=e247ea1c0c96e976]
1001: running
</command_sessions>
-- request 12 (turn) --
26:message/developer:
25:message/developer:
<command_sessions>
Current command sessions for this thread (supersedes earlier snapshots). Exited sessions retain results ... busy with a tool interaction or result finalization. [hash=e247ea1c0c96e976]
None.
</command_sessions>
27:message/user:
26:message/user:
<ENVIRONMENT_CONTEXT>
28:message/user:
27:message/user:
Check command sessions after restarting.
29:configuration_update:reasoning={"effort":"low"}
28:configuration_update:reasoning={"effort":"low"}
@@ -49,27 +49,11 @@ Settings:
A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f]
02:message/developer[2]:
[01] <permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
[02] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
02:message/developer:
<permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
03:message/developer:
<multi_agent_role>You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals.
@@ -145,27 +129,11 @@ Settings: same as window 1
A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f]
02:message/developer[2]:
[01] <permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
[02] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
02:message/developer:
<permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
03:message/developer:
<multi_agent_role>You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals.
@@ -238,40 +206,24 @@ Settings: same as window 1
A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f]
02:message/developer[2]:
[01] <permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `read-only`: The san... permits reading files. Network access is restricted. [hash=be7da4425f89053c]
# Escalation Requests
02:message/developer:
<permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `read-only`: The san... permits reading files. Network access is restricted. [hash=be7da4425f89053c]
# Escalation Requests
Commands are run outside the sandbox if they are approved by the user, or match an existing rule that al...hell control operators, including but not limited to: [hash=d24ebf5fa4e4b9bb]
Commands are run outside the sandbox if they are approved by the user, or match an existing rule that al...hell control operators, including but not limited to: [hash=d24ebf5fa4e4b9bb]
- Pipes: |
- Logical operators: &&, ||
<OMITTED 44 LINES; ~790 TOKENS; hash=3a8900343e968d61>
NEVER provide a prefix_rule if your command uses a heredoc or herestring.
- Pipes: |
- Logical operators: &&, ||
<OMITTED 44 LINES; ~790 TOKENS; hash=3a8900343e968d61>
NEVER provide a prefix_rule if your command uses a heredoc or herestring.
### Examples
Good examples of prefixes:
- ["npm", "run", "dev"]
- ["gh", "pr", "check"]
- ["cargo", "test"]
</permissions instructions>
[02] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
### Examples
Good examples of prefixes:
- ["npm", "run", "dev"]
- ["gh", "pr", "check"]
- ["cargo", "test"]
</permissions instructions>
03:message/developer:
<multi_agent_role>You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals.
@@ -37,9 +37,8 @@ Settings:
-- request 1 (turn) --
00:message/developer:
<MODEL_INSTRUCTIONS>
01:message/developer[2]:
[01] <PERMISSIONS_INSTRUCTIONS>
[02] <COLLABORATION_MODE>
01:message/developer:
<PERMISSIONS_INSTRUCTIONS>
02:message/developer:
<MULTI_AGENT_ROLE>
03:message/developer:
@@ -56,9 +55,8 @@ Settings: relative to window 1
-- request 2 (turn) --
00:message/developer:
<MODEL_INSTRUCTIONS>
01:message/developer[2]:
[01] <PERMISSIONS_INSTRUCTIONS>
[02] <COLLABORATION_MODE>
01:message/developer:
<PERMISSIONS_INSTRUCTIONS>
02:message/developer:
<MULTI_AGENT_ROLE>
03:message/developer:
@@ -85,9 +83,8 @@ Settings: relative to window 2
-- request 5 (turn) --
00:message/developer:
<MODEL_INSTRUCTIONS>
01:message/developer[2]:
[01] <PERMISSIONS_INSTRUCTIONS>
[02] <COLLABORATION_MODE>
01:message/developer:
<PERMISSIONS_INSTRUCTIONS>
02:message/developer:
<MULTI_AGENT_ROLE>
03:message/developer:
@@ -49,28 +49,12 @@ Settings:
A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f]
02:message/developer[3]:
02:message/developer[2]:
[01] <permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
[02] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
[03] <skills_instructions>
[02] <skills_instructions>
## Skills
A skill is a set of instructions provided through a `SKILL.md` source. Below is the list of skills that ...locators can be expanded using the skill roots table. [hash=f00d6a4d3e192f06]
### Skill roots
@@ -43,9 +43,8 @@ Settings:
-- request 1 (turn) --
00:message/developer:
<MODEL_INSTRUCTIONS>
01:message/developer[2]:
[01] <PERMISSIONS_INSTRUCTIONS>
[02] <COLLABORATION_MODE>
01:message/developer:
<PERMISSIONS_INSTRUCTIONS>
02:message/developer:
<MULTI_AGENT_ROLE>
03:message/developer:
@@ -47,9 +47,8 @@ Settings:
-- request 1 (turn) --
00:message/developer:
<MODEL_INSTRUCTIONS>
01:message/developer[2]:
[01] <PERMISSIONS_INSTRUCTIONS>
[02] <COLLABORATION_MODE>
01:message/developer:
<PERMISSIONS_INSTRUCTIONS>
02:message/developer:
<MULTI_AGENT_ROLE>
03:message/developer:
@@ -72,9 +71,8 @@ Settings: relative to window 1
-- request 3 (turn) --
00:message/developer:
<MODEL_INSTRUCTIONS>
01:message/developer[2]:
[01] <PERMISSIONS_INSTRUCTIONS>
[02] <COLLABORATION_MODE>
01:message/developer:
<PERMISSIONS_INSTRUCTIONS>
02:message/developer:
<MULTI_AGENT_ROLE>
03:message/developer:
@@ -48,28 +48,12 @@ Settings:
A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f]
01:message/developer[3]:
01:message/developer[2]:
[01] <permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
[02] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
[03] <tools>
[02] <tools>
Deferred tool namespaces:
- mcp__resources: Use these tools to exercise the rmcp test server.
</tools>
@@ -49,27 +49,11 @@ Settings:
A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f]
02:message/developer[2]:
[01] <permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
[02] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
02:message/developer:
<permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
03:message/developer:
<multi_agent_role>You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals.
@@ -42,27 +42,11 @@ Settings:
A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f]
02:message/developer[2]:
[01] <permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
[02] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
02:message/developer:
<permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
03:message/developer:
<multi_agent_mode>
Any earlier instruction enabling proactive multi-agent delegation no longer applies. Do not spawn sub-ag...k for sub-agents, delegation, or parallel agent work. [hash=6e1e1baf5a87faf5]
@@ -42,27 +42,11 @@ Settings:
A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f]
02:message/developer[2]:
[01] <permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
[02] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
02:message/developer:
<permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
03:message/developer:
<multi_agent_mode>
Proactive multi-agent delegation is active. Any earlier developer instruction requiring an explicit user...message changes it. User requests override this hint. [hash=0917619915af4b51]
@@ -50,27 +50,11 @@ Settings:
A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f]
02:message/developer[2]:
[01] <permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
[02] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
02:message/developer:
<permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
03:function_call_output/agent.thread_hint:Agent name: /root
First context window id: <UUID 1>
Current context window id: <UUID 1>
@@ -1,6 +1,5 @@
---
source: core/tests/suite/scenarios_reserved_spawn.rs
assertion_line: 264
expression: "context_snapshot::format_request_history_snapshot(\"Host preparation preserves custom base instructions and applies the native subagent developer override when starting a child with a different model.\",\n&requests, &ContextSnapshotOptions::default().include_request_settings(),)"
---
Scenario: Host preparation preserves custom base instructions and applies the native subagent developer override when starting a child with a different model.
@@ -27,7 +26,7 @@ Settings:
- function/sleep
01:message/developer:
Keep the custom base instructions.
02:message/developer[3]:
02:message/developer[2]:
[01] Explain the reasoning behind your findings.
[02] <permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `read-only`: The san... permits reading files. Network access is restricted. [hash=be7da4425f89053c]
@@ -46,22 +45,6 @@ Settings:
- ["gh", "pr", "check"]
- ["cargo", "test"]
</permissions instructions>
[03] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
03:message/developer:
<multi_agent_mode>
Any earlier instruction enabling proactive multi-agent delegation no longer applies. Do not spawn sub-ag...k for sub-agents, delegation, or parallel agent work. [hash=6e1e1baf5a87faf5]
@@ -23,9 +23,8 @@ Scenario: With retention disabled, the client can still send retain=true. Tool o
- function/wait_agent
01:message/developer:
<MODEL_INSTRUCTIONS>
02:message/developer[2]:
[01] <PERMISSIONS_INSTRUCTIONS>
[02] <COLLABORATION_MODE>
02:message/developer:
<PERMISSIONS_INSTRUCTIONS>
03:message/developer:
<MULTI_AGENT_ROLE>
04:message/developer:
@@ -62,9 +61,8 @@ Scenario: With retention disabled, the client can still send retain=true. Tool o
- function/wait_agent
01:message/developer:
<MODEL_INSTRUCTIONS>
02:message/developer[2]:
[01] <PERMISSIONS_INSTRUCTIONS>
[02] <COLLABORATION_MODE>
02:message/developer:
<PERMISSIONS_INSTRUCTIONS>
03:message/developer:
<MULTI_AGENT_ROLE>
04:message/developer:
@@ -101,9 +99,8 @@ Scenario: With retention disabled, the client can still send retain=true. Tool o
- function/wait_agent
01:message/developer:
<MODEL_INSTRUCTIONS>
02:message/developer[2]:
[01] <PERMISSIONS_INSTRUCTIONS>
[02] <COLLABORATION_MODE>
02:message/developer:
<PERMISSIONS_INSTRUCTIONS>
03:message/developer:
<MULTI_AGENT_ROLE>
04:message/developer:
@@ -23,9 +23,8 @@ Scenario: Retained thread instructions stop emergency tool-output trimming. Comp
- function/wait_agent
01:message/developer:
<MODEL_INSTRUCTIONS>
02:message/developer[2]:
[01] <PERMISSIONS_INSTRUCTIONS>
[02] <COLLABORATION_MODE>
02:message/developer:
<PERMISSIONS_INSTRUCTIONS>
03:message/developer:
<MULTI_AGENT_ROLE>
04:message/developer:
@@ -65,9 +64,8 @@ Scenario: Retained thread instructions stop emergency tool-output trimming. Comp
- function/wait_agent
01:message/developer:
<MODEL_INSTRUCTIONS>
02:message/developer[2]:
[01] <PERMISSIONS_INSTRUCTIONS>
[02] <COLLABORATION_MODE>
02:message/developer:
<PERMISSIONS_INSTRUCTIONS>
03:message/developer:
<MULTI_AGENT_ROLE>
04:message/developer:
@@ -49,28 +49,12 @@ Settings:
A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f]
02:message/developer[4]:
02:message/developer[3]:
[01] <permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
[02] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
[03] <skills_instructions>
[02] <skills_instructions>
## Skills
A skill is a set of instructions provided through a `SKILL.md` source. Below is the list of skills that ...locators can be expanded using the skill roots table. [hash=f00d6a4d3e192f06]
### Skill roots
@@ -81,7 +65,7 @@ Settings:
- other:s1: Skill guidance. Skill guidance. Skill guidance. Skill guidance. Skill guidance. Skill guidan...ce. UNIQUE_DESCRIPTION_END (executor package: e1/s1) [hash=d8432891813affeb]
- other:s2: Skill guidance. Skill guidance. Skill guidance. Skill guidance. Skill guidance. Skill guidan...ce. UNIQUE_DESCRIPTION_END (executor package: e1/s2) [hash=1c05fa218dd21e8f]
</skills_instructions>
[04] <skills_instructions>
[03] <skills_instructions>
## Skills
A skill is a set of instructions provided through a `SKILL.md` source. Below is the list of skills that ...urce` locators use their provider's access mechanism. [hash=b6782e3abdba03b2]
Read a skill package directly with `skills.read({"package":"<package>"})` to read its `SKILL.md`; root a...ackage is not provided, use `skills.list` to find it. [hash=25bf84ea2123d647]
@@ -49,28 +49,12 @@ Settings:
A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f]
02:message/developer[4]:
02:message/developer[3]:
[01] <permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
[02] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
[03] <skills_instructions>
[02] <skills_instructions>
## Skills
A skill is a set of instructions provided through a `SKILL.md` source. Below is the list of skills that ...locators can be expanded using the skill roots table. [hash=18b83353757fba24]
### Skill roots
@@ -81,7 +65,7 @@ Settings:
- other:s1: (executor package: e1/s1)
- other:s2: (executor package: e1/s2)
</skills_instructions>
[04] <skills_instructions>
[03] <skills_instructions>
## Skills
A skill is a set of instructions provided through a `SKILL.md` source. Below is the list of skills that ...urce` locators use their provider's access mechanism. [hash=97229b4ea8d5a55c]
Read a skill package directly with `skills.read({"package":"<package>"})` to read its `SKILL.md`; root a...ackage is not provided, use `skills.list` to find it. [hash=25bf84ea2123d647]
@@ -49,7 +49,7 @@ Settings:
A user can also tag a plugin using `[@plugin-name](plugin://{{plugin_id}})` or an app using `[$app-name]... app, prefer its relevant capabilities for that turn. [hash=8730f69f41534f8f]
02:message/developer[3]:
02:message/developer[2]:
[01] <skills_instructions>
## Host skills
@@ -71,22 +71,6 @@ Settings:
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
[03] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
03:message/developer:
<multi_agent_role>You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals.
@@ -203,7 +187,7 @@ Settings: same as window 1
List the available skills after removing browser-testing.
06:message/user:
Continue with the same skills.
07:message/developer[3]:
07:message/developer[2]:
[01] <skills_instructions>
## Host skills
@@ -225,22 +209,6 @@ Settings: same as window 1
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
[03] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
08:message/developer:
<multi_agent_role>You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals.
@@ -344,7 +312,7 @@ Settings: same as window 1
Continue after compaction.
09:message/user:
Continue with a smaller skills list budget.
10:message/developer[3]:
10:message/developer[2]:
[01] <skills_instructions>
## Host skills
@@ -366,22 +334,6 @@ Settings: same as window 1
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
[03] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
11:message/developer:
<multi_agent_role>You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals.
@@ -497,7 +449,7 @@ Settings: same as window 1
Check the updated code-review skill.
15:message/user:
Continue after removing more skills.
16:message/developer[3]:
16:message/developer[2]:
[01] <skills_instructions>
## Host skills
@@ -517,22 +469,6 @@ Settings: same as window 1
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
[03] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
17:message/developer:
<multi_agent_role>You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals.
@@ -23,10 +23,9 @@ Scenario: Astra reads Cloud instructions, discovers an omitted deployment instal
- function/wait_agent
01:message/developer:
<MODEL_INSTRUCTIONS>
02:message/developer[3]:
02:message/developer[2]:
[01] <PERMISSIONS_INSTRUCTIONS>
[02] <COLLABORATION_MODE>
[03] <SKILLS_INSTRUCTIONS>
[02] <SKILLS_INSTRUCTIONS>
03:message/developer:
<MULTI_AGENT_ROLE>
04:message/developer:
@@ -23,10 +23,9 @@ Scenario: A user requests the bundled statusline skill by name.
- function/wait_agent
01:message/developer:
<MODEL_INSTRUCTIONS>
02:message/developer[3]:
02:message/developer[2]:
[01] <SKILLS_INSTRUCTIONS>
[02] <PERMISSIONS_INSTRUCTIONS>
[03] <COLLABORATION_MODE>
03:message/developer:
<MULTI_AGENT_ROLE>
04:message/developer:
@@ -33,9 +33,8 @@ Settings:
- function/wait_agent
01:message/developer:
<MODEL_INSTRUCTIONS>
02:message/developer[2]:
[01] <PERMISSIONS_INSTRUCTIONS>
[02] <COLLABORATION_MODE>
02:message/developer:
<PERMISSIONS_INSTRUCTIONS>
03:message/developer:
<MULTI_AGENT_ROLE>
04:message/developer:
@@ -23,9 +23,8 @@ Scenario: Available file references pass through. A later request replaces missi
- function/wait_agent
01:message/developer:
<MODEL_INSTRUCTIONS>
02:message/developer[2]:
[01] <PERMISSIONS_INSTRUCTIONS>
[02] <COLLABORATION_MODE>
02:message/developer:
<PERMISSIONS_INSTRUCTIONS>
03:message/developer:
<MULTI_AGENT_ROLE>
04:message/developer:
@@ -59,9 +58,8 @@ Scenario: Available file references pass through. A later request replaces missi
- function/wait_agent
01:message/developer:
<MODEL_INSTRUCTIONS>
02:message/developer[2]:
[01] <PERMISSIONS_INSTRUCTIONS>
[02] <COLLABORATION_MODE>
02:message/developer:
<PERMISSIONS_INSTRUCTIONS>
03:message/developer:
<MULTI_AGENT_ROLE>
04:message/developer:
@@ -51,27 +51,11 @@ Settings:
02:message/developer:
<scenario_instructions>scenario_prefix: A</scenario_instructions>
03:message/developer[2]:
[01] <permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
[02] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
03:message/developer:
<permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
04:message/developer:
<multi_agent_role>You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals.
@@ -171,27 +155,11 @@ Settings: unavailable (items only)
Plan the release.
04:message/user:
Check the plan.
05:message/developer[2]:
[01] <permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
[02] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
05:message/developer:
<permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
06:message/developer:
<multi_agent_role>You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals.
@@ -268,27 +236,11 @@ Settings: same as window 1
Plan the release.
04:message/user:
Check the plan.
05:message/developer[2]:
[01] <permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
[02] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
05:message/developer:
<permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
06:message/developer:
<multi_agent_role>You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals.
@@ -51,27 +51,11 @@ Settings:
02:message/developer:
<scenario_instructions>scenario_prefix: A</scenario_instructions>
03:message/developer[2]:
[01] <permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
[02] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
03:message/developer:
<permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
04:message/developer:
<multi_agent_role>You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals.
@@ -162,27 +146,11 @@ Settings: unavailable (items only)
Plan the release.
04:message/user:
Check the plan.
05:message/developer[2]:
[01] <permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
[02] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
05:message/developer:
<permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
06:message/developer:
<multi_agent_role>You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals.
@@ -257,27 +225,11 @@ Settings: same as window 1
Plan the release.
04:message/user:
Check the plan.
05:message/developer[2]:
[01] <permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
[02] <collaboration_mode># Collaboration Mode: Default
You are now in Default mode. Any previous instructions for other modes (e.g. Plan mode) are no longer active.
Your active mode changes only when new developer instructions with a different `<collaboration_mode>...<...by themselves. Known mode names are Default and Plan. [hash=e75f6b12fc52d812]
## request_user_input availability
Use the `request_user_input` tool only when it is listed in the available tools for this turn.
Use the `request_user_input` tool only for optional questions where the answer would materially improve the quality of the work.
If `request_user_input` returns no answers, continue with best judgment instead of asking again or treating the turn as blocked.
Never use the `request_user_input` tool for permission requests or permission-related escalations.
</collaboration_mode>
05:message/developer:
<permissions instructions>
Filesystem sandboxing defines which files can be read or written. `sandbox_mode` is `danger-full-access`...ll commands are permitted. Network access is enabled. [hash=c134061cebb94a1b]
Approval policy is currently never. Do not provide the `sandbox_permissions` for any reason, commands will be rejected.
</permissions instructions>
06:message/developer:
<multi_agent_role>You are `/root`, the primary agent in a team of agents collaborating to fulfill the user's goals.
+11 -3
View File
@@ -1087,8 +1087,8 @@ async fn active_model_switch_updates_core_context_from_captured_settings(
let messages = model.model_messages.as_mut().expect("model messages");
messages.instructions_template = Some(format!("Instructions for {slug}."));
messages.collaboration_modes = Some(CollaborationModeMessages {
default: Some(format!("Default collaboration for {slug}.")),
plan: None,
default: None,
plan: Some(format!("Plan collaboration for {slug}.")),
});
messages.multi_agent = Some(MultiAgentMessages {
role: Some(MultiAgentRoleMessages {
@@ -1129,6 +1129,14 @@ async fn active_model_switch_updates_core_context_from_captured_settings(
})
.build_with_auto_env(&server)
.await?;
let mut collaboration_mode = test.codex.config_snapshot().await.collaboration_mode;
collaboration_mode.mode = codex_protocol::config_types::ModeKind::Plan;
test.codex
.update_thread_settings(ThreadSettingsOverrides {
collaboration_mode: Some(collaboration_mode),
..Default::default()
})
.await?;
let request = start_paused_turn(&test.codex).await?;
if reload_user_config {
@@ -1205,7 +1213,7 @@ async fn active_model_switch_updates_core_context_from_captured_settings(
"model-switch instructions should not contain a personality update"
);
for text in [
format!("Default collaboration for {MODEL_B}."),
format!("Plan collaboration for {MODEL_B}."),
format!("Approval instructions for {MODEL_B}."),
format!("Root role for {MODEL_B}."),
format!("Delegation policy for {MODEL_B}."),
@@ -1,6 +1,5 @@
---
source: tui/src/app/tests/safety_buffering.rs
assertion_line: 284
expression: "context_snapshot::format_request_history_snapshot(\"The fork excludes the blocked turn and submits the selected rewrite.\",\n&requests, &ContextSnapshotOptions::default().rewrite_known_segments(),)"
---
Scenario: The fork excludes the blocked turn and submits the selected rewrite.
@@ -9,11 +8,10 @@ Scenario: The fork excludes the blocked turn and submits the selected rewrite.
-- request 1 (turn) --
00:message/developer:
Help the user.
01:message/developer[4]:
01:message/developer[3]:
[01] <SKILLS_INSTRUCTIONS>
[02] <PERMISSIONS_INSTRUCTIONS>
[03] <COLLABORATION_MODE>
[04] <tools>
[03] <tools>
Deferred tool namespaces:
- codex_tui: Manage Codex tasks available through the connected app server.
</tools>
@@ -26,11 +24,10 @@ Scenario: The fork excludes the blocked turn and submits the selected rewrite.
-- request 2 (turn) --
00:message/developer:
Help the user.
01:message/developer[4]:
01:message/developer[3]:
[01] <SKILLS_INSTRUCTIONS>
[02] <PERMISSIONS_INSTRUCTIONS>
[03] <COLLABORATION_MODE>
[04] <tools>
[03] <tools>
Deferred tool namespaces:
- codex_tui: Manage Codex tasks available through the connected app server.
</tools>
@@ -8,11 +8,10 @@ Scenario: Clear context and implement the approved plan in a fresh thread.
-- request 1 (request) --
00:message/developer:
Help the user.
01:message/developer[4]:
01:message/developer[3]:
[01] <SKILLS_INSTRUCTIONS>
[02] <PERMISSIONS_INSTRUCTIONS>
[03] <COLLABORATION_MODE>
[04] <tools>
[03] <tools>
Deferred tool namespaces:
- codex_tui: Manage Codex tasks available through the connected app server.
</tools>