Skip to content

fix(dag): build DagSupervisionSweep in the server app graph - #358

Merged
LeXwDeX merged 2 commits into
devfrom
feat/341-issue341
Aug 19, 2026
Merged

fix(dag): build DagSupervisionSweep in the server app graph#358
LeXwDeX merged 2 commits into
devfrom
feat/341-issue341

Conversation

@LeXwDeX

Copy link
Copy Markdown
Owner

Closes#341

What

  • DagSupervisionSweep.node added to the server app group (server.ts). The desktop sidecar (packages/desktop/src/main/sidecar.ts) calls Server.listen without effectCmd — AppLayer never exists there, so the sweep (2026-08-18 orphaned-nodes incident response) never ran on the desktop default path. Every serving process builds the app graph once per listener, which now includes the sweep (fiber lives in the listener scope).
  • Deps (Database/DagStore/Dag/SessionPrompt nodes) resolve via the sweep node's own dependency list within the shared buildLayer cache.
  • serve/web also build AppLayer → a second sweep instance there; settle is convergent (withWorkflowLock + guardNode + conditional projector UPDATE per the sweep header's multi-host convergence notes), so the duplicate is safe and noted in the code comment.
  • New wiring probe regression test/server/httpapi-sweep-wiring.test.ts (presence + recorder replacement resolving through the app-graph output).

Verification

  • bun run typecheck green (packages/opencode)
  • bun test test/server/httpapi-sweep-wiring.test.ts 2/2
  • goalloop/memory wiring tests unaffected

Note: test/dag/dag-node-supervision.test.ts has 3 wall-clock-sensitive cases (5s budgets) that fail on this loaded local machine at f25f37d7e too (pre-dating this change, no runtime code between); CI (green at cb17d3ca) is the arbiter.

The host-level deadline supervision sweep was constructed only in AppLayer;
the desktop sidecar calls Server.listen without effectCmd, so AppLayer never
existed there and orphaned-node supervision never ran on the desktop default
path. Every serving process builds the server app graph once per listener —
listing the sweep node here covers serve/web/TUI/sidecar alike. Processes that
also build AppLayer get a second instance; settle is convergent (workflow
lock + guardNode + conditional projector UPDATE), so the duplicate is safe.
Closes#341
@LeXwDeX
LeXwDeX merged commit 224eea2 into devAug 19, 2026
6 checks passed
@LeXwDeX
LeXwDeX deleted the feat/341-issue341 branch August 19, 2026 03:43
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@LeXwDeX