Prewarm code-mode host connections at session startup (#40678)

## What changed

- Add the opt-in `code_mode_prewarm` feature to establish the code-mode host session during startup, before the first turn.
- Make in-progress host initialization cancellable so a stalled prewarm does not block shutdown.
- Share a failed connection attempt with concurrent callers instead of immediately starting another attempt.

## Testing

- Verify app-server contacts the configured host before the first turn and can shut down while that connection is stalled.
- Exercise shared remote-host behavior with prewarming enabled.

GitOrigin-RevId: 3cfde5509be7b4aba80112c36c5616b9a9b632c6
This commit is contained in:
Vivian Fang authored and copyberry committed 2026-08-25 19:16:45 +00:00
1 parent 17c4c47dfa
commit 4b24638e1c
6 files changed
+105 -14

No files matched your search

+6
View File
@@ -628,6 +628,9 @@
"code_mode_only": {
"type": "boolean"
},
"code_mode_prewarm": {
"type": "boolean"
},
"codex_git_commit": {
"type": "boolean"
},
@@ -5640,6 +5643,9 @@
"code_mode_only": {
"type": "boolean"
},
"code_mode_prewarm": {
"type": "boolean"
},
"codex_git_commit": {
"type": "boolean"
},