Extract floating-panel shared runtime services - #2008
Open
0xTotoroX wants to merge 2 commits into
Open
Conversation
0xTotoroX
force-pushed
the
codex/stepwise-floating-panel-pr4-runtime
branch
from
August 26, 2026 19:08
1d1edd8 to
8395d7c
Compare
0xTotoroX
marked this pull request as ready for review
August 26, 2026 19:32
0xTotoroX
force-pushed
the
codex/stepwise-floating-panel-pr4-runtime
branch
from
August 29, 2026 14:00
8395d7c to
869e6da
Compare
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.
背景与目标
悬浮窗的页面运行能力同时服务 Stepwise 和 Answer Outline。此前这些能力仍集中在单一注入核心中,回答上下文识别、页面 Bridge 调用、DOM 文本处理、运行生命周期和设置同步彼此交织,后续功能改动容易扩大审查范围。
本 PR 将共享运行能力按职责归位到
assets/inject/floating-panel/runtime/,为后续 Stepwise 与 Answer Outline 功能拆分提供稳定的共享边界。它只整理共享运行时源码和源码契约,不新增用户可见功能,也不引入新的 CDP Bridge、模型请求链或页面注入入口。变更内容
runtime/state.js:集中运行时状态、持久化适配、功能开关、运行代际和基础边界原语。runtime/answer-context.js:统一当前用户问题、最新助手回答、回答身份、虚拟化消息和 Composer/消息 DOM 识别。runtime/bridge-client.js:复用现有页面 Bridge,提供单一轻量调用包装和超时保护。runtime/dom.js:提供自有悬浮窗过滤、文本提取和通用 DOM 文本辅助。runtime/lifecycle.js:集中扫描调度、MutationObserver、启动/停止和运行代际清理契约。runtime/settings.js:集中设置同步、启动、销毁和 HTML 转义边界。floating_panel_runtime.rs:验证上述片段的职责契约,并明确 runtime 不创建第二套 WebSocket/CDP Bridge。行为边界
assets.rs的生产 bundle 组合,因此当前页面注入行为保持不变。import()、目录扫描、网络资源加载或第二个悬浮窗实例。bridge.rs负责 CDP 连接和 Binding;Rust 侧仍由既有stepwise.rs负责模型请求和协议适配。验证
cargo test -p codex-plus-core --test floating_panel_runtime --test floating_panel_appearance --test floating_panel_core_shell --test cdp_bridge:116项通过。cargo check -p codex-plus-core:通过。node --check:通过。2258044)逐字节一致,SHA-256 已核对。git diff --check:通过。upstream/maincommit7385664。提交说明
f68a6ee:共享 runtime 源码片段。8395d7c:runtime 源码契约测试,包含 Windows CRLF 兼容。这两个提交分别对应生产源码与测试覆盖,便于单独审查和回退。