Repository navigation
Description
Problem
packages/runtime contains a second, independently-written drive-to-quiescence scheduling loop that production never runs:
runAgentGraphToQuiescence+ its helpers (observeGraph,dispatchIntent,orderedRunnableIntents,graphResult, …) instream-graph-dispatch.tsare called only by tests; the live loop isreconcileAgentGraphScheduleinstream-graph-schedule-reconcile.ts, and the two already drift (limit_reachedvsgraph_closed/agent_topology_required).resolvePoliciesis provided only in tests, so production readiness snapshots are always empty; the host protocol even validates apolicyKindvalue that can never occur.- The
stream-graph-trace.tssnapshot builder (~390 lines) is kept alive only by the readiness path.
This is a synchronized parallel path: two scheduling state machines that must agree by discipline and are already diverging. Scope boundary: the map/all_settled readiness primitives are NOT in scope — the Desktop topology view (#2596) depends on the read model's readiness, so they must stay.
Desired outcome
One Agent Graph scheduling authority: reconcileAgentGraphSchedule only. Remove the test-only second loop, the dead readiness wiring, the never-produced policyKind protocol validation, and the trace cascade, while keeping the readiness primitives and their client surface intact.
Alternatives or workarounds
Keep the second loop and its tests; it is already drifting from what runs.
Acceptance
-
runAgentGraphToQuiescenceand its production-unreachable helpers are removed -
resolvePolicies/ policyKind wiring reduced to what the live readiness surface needs -
stream-graph-trace.tstrimmed or removed where only the dead path used it - Host protocol
agent-graph.tsno longer validates an unproduciblepolicyKind - Readiness primitives (
map/all_settled) retained and pinned by the feat(desktop): add an operational topology view for Agent Graph #2596 consumer - Focused runtime tests, typecheck, and Biome pass
Related
- feat(desktop): add an operational topology view for Agent Graph #2596 (topology view depends on readiness)
- Graph trace reconstruction: expose a replayable control/data-plane timeline #1529 (replayable control/data-plane timeline — out of scope)
Activity
1625567290 commentedon Aug 16, 2026
I'm working on this. I'll remove the test-only
runAgentGraphToQuiescenceloop and its helpers soreconcileAgentGraphScheduleis the only Agent Graph scheduling authority. The unusedresolvePolicieshook goes with it.map/all_settledreadiness primitives andstream-graph-tracestay for the live snapshot / Desktop topology surface (#2596).Grok is assisting with the implementation; I will review the change and remain the human contributor of record.
简体中文对照
我来处理。删除仅测试路径使用的
runAgentGraphToQuiescence及其辅助函数,让reconcileAgentGraphSchedule成为唯一调度权威。一并去掉生产从未接入的resolvePolicies。map/all_settled就绪原语和stream-graph-trace保留,供 live snapshot 与 Desktop topology(#2596)使用。Grok 协助实现;我会审阅改动,并作为 human contributor of record。
refactor(runtime): drop the client-unreachable readiness policyKind
refactor(runtime): remove the dead Agent Graph drive loop (apache#3104)