Conversation
新增状态驱动的已配对网关识别与列表,并补齐 paired_device 的 bootstrap 配对流程与错误提示。
让首次配对直接触发测试,并在拿到 device token 后立即刷新状态与提示保存。
拆分已配对设备与首次配对流程,补充审批提示、device token 状态和可保存闭环。
区分连接成功与完成配对;未拿到 device token 时停留在配对步骤并补充引导。
loopback 地址下隐藏已配对设备与首次配对路径,保留 token/password 连接并提示改用局域网 IP 配对。
禁止 loopback 自动采纳 pairedReady,避免测试成功后清空 token 并在进入应用时触发 token required。
Profile 节点列表改为基于 realNodes 展示,未加载 agent 的会话节点也可见并可切换为 active。
配置页同步禁止 loopback 自动采纳 pairedReady,避免本地 token 连接被错误清空。
进化页选择其他节点时同步切换 active session,确保 loopback 节点也能显示对应 agents。
为会话实例增加身份校验,避免旧 reader 在同 session_id 重连后误删新连接,并保留 sessions 视图。
按 CI 日志收口 discovery 与 evolution 命令中的 clippy 违规,恢复 cargo clippy --lib -- -D warnings 通过。
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.
Why
这组提交不是单点修复,而是在收口同一条用户链路上的连续回归:
gateway not connected和 sessions 消失。本次 PR 的目标是把这些问题收口成一致、可解释、可验证的行为,而不是继续叠加局部补丁。
What Changed
1. Pairing / Setup / Config Flow
2. Loopback Policy And Token Safety
pairedReady,避免本地 token 连接在“进入应用 / 立即体验”链路里被错误清空。3. Multi-Session Node Visibility
realNodes展示,而不是只从 active session 的 agents 反推。4. Gateway Session Replacement Race
GatewayActiveConnection增加实例级instance_id。clear_session_for_id改为按session_id + instance_id双重匹配。gateway not connectedCommit Summary
3b89dfafix(config): 修复配对状态识别与首次配对引导8dcf88ffix(config): 完善首次配对保存闭环引导bb88216fix(config): 修复首次配对审批与保存流程5f2600ffix(setup): 修正首次配对误跳成功页66cf297fix(setup): 收口本机 loopback 配对入口e0ad712fix(setup): 修复 loopback token 进入应用回归30f3f19fix(profile): 修复多会话节点可见性a3863e8fix(config): 对齐 loopback token 回归修复bcbdc37fix(evolution): 修复节点切换未同步会话0e45cd6fix(gateway): 修复同端点保存竞态Validation
Frontend
npm run lintnpm run test -- src/app/components/setup/openClawPairingState.test.ts src/app/contexts/openClawConnectionPolicy.test.ts src/app/components/setup/openClawConfigSectionState.test.tsnpm run test -- src/app/components/views/evolutionTargetState.test.ts src/app/components/views/profileNodeState.test.tsnpm run test -- tests/i18nGovernance.test.tsRust / Gateway
cargo test gateway::state --manifest-path src-tauri/Cargo.toml -- --nocapturecargo test gateway::connector --manifest-path src-tauri/Cargo.toml -- --nocaptureReviewer Guide
建议按下面顺序看,评审成本最低:
src-tauri/src/gateway/state.rs+src-tauri/src/gateway/connector.rs先确认同 endpoint 保存竞态修复是否合理。
src/app/components/setup/*+src/app/contexts/openClawConnectionPolicy.ts看 pairing / loopback 行为是否一致。
src/app/components/views/ProfileView.tsx+src/app/components/views/EvolutionView.tsx看多 session 节点展示和切换是否对齐。
src/app/components/**/*State*.test.ts+tests/i18nGovernance.test.ts看状态 helper 与治理测试是否覆盖关键行为。
Checklist
Reviewer Focus
gateway侧确认:同一session_id被新连接替换后,旧 reader 不会再清掉新连接。setup/config侧确认:pairing 状态机没有继续把“连接成功”误当成“配对完成”。loopback policy侧确认:loopback 只保留 token/password 路径,不再暴露当前不可完成的 pairing UI。multi-session UI侧确认:Profile 与 Evolution 都以真实 session 节点为准,而不是只跟着 active session 的 agents 走。QA Scenarios
device token时,向导停留在当前步骤并给出下一步提示,不会误跳成功页。token流程测试成功后,进入应用 / 立即体验时不会再报Gateway Token is required。gateway not connected。Regression Guardrails
Notes
docs/PR/PR_dev_2026-04-17_16-06-33.md。