Skip to content

fix(desktop): restore local workspace after normal reopen - #6680

Open
loopx-agent wants to merge 2 commits into
mainfrom
codex/desktop-workspace-return-20261017
Open

loopx-agent wants to merge 2 commits into
mainfrom
codex/desktop-workspace-return-20261017

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Closing or quitting the desktop App currently loses the selected local Goal and Agent page. Every launch allocates a new loopback origin and opens Manager, so users must find the same work again. This change restores the last local reading position on the new App-owned origin with zero additional navigation.

The native lifecycle adapter saves only Goal/view/Agent/Todo identifiers. Missing or corrupt preferences keep startup usable; ambiguous queries, foreign pages, remote status sources and host-granted workspace contexts cannot replay foreign selections against local authority. Returning to Manager clears dependent selection. Explicit runtime repair, live WebContent recovery and Vite navigation retain their existing behavior. The frontend still owns routing; this private presentation preference grants no task, session or execution authority.

Validation:

  • Merge baseline da7d0b9979d2e7a2651cdc95230de70549278bfb; only four desktop paths changed. cargo fmt --check, library tests (123 passed, 4 existing artifact-dependent checks ignored), clippy with warnings denied and a release native build passed.
  • A separately identified macOS QA package with the real backend passed normal Quit/reopen, window-close and corrupt-preference recovery/self-heal. It returned to the same Goal/Agent on fresh ports; Session IDs remained stable and no new accepted Chat Turn appeared. The owner approved this launch destination before commit.
  • That native walkthrough used the same lifecycle/handoff code before the final duplicate-query rejection. The latter is covered by the final URL-negative regressions; the ordinary captured route is unchanged. The existing native WebContent fault regression also restored its original route with no write requests.
  • The synthetic reopen query is now built with structured query pairs. Its exact ASCII runtime URL and all persistence-exclusion assertions are preserved; production code is unchanged by this review repair. The unchanged native public-boundary scan failed on the previous construction and now passes over all four proposal paths. Full Rust tests, fmt, clippy and release build were rerun successfully.
  • Existing browser CI failures were compared against the merge baseline: runs 38952925211 (base) and 38956144952 (previous proposal head) both fail at the same research-history 503 assertion and configuration-backup revision-visibility wait. Browser harness, Dashboard, Python backend and workflow sources are identical between those revisions. These inherited failures are not waived; final-head required CI and independent review still apply.
  • Semantic inventory and vocabulary smoke passed. The advisory does not analyze Rust; view values remain a private compatibility mirror of the frontend router, and the preference version is local. Candidate/public-boundary scans and git diff --check passed.

Official App installation/update adoption, Windows/Linux native UI and sustained production blank-window diagnosis remain unqualified. This proposal fixes ordinary return navigation; it does not close the broader runtime acceptance. The related refactor separates one-time launch position from explicit repair and in-process recovery within the existing handoff. No frontend/Lark/CLI control or configuration switch is added. Private native screenshots and logs remain local.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent; model=gpt-6.1-sol; provider=OpenAI; runtime_reported; reasoning_effort=max

Request changes conclusion (author-owned PR; GitHub blocks formal self-review)

评审 6680@e43c7605446284d31f09034989f4a986319cc99d;完整基线 da7d0b9979d2e7a2651cdc95230de70549278bfb。结论 REQUEST_CHANGES:运行时检查通过,但新增测试使当前原生公开扫描失败;这不是已发现的真实凭据泄露。

动机

关闭 App 后重新回到同一 Goal 和 Agent 页面阅读工作的桌面用户。

原来每次进程重开都会分配新端口并回到管家,用户必须重新找 Goal 和 Agent;本头在新本地端口恢复上次阅读位置,显式修复与进程内故障恢复仍沿各自原路径。

当前 Rust123项、release构建与原生WebContent恢复通过;已有独立QA包的正常Quit、关窗及坏偏好自愈证据经源码失效检查后可有界复用,但本头公开扫描因新测试URL的合成凭据形态报错,不能把必需验证写成全绿。

不自动恢复执行、不提交消息、不改变runtime选择/Goal权威或新增IPC;不认证正式安装、跨平台或历史白屏根因与长期稳定性。

改动思路

阅读位置沿用前端router的选择合同,原生Rust只处理退出/启动与本地文件IO;在现有handoff中分开一次启动落点、显式修复根页和进程内恢复,避免新增会话或控制面owner。

