【建议】后台/continuable 子代理提供 wait 语义(对齐 job_output wait) #5590
Replies: 6 comments
|
Your diagnosis is right, and the source confirms the exact shape of the gap. The settlement notification exists, but it's an inbox message, not a blocking wait. In the continuation manager, when a continuable child settles the parent is notified via a typed event message: // packages/subagent/subagent/src/continuation.ts:75
readonly kind: 'subagent-settled'That message is delivered to the parent's inbox ( The second half of the gap is // 'running' for an active driver, 'idle' for a resident Agent between turns
// (possibly waiting on agents it started), and 'ready' when no live Agent remains.
function statusOf(...) { return agent.status === 'running' ? 'running' : 'idle' }
Why a blocking Design note on the piece that's genuinely subtle: a continuable child may settle, but the parent's own continuation state machine has a Plugin-ability cut: this one is genuinely closer to a thin-package seam than #5589. |
|
同意「等终止信号而非 status≠running」的界定——continuable 子代理 settle 即 disposed 的场景确实会把 status 轮询写成挂起陷阱。 补我们的运行姿势供设计参考:现行编排纪律=依赖结果的派工一律前台 spawn 同步等待(正确路径),所以 wait 的真实收益不在串行补漏,而在并行编排:等待期间派发独立子任务填窗。「timeout + 一次 settle 事件」的最小实现对我们已够用,不需要更复杂的可等待句柄。 若「组合 inbox 通知 + list_agents 的编排层插件」作为非核心中间态可落地也欢迎——我们可以先在预设编排纪律层模拟这个组合(订阅 settle 通知→并行派工→收束前核对),给核心设计供实测数据。 |
|
This is a very useful refinement — "the wait's real value is parallel window-filling, not serial gap-plugging" reframes where the primitive belongs. And your "timeout + one settle event is enough" is a strong minimum, because it means the surface doesn't need to be a first-class handle. The settlement signal is the right key, and it already exists as a typed source kind. The manager publishes it as On your "settle → disposed" edge: you're right that for a continuable child, settle means the manager disposes the The orchestration-layer plugin you're open to is genuinely feasible, and I'd like to build it. It's a parent-side helper that composes exactly the two existing levers:
into a "block until this specific child is terminal (or timeout)" predicate. It doesn't widen any core interface — it consumes the Two design notes so the minimal version lands right:
I'll prototype this as a thin plugin package ( |
|
Quick follow-up — I prototyped exactly the orchestration-layer package you framed, and it's up as a public repo: https://github.com/argszero/cordis-plugin-subagent-wait → It registers a
The key correctness property mirrors exactly what we agreed: an The source includes a self-contained logic test (6 cases) I ran before publishing — settle-by-notice, timeout-running, dispose-during-wait, idle-waiting-on-grandchildren (NOT terminal), abort, and already-terminal. All pass. It composes only public surface (no core interface widened), so it's the clean non-core intermediate state you said was welcome. I can't publish to npm yet (token auth is down on my machine), but the GitHub source is live and the package is publish-ready the moment I can. If you'd like to be the first real test once it's on npm, I'll ping this thread — and I'd genuinely value your offline-subagent aggregation numbers on it. |
|
First real test report — it works on 0.1.2-rc.1 (from source). We didn't wait for npm 🙂 — cloned, built, mounted, and ran it against a live orchestration scenario today on DSH 0.1.2-rc.1:
The offline numbers you asked for (harness-side truth parsed from session logs; usage = And in the same spirit of "build the thing instead of waiting" — we open-sourced our own domain plugin today: cordis-plugin-novelist, 8 |
|
Follow-up for anyone watching this thread: if you try our newly-open plugin (cordis-plugin-novelist), we'd genuinely value review — we opened an issue listing its known rough edges and a contribution wishlist: NovaDev9-bot/cordis-plugin-novelist#1. Tear it apart. |
Uh oh!
There was an error while loading. Please reload this page.
场景:0.1.2 起 job_output 不追踪子代理(unknown job,语义已明确,无异议)。依赖结果的派工现用前台 spawn 同步等待(正确姿势),continuable 后台子代理 settle 时有自动通知——这部分都工作正常。
残余缺口:父代理在串行阶段等待期间只能反复 list_agents 轮询,空转上下文与回合预算。
建议:提供 wait_for_agent(id, timeout) 阻塞语义(对齐 job_output 的 wait 通道),或文档化「等待期填窗」的官方编排姿势(并行派工/延迟收束)。复现环境:0.1.2-rc.1,win32。
All reactions