Track multi-agent usage hints in world state (#37189)

## Why

Resumed sessions need the current multi-agent usage instructions when configuration changes or the saved history predates usage-hint tracking.

## What changed

- Store multi-agent usage hints in world state and refresh changed or previously untracked hints before re-emitting the active multi-agent mode.
- Present `wait_agent` polling guidance in the overridable developer instructions only when the tool is enabled, instead of embedding it in the tool schema.

## Testing

- Cover cold resumes, changes to `wait_agent` availability, custom usage hints, message ordering, and tool-schema behavior.

GitOrigin-RevId: a9c6798d5dc2dedc8dadc49e0a80ff50a757ab83
This commit is contained in:
Adam Perry @ OpenAI authored and copyberry committed 2026-08-06 00:22:06 +00:00
1 parent 98da2c4499
commit 92b83e226d
13 files changed
+561 -25

No files matched your search

@@ -877,7 +877,7 @@ fn wait_agent_tool_parameters_v2(options: WaitAgentTimeoutOptions) -> JsonSchema
let properties = BTreeMap::from([(
"timeout_ms".to_string(),
JsonSchema::number(Some(format!(
"Timeout in milliseconds. Defaults to {}, min {}, max {}. Prefer longer waits (minutes) to avoid busy polling.",
"Timeout in milliseconds. Defaults to {}, min {}, max {}.",
options.default_timeout_ms, options.min_timeout_ms, options.max_timeout_ms,
))),
)]);
@@ -421,9 +421,7 @@ fn wait_agent_tool_v2_uses_timeout_only_summary_output() {
properties
.get("timeout_ms")
.and_then(|schema| schema.description.as_deref()),
Some(
"Timeout in milliseconds. Defaults to 30000, min 10000, max 3600000. Prefer longer waits (minutes) to avoid busy polling."
)
Some("Timeout in milliseconds. Defaults to 30000, min 10000, max 3600000.")
);
assert_eq!(parameters.required.as_ref(), None);
assert_eq!(