Repository navigation
fix: discover Codex account models and await desktop runtime readiness - #2134
Open
jerrydong1988 wants to merge 1 commit into
Open
jerrydong1988 wants to merge 1 commit into
jerrydong1988 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
ChatGPT 设备登录成功后,Octop 仍将模型列表与默认模型重置为固定的三个旧模型;手动获取列表又未适配 Codex 的查询参数和响应格式。Windows 桌面另有一个启动时序问题:已有后端立即通过健康检查时,导航可能早于 WebView2 初始化完成,导致窗口出现前退出。本 PR 将同一次本地修复中的两部分整理到当前
develop。Fixes #1992
Fixes #1156
模型初始化问题的前期诊断见 #1992 中的补充评论。连接探测也与 #1821 相关。
Changes
client_version,解析models[].slug,保留显示名称、服务端顺序、输入类型与上下文长度,过滤隐藏模型并去重。store=false和 system → instructions 的适配与实际对话一致;普通 OpenAI/models行为保持原样。WindowRuntimeReady事件启动后端连接,并以sync.Once防止导航后的重复启动。移除初始化前的拖拽覆盖层脚本调度,保留页面加载后的处理。WSAEADDRINUSE (10048)检测;移除桌面现有测试的重复err声明,以恢复 Windows Go 测试编译。Related open work
#2001 / #2013 已覆盖模型发现协议的一部分,未覆盖
codex_apply.py的固定列表、重新登录及默认模型重置。#1837 关注探测参数;这里直接复用 Harness 的实际适配器。#1518 使用相同的 WebView ready 启动方案;这里还移除了就绪前的覆盖层脚本调用,并包含端口识别修复和冷启动/对话/工具实测。这些是明确重叠的工作,不表示此前 PR 没有处理相关问题。维护者可按合并顺序选择保留已有 PR 的部分;本 PR 的新增覆盖范围是完整的登录初始化、配置保留和经过验证的本地端到端流程。
Reproduction
Codex models
openai-codex:列表固定为 GPT-5.4、GPT-5.4 mini、GPT-5.5;活动模型固定为gpt-5.4。client_version的 HTTP 400;仅补参数仍会因models[].slug与data[].id格式不同而失败。预期:以当前账号目录为准,同账号重新登录保留有效设置,失败时保留之前的数据并显示错误。
Windows desktop
http://127.0.0.1:8088/api/health立即返回成功,同时关闭桌面壳。OCTOP_DESKTOP_URL=http://127.0.0.1:8088隔离后端启动因素。SetURL → Navigate在初始化期间发生空指针的调试栈;普通日志中的Chrome_WidgetWin_0注销错误不被当作根因。预期:等待 WebView 就绪后导航;已有后端与无后端两种启动路径都可正常显示桌面。
Target branch
developmainType of change
Test plan
Current develop-based branch
基于
develop的e244ec15,使用独立开发环境(Windows、Python 3.12.9、octop-harness 1.0.4)。新增 26 个回归用例,使用临时 SQLite 数据库和 HTTP MockTransport,覆盖目录协议、普通 OpenAI 接口隔离、账号切换、同账号设置保留、目录失败时无写入,以及设备登录不阻塞事件循环。
定向运行模型、OAuth、连接探测、获取模型接口及 i18n 测试:142 passed(2 条依赖弃用警告)。
Windows 桌面:
go test ./...、go vet ./...、go build -mod=readonly -buildvcs=false均通过。Ruff 检查及格式检查通过;mypy 检查 596 个源文件通过。
完整
make all PYTEST_JOBS=4:4,797 passed, 222 skipped, 17 warnings,退出码 0。警告来自 ldap3 / pyasn1、lark_oapi 与 discord 的依赖弃用提示。正常执行仓库 pre-commit 钩子:
pytest --testmon -n 44,798 passed, 256 skipped, 17 warnings,随后tsc -b && vite build成功;钩子退出码 0。前端有大 chunk 体积提示。未跳过提交钩子。Authenticated local validation, 2026-10-17
以下实测来自本机已部署的 1.0.2b8 补丁版(Python 3.12.12、octop-harness 1.0.3、Windows 11 x64、Go 1.25.14 / Wails v3.0.0-beta.13),不将其冒充为当前 develop 全量源码的重新部署实测:
OCTOP_DESKTOP_OK_73;真实write_todos调用返回status=success,UI 显示“已完成 1/1”,最终回复OCTOP_DESKTOP_TOOL_OK_73。验证范围为短对话和工具闭环;未逐一测试全部模型的全部工具、长上下文、图像输入、令牌过期续期或 macOS/Linux 原生桌面。没有上传 OAuth 凭证、私有数据库、用户配置或原始私人会话。
Checklist
CHANGELOG.mdPrepared with AI assistance.