Skip to content

fix(collaboration): report busy native lanes before handoff - #7019

Open
loopx-agent wants to merge 1 commit into
mainfrom
codex/delegation-lane-preflight-20261022
Open

loopx-agent wants to merge 1 commit into
mainfrom
codex/delegation-lane-preflight-20261022

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

A delegation preview could report runtime_unverified and turn_eligible=true while the recipient already held its native Turn lane. Chat could consequently submit an unnecessary worker; unreadable or foreign-host holder records were also absent from this readiness decision.

The existing delegation preflight now consumes the lock owner's read-only lane observation. A live holder returns turn_blocked / turn_lane_in_flight; an unknown holder returns turn_lane_state_unknown. Chat retains the saved Inbox request and refuses submission until a later successful check. The team status component explains the observed condition and recovery in English and Chinese.

This observation describes the native Turn lane. Released, dead or absent holders establish no App-conversation presence. The executing Turn retains its existing single-flight fence for races after inspection. Direct execution, source-grant authority, operation identity, acceptance and settlement owners are unchanged. No background retry or ordinary Inbox activation without a bound Todo is added. Related recovery and source-grant proposals #7015 and #7016 remain separate; this PR targets current main directly.

Validation:

  • Immutable base 3e166772 reproduces the busy-lane readiness error on both real File and SQLite authority.
  • 12 final File/SQLite focused cases pass: actual CLI busy/unknown readback, no holder/state/Host mutation, another member's lane, occupation during preview, and saved original request processing after release. The real fixture worker invokes its Host once and returns once through a synthetic original-conversation transport. 80 adjacent regression cases also passed.
  • Noneditable wheel: all 12 focused cases pass; 329 loaded product modules resolve inside that wheel with zero source-checkout escapes. Fixture Host and return transport are synthetic; this does not qualify live models, installed App/Lark or general idle wake.
  • TypeScript: 5,179 passed / 73 conditional skips; strict control-plane typecheck, production component smoke, frontend build, Ruff, public-boundary scan and bilingual RFC gate pass. The frontend build retains its existing large-chunk warning.
  • Mypy import-closure check remains failed: 5,065 errors and 156 notes on both immutable base and final source. All complete diagnostic rows, order and multiplicity match after 99 exact unchanged-line/enclosing-symbol offsets. No diagnostics were discarded. CQR retains this as attributed existing type debt; required CI and independent review remain separate.
  • Exact-head native premerge: 6 direct checks and 18 selected smokes pass; its required public-boundary check fails because all four PNG captures are decoded as UTF-8 text (invalid UTF-8). There are zero reported privacy hits; manual visual inspection remains separate from this required gate. Final CQR records this required failure and integration stays held. This scoped PR does not change or bypass the scanner.

Bounded scope: one IO fact extends the current TypeScript decision and existing status component. Existing native lock liveness values and preflight states are reused; no parallel authority, new capability, scheduler or activation framework is needed. Ordinary unbound Inbox activation, automatic busy-queue continuation and the installed original-message-to-result journey remain open work.

Visual evidence — tested source 56b945183fa1a857383e6bb8cb20942cfa69d5f4. These are the exact production status components and packaged stylesheet rendered with synthetic fixtures backed by actual File/native-lane observations. The surrounding preview is labeled; it is not an installed App acceptance claim. Both languages were checked. No live data or private operating context is shown.

Desktop before Desktop after
Before desktop After desktop
390 px before 390 px after
Before narrow After narrow

中文:修复既有委派预检遗漏原生执行占用的问题。忙碌和状态未知会明确阻止 Chat 提交新 worker,原交接保留;当前执行结束或状态读回恢复后可重新检查。真实 File/SQLite 与非 editable wheel 覆盖原请求接续和一次回传,合成宿主/传输、普通无 Todo 唤醒及安装态验收边界保持。以上失败与未测项不会被局部通过覆盖。

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; declaration_source=runtime_reported; reasoning_effort=max

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

代码结论:APPROVE。精确 head 56b9451,不可变基线 3e16677。没有阻断代码批准的发现;必需 public-boundary 扫描仍失败,合并资格保持 hold。本评审未合并。

动机

在管家中将既有工作交给 Agent、并需要确认它是否可启动的使用者。旧版在接收方已占用执行通道时仍报告可尝试启动,导致一次不必要的 worker 提交;新版先显示忙碌或状态未知并保留原交接,通道释放后才重新检查。

真实 File/SQLite 已验证忙碌时不提交 worker、不改 holder 或原任务;释放后沿同一请求执行、验收并只回传一次。本次不证明 App 会话空闲,不实现无绑定任务的通用唤醒、后台重试、安装态 App/Lark 或真实模型收益。

改动思路

Python 只从既有原生锁 owner 读取事实,现有 TypeScript delegationPreflight 决定预检状态;Chat 复用原 dispatch,实际 Turn 继续持有启动竞争的单执行者锁。完整边界是既有绑定交接的忙碌/未知预检与可理解恢复提示;不另建会话活跃度、调度器、权限或任务账本。