本PR交付普通App重开的有界导航修复;正式安装/更新、跨平台和持续故障资格保持原验收,公开扫描红灯须在本提案修复。

触发 现有或当前行为
普通关闭/重开 保存语义选择,在新本地端口返回;零额外导航/确认
显式 runtime repair 清除一次启动落点,沿原根页重连
WebContent 丢失 沿原进程内当前 SPA 路由重试,不提交工作
坏偏好/remote来源 保持启动可用或回管家,不回放外国来源的Goal

这是源码推导的分支说明,执行证据见下文。无需一个新会话管理器、页面IPC或第二个控制面owner。

具体改动

完整四路径 +389/-5 已读。规格在 diff 前读取:docs/development/design.md,修订 da7d0b9979d2e7a2651cdc95230de70549278bfb,以及原 Desktop README、frontend-delivery 和当前路线。Preserve existing product behavior and public/private boundaries、Earn The User's Attention、Whole user journey and recovery 的导航/权限部分已验证;当前发布扫描失败另列,不以测试数替代它。

关键代码讲解

  • LocalWorkspace::capture 只接受精确本地 origin和/chat/,结构化拒绝userinfo和重复query;remote status或host工作区回管家。只保留Goal/view/Agent/Todo,前端router继续拥有选择语义。
  • launch_destination 在新App端口重建本地URL;读取有4096字节上限、版本/ID校验,坏值直接fallback。write使用同目录临时文件、sync与原子替换,关闭时失败只记录固定错误。
  • WorkspaceHandoff::services_ready 只消费一次launch选择;reconnect仍清除它,既有content-loss路径保留当前SPA。lib.rs在main关窗及App退出读实际WebView,没有URL轮询或执行IPC扩权。

独立当前验证:123 passed、0 failed、4 ignored;同不可变基线 117 passed、同4 ignored,忽略项的完整身份与签名包/私有安装器/APFS/HFS前提一致,未伪称已跑。cargo fmt --check、cargo clippy --lib -- -D warnings、release构建、advisory之后完整semantic smoke和diff hygiene通过。Rust不在advisory分析范围;四个view是现有router的局部兼容镜像,version1仅属私有偏好。

实际原生 webcontent_recovery 以独立隐藏/incognito WebView与合成本地服务执行,恢复原SPA URL/body,non_get_requests=0。普通Quit/关窗/坏偏好自愈沿用已有独立QA包与真实backend证据:当前lib、handoff和Cargo.lock与那次构建摘要完全一致,后续唯一运行差异是重复query拒绝;完整差异已读,正常唯一query输入仍由当前测试覆盖。保存/自愈偏好只含5个规定字段,四次读回的11个Session身份及空active_turn_id一致。此处是有失效检查的证据复用,没有重跑最终query加固后的整套GUI,也没有声称正式App安装生效。

[P2] 修复新增合成URL使原生公开检查失败的问题

workspace_location.rs:214 的确定性测试把合成token赋值与后续query拼在一个字符串。对本PR全部四路径运行既有 loopx check --scan-path ...,实际返回exit1:public_boundary_violation / workspace_location.rs:214: credential。原扫描器把后续query也计入值的长度,故命中凭据形态;源码和断言表明这是合成fixture,不是实际账户凭据。但当前“公开边界检查通过”的验证声明不能覆盖这条原生命令的失败。

将这个确定性的测试URL用结构化query-pair构造,保留完全相同的输入、敏感字段排除断言和覆盖;重跑原四路径loopx check及完整Rust测试,不修改扫描规则、缩小扫描路径或豁免该测试。 这样保留了真正要防的字段持久化反例,而不改公共边界owner或把红灯改标绿。合成输入的语义安全与原生验证是否通过是两个事实;本次以这个小修复作为批准前的剩余项。

对主干的风险

运行风险主要是把foreign来源或旧修复落点回放到本地,以及退出IO破坏启动。当前完整测试覆盖foreign/boot/nonworkspace/userinfo/duplicate、remote状态、host上下文、Manager清空、非法/过时/超限偏好、写失败、自愈及一次启动/显式修复分离;既有native故障恢复也已实际运行。runtime选择、service端点、权限命令和frontend owner不变。新私有选择是不可从新端口推导的阅读意图,没有保存raw URL、prompt、report session、凭据或执行状态。

