Repository navigation
fix(workspace): isolate runtime research selections and relative read-only entry - #6823
Conversation
…ocal Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.1-sol · OpenAI · runtime_reported · reasoning_effort=max
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机
查看已有运行记录的用户,需要在同一工作区切换两个物理来源,即使它们使用同一个 Goal 和节点编号,也不能把一个来源的选择带到另一个来源。
原先从相对状态入口打开运行记录,会被当作普通本地来源;选择一个研究节点后切换来源,同名节点还会被误当成同一项。当前提交保留只读来源身份,切换后清除来源内选择,返回时恢复原来源的选择。
独立基线复现了两种错误;当前正常打包版本通过相对入口、同名节点隔离、返回、重载和 390px 断开后恢复。加载失败时研究图被撤下,不再把旧历史继续显示为成功读取。
本次只修复已有阅读入口的身份和选择隔离;不新增来源权限、执行研究、分析包或安装后的完整产品验收。
窄屏关闭导航时,来源错误文字仍只在隐藏侧栏;这是 #6821 已记录的既有缺口,本次没有修复。恢复后仍能读到原来源;既有产品工作继续负责明显的失败与重试反馈、真实分析绑定和整体验收。
改动思路
复用现有来源目录和 URL 选择状态,在来源识别与成功切换的交界处修复;不新增持久状态、研究图 owner 或执行入口。
这是一项可独立回退的来源隔离修复;既有错误可见性缺口继续保留,不能据此宣称整个容器阅读旅程完成。
已知来源由 Agent 准备,用户仍只需打开现有工作区、选择来源;没有新增需要用户查找编号、复制上下文或再次确认的准备工作。物理来源是阅读上下文的一部分,相同 Goal 和节点名称不能代替来源身份。查询参数继续归现有路由管理,成功切换才失效;浏览器 Back 保存的旧 URL 则保留旧来源自己的选择。
下面的对照是源码和实际浏览结果的说明,不替代执行证据:
| 场景 | 基线 | 当前提交 |
|---|---|---|
| 相对状态入口 | 误识别为本地 | 匹配已有只读 runtime |
| 同编号节点后切换 | 继续带入 route0 | 清除来源内选择 |
| 返回原来源 | 旧 URL 仍存在 | 原来源 route0 恢复 |
| 当前来源读取失败 | 留旧历史 | 撤下研究历史;既有错误可见性仍待补齐 |
具体改动
完整八路径 +27/-8,包括三个生产 TS/TSX 位置、现有目录断言、现有打包浏览场景、两张合成截图和两行开发说明。独立验收依据是不可变基线 55d6337485d4924f1cbb8b41e51a8c02687c332a 的 docs/architecture/rfcs/goal-workspace-surface-v0.md,而非本 PR 新写的说明。
- 5.11/V11:来源内选择、刷新和返回。现有路由保存选择,成功切换的来源变化清掉研究节点、分组及分析选择;Back 恢复旧来源 URL。
- 2/V9:读取不增加执行权限。相对入口仅匹配已有 runtime 来源,目录不存在时仍走普通本地路径;SSH 仍只读。
- V12:未绑定分析仍不可用,不能借用另一来源的包。
- 7/V6:明显的失败与重试反馈仍是既有 #6821 的未完成项;当前有安全的历史撤下和恢复增量,没有把这一项写成已完成。
关键代码讲解
statusSourceForUrl 先把 URL 解析到同一 origin,再在既有 runtime 目录中匹配;只有匹配成功才替代原来的 relative-local 回退。它不创建来源,不把普通本地或 SSH 变成另一种执行端。
commitLoadedStatus 在既有请求 fence 下提交成功来源,只在 runtime 来源变化时清掉六个来源内查询参数;同一 URL 重载不增加重复导航。原来的 workAgent 规则和浏览器历史保留。
GoalWorkspacePanels 只把成功读取的 runtime URL 传给历史组件。loading/error 时只读页不会退回本地研究历史,也不继续呈现上次成功的 92/92。
对主干的风险
我独立构建了当前 head 的正常 Chat 包和真实基线 55d6337485d4924f1cbb8b41e51a8c02687c332a 的包。同一现有浏览场景服务真实 RuntimeWorkspaceServer HTTP、使用合成记录:当前通过相对入口、两个同 Goal 来源各自 92 条记录与两条关系、同名节点切换、Back/forward、重载、503 后重试和 390px 无横向溢出。实际基线在相对入口断言出现 0≠1;把起始地址改成绝对地址单独隔离第二项缺陷,又出现切换后 route0≠null。两项独立反例均在当前提交通过,不能只靠目录单测代替路由证据。
现有 catalog smoke 和原本的 local/SSH packaged browser 通过,覆盖无 runtime 目录、无关 URL、重复/不安全目录、存储中伪造 writable 等相反方向。另用 Ego 浏览器核验切换、Back 恢复原节点、重载、390px、减少动态效果和真实 HTTP 断开/恢复;当前断开确实撤下研究图,恢复后读回 Fresh 的 92/92。
也保留限制:关闭窄屏导航时,错误文字仍在 0×0 的隐藏侧栏,主视图缺少明确的失败解释。这是既有 #6821 已公布的问题,不是本补丁新引入的回归;本次修复不据此被扩大为整条容器阅读或分析旅程验收。原生容器读取、事件转换、历史 HTTP 和历史组件与此前实测精确 head 逐字节相同,旧的权限/无副作用证据只在这四个未改 owner 上复用;当前 UI 使用了正常新包和新的实际 HTTP 验证,未声称本轮再运行 Docker 或安装 App。
正常构建包含 TS 类型检查;标准 premerge 四项直接检查和 19 项选中检查全部通过,无 manual hold。自动风险分类只选到文档/公开边界,所以上述 dashboard 构建、目录和两个打包浏览测试另外运行。没有查询、轮询或等待 CI,也没有继承旧 head 的 green。该改动不需要新抽象或迁移,保留现有 typed owner 是本次同域、可回退的改进。
我的整体评价
APPROVE,精确 head ab565cc6b16b764906af1540bcc992824bfe5f66;本次差异没有新增阻塞发现。来源身份和选择隔离的两个实际故障已被独立基线反例与当前正例覆盖,改动位置和规模合适。批准限定于这个完整的小修复,#6821 的明显错误反馈、原有分析绑定和整体产品验收继续保留;发布评审也不等于合并授权或 merge readiness 已满足。
English verdict: APPROVE — ab565cc. Exact-base counterfactuals reproduce relative-runtime misclassification and same-node focus leaking across physical sources; the normal current bundle, real HTTP reader, existing local/SSH browser and independent Ego checks pass. The existing narrow sidebar-only error visibility gap remains with #6821; this approval does not qualify the whole reader/analysis journey or authorize merge/install.
Switching prepared runtime readers could carry a question or analysis-pack selection into another physical source when the Goal and node ids coincide. Clear those source-local selections on a successful runtime switch, retain the previous URL for Back, and withhold history during pending/failed source reads. A relative same-origin entry now recognizes the prepared read-only source instead of labeling it interactive local state. Local/SSH sources retain their defaults.
This follows merged #6821 and contains only the post-merge correction, based on current main. The fixed counterexample selects
route0in one source and switches to another with the same Goal/node ids; Back restores the original selection. The packaged real-HTTP scenario also covers relative entry, complete history, explicit edges, failure/retry and mobile. Final build/source-witness verification, source-catalog smoke and legacy packaged SSH/local switching passed on this main baseline. No model or benchmark execution, merge or installation was performed.Required CI/exact-head qualification remains separate. Earlier required Core/Ruff failures belong to the parent proposal's validation record; they are not silently treated as passes on this newer main baseline. Full required checks must qualify this head.
Visual evidence
Packaged UI, synthetic native records; not an installed App. Current main's source tree plus this correction was rebuilt and browser-tested at
ab565cc6b16b764906af1540bcc992824bfe5f66. The source-local-selection behavior has an executable browser counterexample; actual private runtime screenshots are excluded.