Skip to content

perf: parallelize new-session model discovery - #527

Open
jonathanKingston wants to merge 1 commit into
agentclientprotocol:mainfrom
jonathanKingston:perf/parallel-session-model-discovery
Open

jonathanKingston wants to merge 1 commit into
agentclientprotocol:mainfrom
jonathanKingston:perf/parallel-session-model-discovery

Conversation

@jonathanKingston

Copy link
Copy Markdown

Summary

  • start model discovery while the new Codex thread is being created
  • keep skill refresh and session-config construction ahead of both requests
  • add a regression test that holds thread/start open and proves model/list is already in flight

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

  • npm run typecheck
  • npm run build
  • npm test: 700 passed, 26 skipped
  • focused CodexAcpClient suite: 106 passed
  • authenticated real-Codex smoke: completed an ACP turn with end_turn

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant