refactor: inject code mode runtime into codex sessions

Extract a CodeModeRuntime trait from codex-code-mode and make the core code-mode wrapper hold an injected runtime instead of constructing the native implementation inline. Thread an optional runtime override through Codex spawn/session startup and expose a ThreadManager entrypoint that can start a thread with a caller-provided runtime. Re-export the runtime trait from codex-core so downstream browser harness code can consume the seam without reaching into transitive dependencies.
This commit is contained in:
Jeremy Lewi
2026-04-13 09:40:19 -07:00
parent fa5d14a81f
commit 3ffd99cd3d
8 changed files with 99 additions and 7 deletions
+1
View File
@@ -93,6 +93,7 @@ pub(crate) async fn run_codex_thread_interactive(
inherited_shell_snapshot: None,
user_shell_override: None,
inherited_exec_policy: Some(Arc::clone(&parent_session.services.exec_policy)),
code_mode_runtime: None,
parent_trace: None,
})
.await?;