fix(steward): find registered owners beyond delivery grants - #5041
Conversation
Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
cf2b8be to
b3e6248
Compare
huangruiteng
left a comment
There was a problem hiding this comment.
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机
管家曾把有限进度快照或委派名单当成 Agent 全目录,导致真实负责人被回答为“没找到”。本 PR 处理的是职责发现和缺口诊断,使主人可以在已授权范围内找到完整注册目录;它是路由旅程中可独立验收的一段,实际接单与回传仍由后续切片证明。
改动思路
复用既有 registry、注册/profile、Goal 激活及当前受众权限。agents 只是一种读取视图,先在允许范围内搜索,再分页;委派权限与执行就绪分别显示。Chat 沿原动态工具读取,CLI/SSH 共用同一投影,原 handoff owner 和权限检查不变。相比提高 prompt 截断上限或新建目录,这一边界更准确且成本更小。
具体改动
- 新的
agent_page在完整允许目录中搜索声明职责,返回来源版本、分页、已停止历史选项及不可用缺口;ContextDelivery将已有委派授权与未知执行状态分开。 ManagerInspection.read在读前读后核实当前受众范围,主人可浏览本机完整登记,Goal Chat 和外部群聊仍按精确 Goal 约束。prepare_turn_context提供新鲜 scope/authority;管家和项目上下文版本刷新工具提示,原逻辑会话保留。goal-portfolio与 SSH 导出新增相同查询;测试覆盖 35 个 Agent、旧 8/24 条上限之外的负责人、分页、停用历史、撤权、来源异常和远端参数转义。README 与中英 RFC 只把它记为发现切片。
关键代码讲解
agent_page 读取注册源并以来源哈希标明分页所依据的版本,登记不等于在线;ManagerInspection.read 执行当前受众过滤和撤权复查,避免群聊看到主人的私有身份;prepare_turn_context 把这些判断装进现有 Chat 工具;export_page 让 CLI 和 SSH 共享同一个结果形状。四处均不授予委派或启动 worker。
对主干的风险
最重要的反例是外部受众从同一 registry 读到主人私有 Agent,或把 not_granted 误判成“没 Agent”。精确受众、读后撤权检查、空/坏来源的未知状态以及 future registration 测试覆盖了这条路径。137 项相关测试、Ruff、文档检查和新基线质量凭据通过;风险选择的合并前检查 19/19 通过,无失败或跳过。未运行 live model、真实接单或跨主机旧版 CLI 升级验收。
我的整体评价
长期协作与用户体验在“找负责人”阶段有明确改善,原有读取和效果权限保持分离,没有阻塞发现。变更大小与频繁误报“找不到”的问题相称,也没有复制权威状态。残余限制是模型是否真的选择合适负责人、接收方是否工作并把结果送回原对话;这些仍属于 A24/R2/R3 的真实验收。
English verdict: APPROVE - exact head b3e62482711c2e9da543faa92784c18e46ef2949; registered-owner discovery respects audience scope and preserves delivery authority; 137 tests passed, live dispatch/return remains open.
Goal And Delivered Outcome
A steward could overlook a registered responsible Agent because its initial progress snapshot included only a few workers and its context-delivery list was mistaken for the discovery inventory. Add a searchable, paginated
agentsview to the existing manager/project Chat read tool and CLI/SSH evidence exporter. Search covers the permitted registry before paging; owner-local scope is broad by default while project and external-audience boundaries remain intact.Rows separate declared responsibility, registration, context-delivery permission and execution readiness (
not_checked). A worker outside the delivery list is discoverable with an explicit permission gap; stopped identities remain available for historical queries. New upstream context versions install the guidance without removing logical conversations. No grants, worker launches or second registry are introduced.Scope And Continuation
This delivers the discovery/diagnosis slice of A24 and the P0 routing direction in #5038. Worker selection, live execution, receiver adoption and original-conversation return still need end-to-end qualification through the existing handoff owner. Prompt-only adapters lack the interactive tool; remote discovery requires the updated remote CLI. These limits are documented in the capability and bilingual RFC checkpoint.
Future-facing pass: one registry read model serves Chat and CLI/SSH; reuse registration/profile and activation helpers, exact audience grants, dynamic tools and evidence events. Avoid collecting full progress/quotas merely to find identities. No authority-store refactor.
Validation
cf2b8be7faec665ef932dc04285fb88766867ab1cqr_a49ea685161e75beedf3; fingerprinta49ea685161e75beedf3143abe41e979e48bd9701002ef1a5b0d3a948a5c05db; 13 files, safe-fix allowed/not applied, zero blockers/warnings/advisoriesFrontend / Visual Evidence
No visual changes or regenerated frontend assets: frontend and Lark Codex conversations use the same existing dynamic read tool through
prepare_turn_context; production Chat tool installation/readback is exercised by the subprocess test. No new button or settings control is needed for this read-only API. Browser rendering and live Lark transport were not requalified.