Repository navigation
fix(collaboration): surface unfinished delegation requests every Turn - #6751
Conversation
… Turn Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…ut boundaries Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
Reviewer: actor_kind=model_agent; model=gpt-6.1-sol; provider=OpenAI; reasoning_effort=max; declaration_source=runtime_reported.
精确审查:6751@a0b866897198feadfb4401d67fbf536251695da3;实际合并基点 83faa5bd9f7667ae104943feacdc1536a3d57f74。独立代码结论为 APPROVE;merge readiness 和合并授权分别核验。
动机
已接收任务或已请求同伴协助的 Agent,需要在后续轮次继续处理原请求,并把结论送回原来的对话。 以前轮次入口主要给收件箱读取指针,结论一经保存还会离开 pending.items;已读或已采纳的义务、等待的同伴结果以及尚未送达的回答容易失去可见性。新议程从既有凭据列出这些未完成步骤,仍要求读取完整原请求。 真实 CLI 和轮次钩子验证了跨两轮保留已采纳请求、排队结论等待原路送达、同伴后续更新逐份消费,以及损坏消费凭据保持未知;议程读取没有改写任何请求、结论或消费文件。 这只完成受 LoopX 管理的轮次上下文交付;不唤醒或领取任务,不授予执行、发布或独立验收权限,也不证明整个协作目标、模型采纳或已安装产品已经完成。
改动思路
TypeScript 只投影既有请求、结论、送达与消费事实,Python 只做精确作用域的本地读取;复用既有所有者可避免另建需要同步的承诺账本。 本 PR 的完整边界是:把未结束的原请求义务送入现有 managed Turn 和 Inbox 读路径,保留完整读取、原路送达及独立消费的既有责任。 只强化提示指针不能覆盖已离开 pending 的结论和发出的协作;另建账本会复制事实。现有前端/Lark仍使用原请求卡片与原路返回,没有需要本人配置的新功能或重复确认。
| 真实触发 | 当前 head 的可观察结果 |
|---|---|
| 已读/已采纳且未答复 | 后续轮次继续可见;不因关联 Todo 已完成而消失 |
| 已保存但未送达的结论 | 等待原路送达;不会自动再执行工作 |
| 同伴新结果或损坏凭据 | 分别要求显式消费或恢复证据,不能当成已完成 |
表格只概括本头源码和下述实际执行边界,不代表模型理解或整体 Goal 验收。
具体改动
独立规格依据是 loopx/capabilities/manager_context/README.md,不可变版本 83faa5bd9f7667ae104943feacdc1536a3d57f74。A delegation returns automatically:Receiver assessment/work and original-conversation return are distinct; published/queued answers are not delivered.;Semantic delegation and peer review:The same-Goal requester explicitly consumes each peer result; reading is not consumption or independent acceptance.。本 PR 新增说明用于披露改变,不用来代替这些既有约束。
新增信息只含目的摘录、请求身份、当前版本、已有 Todo 关联和待完成凭据步骤;不含来源对话、结论正文或接收方私有理由。请求数不是不同任务数,同一 Todo 可以服务多份请求。120 字目的摘录、20 行和10KiB显示上限不会改变原请求,漏显条数与扫描不完整仍明确可见。
接收、采纳、实际工作、结论保存、原路送达、请求方消费和独立验收继续分开。新版本只接纳同版本回答;取消后未释放的发布保留仍需对账。新增步骤是 TS 读模型建议,不是持久化任务生命周期。返回状态读取下沉到共享 inbox,旧 roundtrip 导入继续可用;消费身份只保留一个实际实现。
关键代码讲解
- turn_start_hook:Private context reader is separate from content-free hook receipts; full read remains required.
- read_delegation_turn_context:Reads only exact receiving/sending folders, current revision and existing result/consumption evidence.
- item:Projects the next receipt step; cancellation, old answers, unknown sources and consumption stay distinct.
- projectDelegationTurnContext:Bounds visible rows without treating omissions or failed coverage as an empty queue.
- projectInteractionWorkContext partial-read branch:Supplied partial agenda cannot discharge the complete Inbox read.
对主干的风险
未发现阻塞问题。最危险的是把已保存回答、一次读取、关联 Todo 完成或显示上限当成义务结束。独立 CLI/hook 对照覆盖原对话只返回一次、先读后消费、后续更新逐份消费、非法消费身份和不同 Agent 不披露;每次议程观察前后所有请求/结果 JSON 字节不变。已有真实 File/SQLite TurnEnvelope 测试还验证完成 Todo 不代替回答、跨两轮仍有完整 Inbox 读取要求;版本更正、取消和保留未释放、26请求显示20条也有覆盖。
本轮验证:177 Python tests passed,3 Windows-only skips;36 TypeScript tests and full control-plane typecheck passed; independent4-case CLI/hook oracle: base1pass3fail → head4pass; standard premerge6 direct+10 catalog+8 risk+1 boundary checks passed. Initial reviewer suite named a nonexistent test_capability_hooks.py; no tests ran. The corrected actual control_plane/test_turn_start_capability_hooks.py suite passed. Three baseline independent failures specifically show absence of inline agenda, while empty-inbox parity passes. No assertions or budgets were relaxed. Windows-only path regressions were not run on macOS. No fresh installed App, arbitrary unmanaged host Turn, live model adoption, long-run latency or scientific utility qualification. Existing frontend/Lark paths have no changed screen; no new execution/provider/store authority. No CI consulted and no merge authorized. 当前3个跳过是 Win32 extended-path/binary/workspace 回归,保留平台限制;标准语义目录检查与公开边界检查均通过。
我的整体评价
APPROVE:当前有界目标达到,long_horizon 与 user_experience 均 improved。跨轮次保留承诺并把结论送回原渠道,比增加人工催问或另开任务更符合原请求;议程本身不证明工作完成,完整读取和独立采纳仍由接收方负责。 TypeScript 只投影既有请求、结论、送达与消费事实,Python 只做精确作用域的本地读取;复用既有所有者可避免另建需要同步的承诺账本。 本 PR 的完整边界是:把未结束的原请求义务送入现有 managed Turn 和 Inbox 读路径,保留完整读取、原路送达及独立消费的既有责任。 已检查并采用同一边界内的共享规则收敛,没有需要在本 PR 扩大的通用框架。没有执行合并、部署或正式运行时升级;没有查询、轮询或等待 CI。
English verdict: APPROVE. The real CLI/Turn-hook paths retain adopted, undelivered and unconsumed request obligations without mutating receipts or granting effects. Revision, cancellation, privacy, overflow and partial-read boundaries are preserved; installed/live-model adoption remains unqualified.
Managed Agents currently receive an Inbox read pointer rather than a visible list of outstanding commitments. A published conclusion also leaves
pending.itemsbefore original-route delivery completes. This makes already-read/adopted requests, sent consultations and undelivered answers easy to miss across Turns.Add a private unfinished-request agenda to the existing manager-context Turn-start hook and
manager-inbox read. It names the current request, receiver/source Agent, purpose excerpt, explicit Todo links and the remaining receipt step. Counts are requests, not distinct tasks: several follow-ups may belong to the same Todo.Contract and presentation evidence
work_context; the full Inbox read remains required.This is a private Agent-context/read-model change. Existing frontend/Lark request cards and return interactions stay on their current owners; there is no changed first viewport or new screen. Presentation evidence is the actual CLI/TurnEnvelope readback exercised with synthetic File/SQLite stores, including two consecutive Turns and the existing frontend request-control HTTP path. Host Turns that bypass LoopX's Turn-start path are outside this integration.
The agenda is bounded to 20 complete rows and 10 KiB of row content, with counts and a full read route. It does not inline transcripts, result bodies or receiver rationale;
read_complete=falseprevents the summary from fulfilling a full source read. It does not wake Agents, claim work, change priority, publish results or grant effects. Request receipt closeout does not certify completion of the broader linked task or Goal.Ownership and refactoring
TypeScript owns the continuation projection; Python only observes the existing filesystem/provider records. Reuse the existing exact Goal-instance, request revision, result identity and consumption contracts. Share return-delivery readback below the capability adapter while retaining its old import surface, and reuse peer consumption identity checks. Existing delivery vocabularies move with that reader unchanged; the new steps are read-model advice rather than a persisted task lifecycle. This advances the S1/S3 commitment-preservation boundary without claiming the complete manager/handoff acceptance.
Validation
Source-checkout validation only: no installed-App adoption, paid model execution, new benchmark run or merge is claimed. Populated Turn envelopes can still exceed the existing diagnostic prompt budget; the bounded agenda preserves obligations and does not change that budget. Private runtime readback is excluded from this PR.