没有更改或放宽任何扫描、测试断言、超时或门槛,公开扫描的当前失败完整保留。四项ignored安装/产物检查不属于这次导航修改的通过项;正式升级、跨平台、长期运行、原生产白屏因果均保持未验。本轮未查询、轮询、等待或调度CI,未操作正式App、其他Agent或活跃Goal。

我的整体评价

REQUEST_CHANGES,仅剩上面的原生公开验证修复;problem_context=not_yet_proven 不否认已验证的导航改善。long_horizon=preserved、user_experience=improved:阅读位置恢复不回放工作,坏偏好保留正常启动和自愈路径。

阅读位置沿用前端router的选择合同,原生Rust只处理退出/启动与本地文件IO;在现有handoff中分开一次启动落点、显式修复根页和进程内恢复,避免新增会话或控制面owner。

本PR交付普通App重开的有界导航修复;正式安装/更新、跨平台和持续故障资格保持原验收,公开扫描红灯须在本提案修复。

future-facing pass 已在既有handoff内形成有界的三种导航职责,没有引入通用框架或重复配置。新词汇保持local_only/reuse_existing;不需要用户为普通阅读新增授权轮次。修复后按新完整head复核,本COMMENTED不授予merge/admin、旧review处置或安装权限。

English verdict: REQUEST_CHANGES - e43c7605446284d31f09034989f4a986319cc99d; current Rust, release and native recovery checks pass, and reused normal-close QA has explicit source/delta qualification. The new synthetic URL still fails the unchanged four-path native public-boundary check. Preserve the exact regression input/assertions while repairing its construction; no actual credential leak or installed/cross-platform qualification is claimed.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent; model=gpt-6.1-sol; provider=OpenAI; runtime_reported; reasoning_effort=max

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

完整评审 6680@6df7d25a2e6f9ca3025034b2691a49923344a81a,基线 da7d0b9979d2e7a2651cdc95230de70549278bfb。APPROVE;旧合成URL扫描阻塞已在新头以相同输入修复。合并资格仍另有过期质量receipt门,未称gate通过。

动机

关闭 App 后要回到同一 Goal 和 Agent 页面继续阅读的桌面用户。

原来进程重开会分配新端口并回到管家,用户要重新寻找 Goal 和 Agent;本头在新本地端口恢复上次阅读位置,显式修复和进程内故障恢复仍走原路径。

新头在原四路径公开扫描中通过,Rust和release构建通过;正常退出、关窗与坏偏好恢复沿用经源码失效检查的既有独立打包验证。测试输入完整运行时URL与旧头逐字节相同,敏感字段排除断言没有删减。

只恢复阅读位置,不恢复执行、不提交消息、不扩充IPC或Goal权限;正式安装、跨平台和持续白屏诊断仍未资格化。

正式App安装采用、Windows/Linux和持续运行仍由既有桌面交付owner继续;本次不把本地候选验证当作已安装行为。

改动思路

前端router继续拥有选择语义,原生Rust只适配进程生命周期和本地文件IO;在既有handoff内区分一次启动落点、显式修复根页与进程内恢复,避免另造会话或控制面owner。

本PR交付普通重开的有界导航修复;测试构造修复已在同一提案内完成,安装采用、跨平台和长期故障资格仍保留原验收。

触发 结果
普通关闭/重开 保存语义选择,在新本地端口返回;零额外导航/确认
显式runtime repair 清除一次启动落点,沿既有根页重连
WebContent丢失 仍恢复进程内当前路由,不提交工作
坏偏好/remote来源 启动保持可用或回管家,不回放外国来源的Goal

此表说明本头源码分支,执行证据另列。原生adapter适配退出与文件IO,不是另一个TS/Python控制面决策源;阅读选择是跨端口后无法从现有权威状态重算的用户意图,保存它有实际价值。

具体改动

全四路径 +400/−5 已读。diff前核对design.md及完整原Desktop README/frontend-delivery;现行接受文本与此前完整读取的字节一致。Preserve existing product behavior and public/private boundaries:来源/权限隔离已实现;Earn The User's Attention:普通重开免重复找Goal/Agent已实现;Whole user journey and recovery:复用经失效检查的实际打包退出/恢复读回,安装与跨平台边界明确保留。没有新增首屏视觉内容;原正常启动落点批准不因测试构造修复重新索取。

