mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
Reduce TUI stack usage during session transitions (#44176)
## Why Session transitions need stack headroom to rebuild configuration and the chat widget. Tokio stores task outputs inline even when it boxes the task future, so returning a large `Config` adds stack pressure during task allocation. ## What changed Box the configuration build result inside the runtime worker and unbox it after joining. Box the `App::run` future to keep the large event loop out of enclosing startup futures. ## Testing Extend the production-stack TUI integration test to enter `/side`, verify the process remains running, and return to the saved conversation with Ctrl+C. GitOrigin-RevId: 44975300bb837bf3645ff762cf7bcdc44a277f41
This commit is contained in:
1 parent
0df1daf526
commit
c77c34ed33
3 files changed
+15
-5
No files matched your search
@@ -1811,7 +1811,9 @@ async fn run_ratatui_app(
|
||||
Ok(StartupHooksReviewOutcome::OpenHooksBrowser(data)) => Some(data),
|
||||
};
|
||||
|
||||
let app_result = App::run(
|
||||
// Keep the large event-loop future out of the enclosing startup futures so session
|
||||
// transitions have enough stack headroom to rebuild configuration and the chat widget.
|
||||
let app_result = Box::pin(App::run(
|
||||
&mut tui,
|
||||
app_server,
|
||||
config,
|
||||
@@ -1834,7 +1836,7 @@ async fn run_ratatui_app(
|
||||
startup_hooks_browser,
|
||||
startup_draft,
|
||||
managed_worktree,
|
||||
)
|
||||
))
|
||||
.await;
|
||||
|
||||
terminal_restore_guard.restore_silently();
|
||||
|
||||
Reference in new issue
Block a user