perf: parallelize new-session model discovery - #527
Open
jonathanKingston wants to merge 1 commit into
Open
jonathanKingston wants to merge 1 commit into
jonathanKingston wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why
Neither result depends on the other, but newSession previously awaited thread/start before issuing model/list. Codex may refresh its model catalog in both requests, so slow or timing-out network refreshes were paid serially on the ACP session startup path.
In a real Codex 0.154.0 process inside Copse's production macOS sandbox, session/new took 6.33s and 6.53s with the serial requests. Running the same two requests concurrently reduced the measured session/new time to 3.18s. This removes roughly one refresh timeout without changing the returned session or model catalog.
Validation