关键代码讲解

  • LocalWorkspace::capture按完整origin、/chat/及结构化query校验;userinfo/重复参数拒绝,remote status和host工作区返回Manager。只保留Goal/view/Agent/Todo,四个view与现有frontend router的精确集合一致。
  • launch_destination在新App端口重建URL。读4096字节上限与private version1,坏/缺/过时值fallback;write同目录临时文件sync后原子替换,保存失败只输出固定诊断。
  • WorkspaceHandoff::services_ready一次消费启动选择,reconnect仍清空到根页;main关窗和App退出读取实际WebView,未加URL轮询或执行IPC。
  • ordinary_reopen_keeps_selection...只把输入改为query-pair构造。用同一实际Rust URL库独立比较,完整ASCII URL 171字节及全部query pairs完全相等;secret、旧端口、prompt、report、token、http的持久化排除断言及其后的全部测试字节未动。

独立当前验证:cargo test --lib 123 passed/0 failed/4 ignored,不可变基线 117 passed/相同4 ignored;fmt、clippy -D warnings、release build、advisory后完整semantic及diff hygiene通过。Rust不在advisory分析范围,局部view镜像与private version另经人工核对。

对实际旧e43和新6df工作树执行相同四路径source-checkout loopx check:旧头在214行报合成fixture的credential形态并exit1,新头全部通过。扫描器、扫描路径、输入与排除断言未放宽;旧失败保留,不是实际账户凭据泄露。

先前独立QA包与真实backend的正常Quit、关窗、坏偏好自愈证据可有界复用:当前lib、handoff、Cargo.lock与前次审查一致;本次e43→6df在cfg(test)外逐字节相同,原先重复query拒绝的差异也仍单独保留。保存/自愈只含5个规定字段,四次读回的11个Session身份及空active_turn_id相同。既有hidden/incognito WebContent回归的真实HTTP与零write请求仍为历史执行证据,没有重跑整套GUI或冒称正式安装采用。

对主干的风险

主要风险仍是foreign来源或旧修复落点误回放,以及退出IO影响下次启动。当前完整测试覆盖foreign/boot/nonworkspace/userinfo/duplicate、remote/host上下文、Manager清空、非法/过时/超限偏好、写失败及一次启动/显式修复分离;改动不触碰runtime选择、服务端点、权限命令或前端owner。

这是一项明确披露的普通导航默认变化,没有default-off开关。缺失/坏偏好保留原启动路径,Vite、显式修复和进程内恢复仍各走原owner;没有把可用性、安装或原生导航当作Agent执行授权。公开README同步解释了新默认、停用边界和未验收部分。

原生standard premerge的 3direct+19selected执行检查零direct/run失败;但整体仍返回 quality_stale_receipt,质量receipt失败计1、merge_gate_passed=false。这不是合并gate通过,也未补造或豁免作者receipt。四个签名包/私有安装器/APFS/HFS产物前提忽略项与基线完全相同,不计为已执行通过。本轮未查询、轮询、等待或触发远程CI,未合并、安装或操作活跃Goal。

我的整体评价

APPROVE,problem_context=justified_increment。 新头修复了此前唯一公开扫描阻塞并保留完整反例,普通阅读返回有明确收益;long_horizon=preserved、user_experience=improved。此前APP/RC轨迹不自动采用,本次重新核了完整范围、真实调用点、源码失效条件和当前验证。

前端router继续拥有选择语义,原生Rust只适配进程生命周期和本地文件IO;在既有handoff内区分一次启动落点、显式修复根页与进程内恢复,避免另造会话或控制面owner。

本PR交付普通重开的有界导航修复;测试构造修复已在同一提案内完成,安装采用、跨平台和长期故障资格仍保留原验收。

future-facing pass 已由既有handoff的一次启动/显式修复/进程内恢复分离完成;相邻边界无需再造通用持久化框架。词汇为reuse_existing/local_only,不引入共享权限模型。剩余正式安装与持续/跨平台验收由现有桌面交付owner继续;另保留当前过期质量receipt合并门。本COMMENTED只记录代码结论,不授予merge/admin、旧review处置或安装权限。

English verdict: APPROVE - 6df7d25; full four-path review,123 native tests, immutable-base117 parity, fmt/clippy/release/semantic checks pass. The original scanner failure is reproduced at e43 and resolved with exactly identical171-byte runtime input and all exclusion assertions. Prior packaged/native QA is explicitly source-qualified; stale quality receipt, installation, cross-platform and sustained qualification remain separate.

This branch has not been deployed

No deployments
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