Repository navigation
Description
体感上就是有个子代理在review的时候发现了问题,有时候会到主代理自动修复问题,有时候就卡在那了,必须要用户发句话他才开始修复问题,然后回答用户刚才的问题。
会话详情如下: Standards 轴发现了一项 callback CSP 硬性问题:此前的 'self' 会授权任意同源脚本在携带 SMW 回调 Token 的文档内运行。
已修复并提交:
- b030114 fix(identity): pin callback application integrity
修复措施:
- callback application script 现在具有构建后自动注入的 SHA-256 integrity。
- callback CSP 移除 script-src 'self',只允许:
- 已哈希的内联 callback bootstrap;
- 已哈希的 identity-app.js 构建产物。
- Nginx 的两条 callback location 规则、Playwright 静态服务器和部署产物校验器共同验证这两个精确 hash。
- callback 加载完成后通过仅一次性的 DOM event 将 accessToken 交给 mountIdentityApp(accessToken);没有 URL、Storage 或
全局属性 handoff。 - 保留构建时 fail-fast:缺少 integrity placeholder 会直接使构建失败。
已通过:
- npm run lint
- npm run test:browser(11 passed)
- node scripts/verify-identity-artifacts.mjs
- node scripts/verify-ci-workflow.mjs
等待最终 Spec 轴报告,以便给出最终双轴聚合结论。
■ subagent sa-5 · final-rereview-spec · finished
Spec
(a) Missing / partial requirements
-
mountIdentityApp does not enforce the required thin in-memory handoff.
vue/src/main.ts:24 declares mountIdentityApp(accessToken: string | null = null) and the normal entry calls
mountIdentityApp() at line 34. This permits mounting the application without a session and makes the token optional.
ADR 0011 requires: “最小入口以 mountIdentityApp(accessToken) 接收内存薄会话”; it also says login completion should
enter the sole minimal protected entry. The API should require an access token for the protected mount, with
unauthenticated login UI handled separately if needed. -
The retained UI foundation is only partially demonstrated.
The final Vue source retains Vite/Vue/TypeScript/Tailwind/Element Plus and two generic primitives, but
@element-plus/icons-vue is merely retained as a dependency and no icons or broader reusable foundation components are
used. ADR 0017 requires retaining “图标、视觉样式、设计 token、布局原语和无业务语义通用组件”. This may be acceptable
as a minimal slice, but the diff does not establish retention beyond the reduced UiPage, UiPanel, and custom CSS token
set.
(b) Scope creep
- None found. The final state does not reintroduce Pinia, Axios, routing, menus, permissions, Portal, local account
flows, user center, or template business pages.
(c) Implemented-but-wrong behavior
- The optional/default-null mount behavior above is also functionally wrong: direct normal startup mounts an
unauthenticated app rather than requiring the exact mountIdentityApp(accessToken) memory-session boundary. The Bearer
API boundary itself is otherwise correctly implemented in vue/src/api/identity.ts; no SMW token persistence or
non-Bearer access-token transport was found.
(This result is already shown to the user. Act on it and relay only the decisions or next steps — do not repeat it
verbatim.)
✳ Worked for 5m23s
Tool output: expanded
Activity
miwaiwai commentedon Aug 21, 2026
应重点检查:
tt-a1i commentedon Aug 21, 2026
已复现并定位:这是平台无关的丢唤醒,不是 Windows 专属故障;Windows 只可能因任务/IO 耗时不同扩大竞态窗口。
确定性事件序列:
onSettled()把结果放进 pending Map,isIdle()为 false,不能立即唤醒。agent_settled;当前代码固定flushResults(false)。false映射为{ deliverAs: "nextTurn" }。nextTurn只会在下一次用户 prompt 时从_pendingNextTurnMessages取出,不会主动开始模型 turn。这与 README /
subagent_spawn工具说明的「完成后自动回传并重新唤醒主 Agent」契约直接矛盾。Windows 审计:OpenPI 子代理是同一 Node 进程内的 Pi Session,不是 OS child process;该投递路径没有
process.platform分支,也没有 session 文件 watcher。Windows 影响的 shell/worktree 行为可能改变子任务完成时刻,但不会改变上述投递逻辑。正在做的修复不是 sleep:建立双边无丢唤醒协议——child-settled 时若父已 idle 就立即 flush;否则保留到 parent
agent_settled,在父已 idle 的边上再 flush,并始终用followUp + triggerTurn。pending Map 的 drain 是 one-shot gate,多个 busy 期间完成的 reviewer 合并为一次父 turn,subagent_wait仍可在 flush 前消费。已新增纯状态机回归测试覆盖:idle 立即唤醒、busy→parent settled、两结果批量、wait consume、不重复投递。当前本地全量 743 + 29 tests 通过,
bun run check退出 0;还在做并发复审与 delivery failure/reentrancy 检查。fix(subagents): busy 期间完成的结果也会自动唤醒父 Agent (openpi-dev#48)