mirror of
https://github.com/openai/codex.git
synced 2026-10-31 19:28:49 +00:00
Separate local agent runtime state from controller handles (#47301)
## What changed Extract `LocalAgentRuntime` from `LocalAgentControl` to hold the shared registry, residency state, execution limiter, rollout budget, service tier, instruction provider, and thread-manager bindings. Keep session identity on the controller handle. Store the runtime in `SessionServices` and use it to bind controllers for child startup, resume, delegation, and guardian reviews. Route ownership checks and residency handling through the shared runtime, preserving registry identity across handles. Update existing test fixtures to keep the controller and runtime paired. GitOrigin-RevId: 846094657cbdf736da3149f0a1c96b4e01423dfe
This commit is contained in:
@@ -1091,7 +1091,11 @@ impl ThreadManager {
|
||||
options.internal_parent = Some(InternalSessionParent {
|
||||
thread_id: parent_thread_id,
|
||||
auth_manager: Arc::clone(&parent.session.services.auth_manager),
|
||||
agent_control: parent.session.services.agent_control.clone(),
|
||||
agent_control: parent
|
||||
.session
|
||||
.services
|
||||
.local_agent_runtime
|
||||
.control(parent.session.session_id()),
|
||||
originator: parent.config_snapshot().await.originator,
|
||||
inherited_instructions,
|
||||
});
|
||||
@@ -1234,7 +1238,11 @@ impl ThreadManager {
|
||||
))
|
||||
})?;
|
||||
let config = parent.session.get_config().await.as_ref().clone();
|
||||
let agent_control = parent.session.services.agent_control.clone();
|
||||
let agent_control = parent
|
||||
.session
|
||||
.services
|
||||
.local_agent_runtime
|
||||
.control(parent.session.session_id());
|
||||
agent_control
|
||||
.ensure_v2_agent_loaded(config, child_thread_id, Some(parent))
|
||||
.await
|
||||
@@ -1695,7 +1703,7 @@ impl ThreadManagerState {
|
||||
thread
|
||||
.session
|
||||
.services
|
||||
.agent_control
|
||||
.local_agent_runtime
|
||||
.pin_v2_residency(self, &thread)
|
||||
.await?
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user