perf: short-circuit model list via bridge (−34s startup)#1304
Open
lennney wants to merge 1 commit into
Open
Conversation
fe18ecf to
236cac8
Compare
Intercept list-models-for-host calls in the renderer inject script and return model names from the Codex++ bridge (<1ms) instead of waiting for the app-server RPC (~34s). Inspired by PR BigPizzaV3#620 by @congxb.
236cac8 to
ae721e0
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
该 PR 在 Codex 渲染器的注入脚本中拦截 list-models-for-host 请求:当 Codex++ bridge 已能提供模型目录时,直接用 bridge 的模型名构造返回值,从而跳过首次启动时耗时很长的 app-server RPC 往返(PR 描述中约 34s),以显著降低启动阶段模型列表可用的等待时间。
Changes:
- 在
client.sendRequest的补丁中对list-models-for-host增加短路逻辑:优先从/codex-model-catalog加载/读取模型名并立即返回 - 当 bridge 模型名不可用时保持原行为:回退到原始
sendRequest(app-server RPC)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Intercept
list-models-for-hostcalls in the renderer inject script and return model names from the Codex++ bridge (<1ms) instead of waiting for the app-server RPC (~34s).Inspired by PR #620 by @congxb.
How it works
list-models-for-host, intercept and check bridgepatchAppServerModelResult— skip the full app-server roundtripVerification