Skip to content

feat: 完善用户脚本热重载与启动自查 - #1730

Open
130040167 wants to merge 2 commits into
BigPizzaV3:mainfrom
130040167:codex/user-script-reload-v2
Open

feat: 完善用户脚本热重载与启动自查#1730
130040167 wants to merge 2 commits into
BigPizzaV3:mainfrom
130040167:codex/user-script-reload-v2

Conversation

@130040167

@130040167 130040167 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

更新内容

  • 将用户脚本自动热重载改为事件驱动,安装、启用、禁用或删除脚本后立即刷新当前 Codex 页面。
  • 在管理工具的脚本市场中增加手动“热重载”按钮,方便脚本开发调试。
  • reload 前发送 cleanup 事件并重建脚本运行时注册表,禁用或删除脚本后可以清理旧状态。
  • bridge 注入完成后执行一次有限启动自查;发现启用脚本未注册时自动补载,避免偶发启动漏加载。
  • 修复调试端口同时包含 Codex 主页面和管理工具时,CDP 目标可能选错的问题。

启动自查策略

  • 启动后最多检查 3 次。
  • 只有脚本注册表不存在或缺少应启用脚本时才 reload。
  • 脚本已经执行但自身报错时不会重复运行。
  • renderer target 或脚本配置变化后,旧自查任务会自动退出。

验证

  • cargo fmt --check
  • cargo test -p codex-plus-core --test bridge_routes
  • cargo test -p codex-plus-core --test cdp_bridge
  • cargo test -p codex-plus-manager --test windows_subsystem
  • cargo test -p codex-plus-launcher --no-run
  • npm run check
  • npm test
  • npm run vite:build

本地实际启动验证中,启动自查在第 1 次检查通过,bridge 与 helper 状态正常。

@130040167
130040167 force-pushed the codex/user-script-reload-v2 branch from cd1a5b1 to 2dc9368 Compare July 31, 2026 16:04
@130040167
130040167 force-pushed the codex/user-script-reload-v2 branch from 2dc9368 to 1092422 Compare July 31, 2026 17:15
@130040167
130040167 force-pushed the codex/user-script-reload-v2 branch from 1092422 to 71ee237 Compare July 31, 2026 17:26
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