不改动会留下已复现的普通用户问题;只改文案或 catalog 不能补足实际入口。引入第二套活跃度/完成状态会增加同步成本,现有 owner 足以解决本次边界。新增事实来自已有原生状态,UI 不从 prose、注册或计数推断执行/成果,也不要求用户重复输入已有身份。

触发 当前行为 最终 owner
执行通道忙碌/未知 拒绝新提交,保留请求并提示恢复 既有锁观测与预检
通道已释放 重新检查原请求,真实 Turn 仍裁决竞争 原 Turn/验收/回传

此表是源码说明,执行证据由实际实路用例提供。

具体改动

关键代码讲解

  • Delegations.inspect:在最后一次绑定/验收读回后,传入原生通道观测;不取得或释放该锁。

  • delegationPreflight:只允许 released/dead/absent 继续原准入;live 与未知状态阻止提交,保留独立验收和效果事实。

  • DelegationPreflightStatus:用中英文解释忙碌、未知与恢复,避免把执行通道说成任务权限或 App 在场证明。

已完整检查运行时、前端 data/schema 与挂载条件、文档、测试/夹具和全部公开视觉资产。新增 schema/字段复用已有状态词汇;不增加 capability、配置、scheduler、authority store 或状态迁移。Python 边界是 Host/IO 适配,业务状态仍由既有 TypeScript owner 判断。

验收依据为 docs/reference/local-delegation.md ,spec_revision 3e16677;同时按该基线 manager-context 的原请求、读取范围及独立回传条款核对。以下标识定位原有条款,不是新增验收门:

  • check-a-binding-before-new-work:implemented。检查绑定必须只读,不启动 Host、修改任务或花费额度。实际验证见上述入口、反例和读回。
  • acceptance-and-return:implemented。执行、独立验收和原请求回传分别成立,不能互相替代。实际验证见上述入口、反例和读回。
  • disconnect-and-recovery:implemented。保留原操作/输入的身份和恢复边界,不通过替代任务绕开拒绝。实际验证见上述入口、反例和读回。

167 项相关 Python、26 项 TS、严格控制面 typecheck、生产组件 smoke 和 Chat 构建通过;noneditable wheel 的 12 项 File/SQLite 用例通过,329 个实际产品模块零源码逃逸,额外两个真实 Host 证实加载该 wheel。不可变基线相同两个忙碌用例均返回 runtime_unverified 而失败;当前 head 通过。168 组纯 owner 对照中,96 组除新增通道观测外完整相同,72 组仅改变忙碌/未知的资格、状态、理由或说明;验收、执行器与效果全组相同。

已在 Ego 中检查中英生产状态组件与真实隔离通道读回,390px 无横向溢出,并检查 PR 的桌面/窄屏前后截图。组件演示外壳是合成预览,不能视作安装态完整团队旅程。

对主干的风险

观测与启动之间仍可能竞争;新观测不是执行许可,实际 Turn 的现有锁仍作最终裁决。撤权 worker 的另一恢复缺口归 #7016,不能据本 PR 宣称已修复。

语义与 CI 对齐

可选的两入口 mypy import closure 仍为 5,065 errors/588 files;同一不可变基线与 head 的完整诊断、顺序、列与说明,在仅映射字节相同的源码行后全等。未查询、轮询或等待 GitHub CI。

标准 native premerge 的 6 项直接检查和 18 项 catalog/risk 检查通过,required public-boundary 仍因 PNG 被当作 UTF-8 文本读取而失败。将相同 PNG 字节交给不可变基线和本 head 的同一扫描函数,完整 boundary 失败对象全等,均为 invalid UTF-8、零 privacy hits;扫描器/reader 在 PR 中未变。此对照将问题归到已有扫描器的输入处理,未将失败重标为通过。截图另经视觉检查;这不能替代必需 gate,修复/资格恢复仍归扫描器 owner。

原来源、scope、replay、独立验收和已有停止语义继续适用;未产生新模型、消息、claim、quota 或生产权限。只读元数据与实际执行分开记账,已有未完成工作不能据本 PR 关闭。

我的整体评价

当前整个 PR 在接受的边界内达到目标,架构采用 retain/proportionate:复用原 owner 比新增同步账本更便于验证、维护和回滚。long_horizon=improved 指已验证的原请求可持续跟进/减少无效交接,user_experience=improved 指可理解状态与原文读回;都不代表模型长期效果或完整成本的因果收益。

默认关闭/范围外行为和共享消费者已按上述对照核对,未发现意外权限或调度变化。本次不证明 App 会话空闲,不实现无绑定任务的通用唤醒、后台重试、安装态 App/Lark 或真实模型收益。当前必需扫描失败和安装边界保留;代码批准不授予 merge/bypass 或安装权限。后续 head 改变必须重新核对,不能继承本结论。

English verdict: APPROVE — 56b9451. Busy/unknown native lanes now refuse duplicate submission while preserving same-request recovery and once-only return; 167 Python and 12 installed-package cases passed. The required PNG boundary gate remains failed; no merge was performed.

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