Expose non-consuming input activity waits to hosts (#58411)

## Why

Host-owned tools need to wait for agent messages or steering input with the same behavior as native `wait_agent`, including when native multi-agent support is disabled.

## What changed

- Add `CodexThread::wait_for_input_activity` and export `InputWaitOutcome` through core and core-api, sharing the wait implementation with `wait_agent`.
- Distinguish notifying agent messages from steering input, with steering taking precedence when both are pending. Passive response items do not wake waits.
- Observe input without consuming it. Waits remain active after the original turn ends, support independent observers, and can be cancelled by dropping the future.

## Testing

Add coverage for pending and incoming input, agent-message classification, cancellation, independent observers, timeouts, and input arriving after the original turn completes or is interrupted.

GitOrigin-RevId: d0c0bd776c3b6fd4ba3021603d87eaaf1d93976f
This commit is contained in:
rhan-oai
2026-10-30 18:34:10 +00:00
committed by copyberry
parent 0e31c29e25
commit 6df44f08dd
7 changed files with 425 additions and 64 deletions
+1
View File
@@ -39,6 +39,7 @@ pub use codex_core::EnvironmentConfig;
pub use codex_core::EnvironmentMcpPolicy;
pub use codex_core::EnvironmentNetworkPolicy;
pub use codex_core::ForkSnapshot;
pub use codex_core::InputWaitOutcome;
pub use codex_core::LoadedAgentsMd;
pub use codex_core::McpManager;
pub use codex_core::NetworkDomainPermission;