Repository navigation
feat(agent): refresh node definitions after an agent restart - #20903
Conversation
A local agent could edit a workflow, report it accurately, and leave the canvas untouched. Three independent defects, any one of which alone breaks it. 1. The follower's transport is ComfyUI's same-origin socket, which carries agent document frames only because INGEST relays them there. A standalone agent has no ingest and that socket carries nothing from it, so the follower listened forever to a wire that could never deliver. 2. Nothing ever named the workflow. The agent fans document frames out on a workflow-scoped channel and joins that channel only for the ids in the connection's query string, so even the right socket would have received chat and nothing else. 3. The panel seeded the draft from the canvas on every message with NO version, which the backend documents as "authoritative" and applies unconditionally. Combined with (1) and (2) that is silent data loss: the canvas never caught up, so each message overwrote whatever the agent had just built, and the agent's next read honestly reported the old graph — which is how this looked like the agent lying about its own work. When a document is live it IS the source of truth and the draft is only its projection, so the fix is to send nothing rather than to send it versioned. The new standalone transport keeps the frame vocabulary DocFrameClient already speaks and swaps only the addressing: `doc_subscribe` becomes the agent's resync call whose answer is re-emitted as the frames the client expects, `doc_ops` becomes its ops call, and inbound frames come off the agent's own socket. IT OWNS A SEPARATE SOCKET FROM THE CHAT STREAM, and that is not incidental. A connection's workflow subscription is fixed at connect time, so following a workflow means reconnecting — and the workflow binds partway through the first turn. An earlier revision of this change followed on the CHAT socket, which tore it down at exactly that moment and dropped every progress frame published while it re-established: the panel went from showing partial progress to showing none at all. Reconnecting the document socket instead costs nothing, because the follower resubscribes and catches up through resync. Verified against a real standalone agent over its own HTTP surface, both halves at once: progress frames (thinking, two tool calls, completion) arrive on a chat socket that is still OPEN when the turn ends, while `doc_update` seq=2 arrives on the document socket. Verified negatively too — a connection naming no workflow receives zero document frames for the identical turn. Deliberately NOT paired with a backend guard. The obvious one — refusing an unversioned seed — would reject every turn the currently shipped panel sends, turning silent data loss into a total outage. It should land after clients stop depending on the unversioned path.
The standalone agent now speaks the same document protocol on its event socket that ingest speaks on the cloud's /ws, so the panel keeps one shape for both targets: - The doc transport rides the chat stream's socket and forwards frames verbatim, exactly as the cloud transport rides ComfyUI's socket. The second per-workflow socket, its reconnects, and the HTTP translation are gone — following a workflow is a frame, so the chat stream never reconnects mid-turn. - Canvas ops are stamped with the identity the agent reports (GET /api/agent/identity), which is the actor its writer accepts. - The turn-context decision is extracted (turnContextFor): standalone has no ingest workflow list, so an unbound saved tab is sent tab-only and adopts the workflow the agent mints for it by the turn's own tab, the same way a temporary tab always has. This replaces the binding-repair watch, which bound to whatever tab was active when the ack landed. - The unversioned canvas re-seed is skipped while a document is live for the workflow; without this a canvas that had not caught up overwrote the agent's work on the next message.
…Hog flag In a production bundle the panel was enabled only by the PostHog flag. A standalone panel has no cloud identity for PostHog to evaluate the flag against, so `enabled` stayed false and nothing rendered — no toggle, no dock, and the agent never saw the page. The dev server escaped this only through MODE === 'development'. The standalone harness is the opt-in (the panel is tree-shaken out of every other non-cloud build), so it now forces the panel on and settles the gate immediately, exactly as development does.
…eusing the thread's A panel can only name a tab that resolved to a workflow. A fresh tab has not, so it sent no workflow_id and no current_tab, and the server fell back to the thread's previous workflow: the agent edited the tab the user was NOT looking at, the ack named that workflow, the fresh tab could not adopt it (another tab already owned it), and the user saw an empty canvas while the agent truthfully reported the node it had added elsewhere. The session now sends `current_tab_unbound: true` for a turn context that carries a tab but no workflow id, and the server mints a workflow for that turn instead of taking the thread fallback. The ack's workflow is then fresh and unclaimed, so the originating tab adopts it and the follower tracks it.
…pens A doc_subscribe sent while the transport's socket is still connecting is dropped by design, and the follower re-drives its intent on ComfyUI's own socket events (status, reconnected) because in the cloud the doc frames ride that socket. Locally they ride the agent's socket, which those events never describe, so a dropped subscribe waited for ComfyUI's next unrelated status frame — the canvas caught up seconds late. DocFrameTransport gains an optional onConnected hook. The standalone transport implements it from the chat stream's onStatus; the follower reconciles on it exactly as it does on a ComfyUI status frame. The cloud transport needs nothing.
Conflicts: main renamed the turn-context locals and re-indented postTurn under a new block. Kept the turnContextFor decision and the current_tab_unbound attribution on main's shape. While resolving activeWorkflowDraft, the re-seed guard now keys on the follower's bound document rather than its connection state: a reconnect drops `connected` for a moment, and a turn sent in that window must not seed an unversioned canvas over the document either.
…lower until it is known Review follow-ups on the standalone panel: - Identity comes from the typed rest client (GET /agent/identity, schema checked, a non-OK or malformed answer throws and is reported) instead of a raw fetch that left the value null in silence. - The follower is held inactive in standalone until that identity resolves. It stamps every canvas op with the actor the agent reported; an op sent before the answer arrived was attributed "anonymous", which the writer refuses. - The flag-gate test awaits setup() instead of polling, and the session tests use typed postMessage mocks.
…ribe The server drops a connection's follows when its socket closes, while the bridge still believes it is subscribed. A reconcile on the next open is a no-op once intent equals reality, so the follower went deaf after any reconnect. The transport's connected signal now does exactly what a ComfyUI `reconnected` does: drop the connection state and resubscribe. On a first open that is one redundant frame the server answers as a resync.
The resolver refreshed its saved-tab map from `GET /workflows?limit=100`, an ingest route. A standalone agent has no ingest in front of it, so on a local box that request reached ComfyUI, 404ed on every refresh and every explicit target selection, and each miss was reported as a cloud-index failure. The standalone agent's workflows are minted drafts that no name lookup could map to a tab anyway; those tabs already resolve through the tab binding store. The resolver now takes `null` for the index source and answers a refresh with an empty index and no request; the panel root passes `null` under `VITE_AGENT_STANDALONE`. Cloud is unchanged.
… as-is Picking a target tab resolved it to a cloud workflow id first: refresh the cloud index, save a temporary tab to acquire an id, refuse with "workflow unavailable" when none came back. A standalone agent has no cloud index, so every pick on a local box was refused and the picker was unusable. The agent only needs an id, and on standalone it makes one: the first turn from the tab is sent tab-only, the agent mints a workflow for it, and the ack binds the tab. So without a cloud index the picker takes the tab as it is: an already-bound tab keeps its binding, an unbound or temporary one becomes the target with nothing bound in advance, and no save or refresh runs. The cloud path is unchanged and its refusal is pinned by a test.
Main split the CRDT follower into transport, lifecycle and projection layers (#16908). The standalone transport now enters through createLoggedTransport's new base parameter, and the socket-activity reconcile reads the lifecycle's pending-retry state.
Resolves the flag-gate conflicts in agentPanel.ts and its test: keeps the standalone forced-on gate and adopts main's consent reload inside sync(); the test runs setup() inside main's effect scope while still awaiting the gate promise, and restores the flush helper main's consent tests await. useAgentWorkflowSelection.test.ts stubs useI18n with a spy mock instead of importOriginal, which main's new comfy/no-import-actual lint rule rejects.
…s document
AgentPanelRoot withheld the draft seed whenever the follower's intent
(status.workflowId) matched the target document, so after a terminal
subscribe refusal (the FE-1901 retry budget spent) or a schema_error every
later turn sent no draft while the follower supplied no document, and the
canvas stayed stranded until a reload.
The lifecycle now reports whether a refusal still has a retry behind it, the
follower surfaces that as status.terminal ('refused' | 'schema_error' |
null, cleared by a confirmed subscribe or a retarget), and the draft seeds
again while the follower is terminal. An ordinary reconnect (connected=false
with no terminal state) still withholds the seed.
…ected edge `rest.getIdentity()` ran once at setup, so a transient failure (the agent still starting, the socket not yet up) left `standaloneUserId` null and the follower inactive for the page's life: the canvas never synced until a reload. The lookup now lives in resolveStandaloneIdentity and is retried on the standalone socket's next connected edge (the same signal the follower resubscribes on) behind an exponential backoff (1 s doubling to 30 s) so a hard failure does not spin; an edge inside the window is deferred to its end rather than dropped. Every failure is still reported.
attachMintPortWiring gated on the tab binding alone, so during the standalone identity window a human edit was minted into a follower with no subscription and settled undeliverable, silently. Gate on isFollowerActive instead: the same condition the follower subscribes on, so an edit is minted only once there is a document to deliver it to.
`forcedOn` in agentPanel.ts (VITE_AGENT_STANDALONE === 'true') is independent of the distribution, so a cloud bundle built with the flag would force the agent panel on for every user. The standalone harness is never a cloud distribution: vite.config.mts now throws on that combination at config load, next to the existing DEV_AGENT_URL guard, and `forcedOn` points at it.
…ing on the canvas A second @agent-harness test: the panel opens with no PostHog flag persisted (the harness build forces the gate), and a turn that asks for exactly one EmptyLatentImage node raises that class's count on the page's own graph by one, with the backend's agent_message_done frame observed on the shared socket. Same fixture rules as the first test: nothing on the agent path is mocked, and it runs only under the harness.
# Conflicts: # scripts/vite-config-dev-agent.test.ts # src/extensions/core/agentPanel.test.ts # src/workbench/extensions/agent/crdt/useAgentCrdtFollower.test.ts # src/workbench/extensions/agent/crdt/useAgentCrdtFollower.ts
…tartAgentCrdtFollower; terminal on new AgentCrdtStatus literals; product gate in standalone identity test)
Resolve against main's op coalescing, ack-timeout subscribe budget and materialization events: - useAgentCrdtFollower takes both main's events and this PR's baseTransport; the idle reconcile defers through main's shouldDeferSubscribe, and the standalone socket's opens still drive handleReconnected. - useAgentSession: port current_tab_unbound into main's performSend. - The lifecycle keeps main's ack timer and this PR's refusal outcome; both test suites are kept. - The harness spec opens the panel by main's entryButton label. - The standalone mint test flushes the coalescer before asserting.
…ry backend The standalone agent had no GET /workflows, so the panel branched on it: a null index, tabs resolving only through their binding, saved files sent tab-only, and a bindingIsAuthoritative flag threaded into turn attribution. The local agent now serves the same index contract ingest does (over the ComfyUI workflows directory), so every backend takes the cloud path and the branches go. The dev proxy routes /api/workflows to the local agent the way it already routes /api/agent.
…ot named Sent with neither workflow_id nor current_tab_unbound, the agent falls back to the thread's previous workflow, so the turn would edit another canvas. The turn context now marks such a tab unresolved and the send is refused with a retryable notice instead.
…ckend Agent events and document frames now ride /api/agent/events on both backends (ingest serves it in the cloud, the agent serves it locally), with the caller's credential as ?token=, the way ingest's sockets read it. The follower's canvas ops carry the actor from GET /api/agent/identity on both, since a backend user id is not necessarily the Firebase uid. Removes the standalone-only branches: the ComfyUI-socket agent event source and apiTransport, the api reconnected/status listeners, and the standalone-gated identity.
…ty retry A refused /api/agent/events upgrade now backs off exponentially with jitter (reset once a socket opens), so an outage does not have every open panel reconnecting in lockstep once a second. A connected edge that lands while the identity lookup is in flight is kept, so a failed first lookup is still retried. The unresolved-tab notice now also covers duplicate saved names.
The panel now reads agent_* events and doc_* frames from its own /api/agent/events socket and resolves its canvas actor from GET /api/agent/identity, so frames pushed on ComfyUI's /ws never reach it. - ws.ts: track /api/agent/events next to /ws (getAgentSocket / nextAgentSocket, never connected to a server); /ws tracking unchanged. - agentSocket.ts: AGENT_SOCKET_URL, mockAgentIdentity (user test-user-e2e, the signed-in cloud test user). - AgentFollowerHostSocket routes the agent socket with no status frame and keeps a quiet /ws stub with a fixed client id so session-scoped tabs survive a reload; the socketSid constructor argument is gone. - Both agent boot mocks answer the identity lookup. - Specs that routed /ws for agent frames route the agent socket; specs and fixtures that pushed on getWebSocket use getAgentSocket.
getAgentSocket could hand back the route of a socket that had already closed, so a frame sent during a reconnect never reached the page. A route without a server now clears itself on close, and getters wait for the next one; /ws, which is connected to the server, keeps its close forwarding.
…s do A local build's api.fetchApi attaches no credential, so the local agent could not make its model calls as the user. Agent requests now carry the signed-in user's auth header on every backend (the cloud still applies its workspace header on top), the same hand-off queuePrompt makes for partner nodes, and the events socket carries the credential fetchApi sends as ?token=. A running turn, including one a thread switch moved to the background, re-presents the credential so a long local turn never outlives its token; a signed-out user is offered the sign-in dialog before sending; consent goes to Global Settings with the header each backend accepts. The dev server also proxies /api/agent/events as a WebSocket against a cloud backend: the catch-all /api route proxies plain HTTP only.
The socket hard-coded /api/agent/events from the origin root, while every agent request goes through api.fetchApi's base path; a ComfyUI served under a sub-path would have had working requests and a dead socket. It now takes its path from api.apiURL.
There was a problem hiding this comment.
Verdict: ready for human review
I reviewed a20420ac. #17469 has merged, so this PR now targets main at 4f1e87df. Against it, the diff is 20 files, +631/-23.
Since round 9, the only code change is baa62340. The rest is base merges:
- The domain records match round 9 exactly.
boundaries.jsonmatches whatpnpm architecture:updategenerates.fallow auditandpnpm architecture:checkpass locally againstmain.- CI is green: 93 passed, 26 skipped, none failed or pending.
My round-8 P3 is fixed in baa62340, with my suggestion applied unchanged. The refresh queue now reports an escaped failure and keeps running. The new test, "reports an unexpected refresh failure and keeps refreshing later restarts", fails with the .catch reverted and passes at this head, along with the other 12 store tests. The author already replied in my thread, so I have not added a reply there.
Dispositions for the open threads:
- dante01yoon's queue suggestion (thread): addressed in
baa62340, as above. - christian-byrne's
Comfy.RefreshNodeDefinitionsquestion (thread): answered. The author keeps the command on purpose, for its model, asset and missing-model refresh after a pack install, and keeps the success toast as the "new nodes are ready" signal. He also confirms that a failure shows one toast and only sends telemetry throughreportError. This matches what I found in round 9. It is a product choice, and I accept it. - christian-byrne's required-
distributionsuggestion (thread): answered. The parameter stays optional, for the reasons I gave in round 9 when I contested the suggestion. I accept that.
The five round-3 P3s below are still open and unanswered; none of them blocks the merge. The round-6 note for the human reviewer still applies: the owners of the four producer-domain records that now name agent as a consumer need to sign off.
Still open, non-blocking (5, from round 3, unanswered)
- P3: link the follow-up issue for the pre-existing load race (ops applied between
await beforeLoadGraphandrootGraph.configure) in the PR body. - P3 nit:
/* clean=*/and/* restore_view=*/labels remain inopenWorkflow, which this PR modifies. - P3 nit:
openWorkflow's docblock is detached (workflowService.ts:384-391). - P3: third "refresh definitions, then reload" sequence; a follow-up candidate.
- P3 nit, question: the 30 s
timeouton the two subprocess tests.
Review record
Rounds: R1 at fa89be88, R2 at 57d912f9, R3 at 6f98104b, R4 at 7a8026a2, R5 at 934a0c82, R6 at 40e727cb, R7 at 355961d5, R8 at c63c8ee5, R9 at da7baaa7, and R10 at a20420ac (this review). The commit SHAs below are from before the author's commit-message rewrite; the rewritten pre-merge tip fa170a72 has the same tree as 40e727cb. Commits: c2370e4 (store redesign), 340f859 (cloud gate), 2f265c7 (subprocess test), 5898f07 (isCurrent), 855e0ad (capture and tail wait), 6f98104 (round-2 follow-ups), 7a8026a (round-3 follow-ups), 40e727c (domain-boundary approvals). The author answered every thread except the R5 one, which I closed with a reply; links point to the thread.
R1 inline (35)
- P2, refresher dies with the panel (thread): fixed in c2370e4 (store outlives the panel). The closed-panel restart is a documented limit.
- P2, retry keyed to the agent socket (thread): fixed in c2370e4 (
reconnected). - P2, deterministic reload failure retried (thread): fixed in c2370e4.
- P3,
stoppedchecked only on entry (thread): moot, there is no stop. - P2, unbudgeted reports and toasts (thread): fixed in c2370e4.
- P3, question on the
tool_call_iddedupe (thread): dedupe removed in c2370e4. - P2, cloned retry engine (thread): moot, module deleted.
- P2, six-variable closure (thread): moot, now one flag plus a queue.
- P3, duplicate
reloadCurrentWorkflow(thread): fixed in c2370e4. - P3, two failure channels (thread): fixed in c2370e4.
- P3 nits on the
restartSucceededname (1, 2): moot. - P3 nit on retry/pending vocabulary (thread): moot.
- P3 nits on the delay table (1, 2): moot.
- P3 nit, "node catalog" vocabulary (thread): fixed in c2370e4.
- P3, JSDoc narrating the implementation (thread): moot (module deleted); the new JSDoc is contract only.
- P3 nits,
forcedOnrename (1, 2): fixed in 340f859. - P3 nit, README wrap (thread): fixed in 340f859.
- P3, devAgentConfig message (thread): fixed in 2f265c7.
- P3, explicit
distributionparameter (thread): declined in R1, contested in R2, fixed in 6f98104. - P2, vite.config wiring untested (thread): fixed in 2f265c7.
- P3 test items on the deleted module (backoff shape, cancel on retry, dedupe running id, redundant test, fixture duplication: 1, 2, 3, 4, 5): moot.
- P3, panel test tail re-proving the module (thread): fixed in c2370e4.
- P3, null-workflow branch untested (thread): moot, the branch is gone.
- P3 nits, shared
failingStepstable (1, 2, 3): moot. - P3 nit, one row per ignored frame (thread): applied in c2370e4.
- P3 nit,
flushhelper (thread): applied in c2370e4.
R1 body
- P2, env leak in the subprocess test: fixed in 2f265c7.
- P3, title: fixed.
- P3,
setupFlagGatecomment: fixed in 340f859. - P3, README "any distribution": fixed. The two out-of-diff comments are left, and I accepted that.
- P3, README restart bullet: fixed in c2370e4.
- P3, "no cancel on stop" claim: moot.
- Questions:
- kit build: answered, PR body corrected;
- pack frontend extensions: answered, claim narrowed;
- dedupe: removed.
- Unverified:
- Other reviewers in R1:
R2 inline (17)
- P1, reload from a pre-capture snapshot (thread): fixed in 855e0ad. The guard was refined to
prepareForSave()in 7a8026a (R3). - P3, stale definitions on a tab switched during the refresh (thread): fixed in 855e0ad.
- P3, question on
reconnectedtiming (thread): answered as a documented limit in 6f98104. - P3 nits, wrapper name (1, 2): fixed in 6f98104.
- P3, double parse (thread): fixed in 6f98104.
- P3, message remedy (thread): fixed in 6f98104.
- P3 nit, README term (thread): fixed in 6f98104.
- P3, cloud-without-harness row (thread): fixed in 6f98104.
- P3,
DEV_AGENT_DATA_DIRpin (1, 2): fixed in 6f98104. - P3, ordering oracle (thread): fixed in 6f98104, stronger than my suggestion.
- P3 nits, redundant timer hook (1, 2): fixed in 6f98104.
- P3, redundant panel reload assertion (thread): fixed in 6f98104.
- P3, over-built regression test (thread): superseded in 855e0ad by two short tests.
- P3 nit, table title (thread): applied; my wording was still off, and the R3 fix landed in 7a8026a.
R2 body
- P3,
distributioncount: fixed in 6f98104. - P3, PR-body failure-path wording: fixed.
- P3,
__DISTRIBUTION__wording: fixed. - Question, #20971: answered.
- Unverified, auxiliary steps: answered (kept as one unit).
- CodeRabbit's re-mark-stale item: withdrawn.
- christian-byrne's queue-gate disposition: acknowledged, not a code finding.
R3 inline (10)
- P3, path guard vs tracker identity on the capture (thread): fixed in 7a8026a (
prepareForSave()). - P3 nit, stale
reloadCurrentWorkflowJSDoc (thread): fixed in 7a8026a. - P3, P1 test did not pin the capture's position (thread): fixed in 7a8026a.
- P3, unguarded-capture mutation survived (thread): fixed in 7a8026a (
nextgets a real tracker). - P3,
skipAssetScansas the only discriminator (thread): fixed in 7a8026a. - P3 nit, misleading test name (thread): fixed in 7a8026a.
- P3 nit, hand-rolled tracker in
createWorkflow(thread): fixed in 7a8026a. - P3 nit, agentPanel table title (thread): fixed in 7a8026a.
- P3 nit, copied distribution union and optional parameter (thread): declined by the author. The runtime gate refuses cloud on its own, and the fix would touch 17 test callers or add a
build/→src/import. I accept that. - P3,
onAgentEventordering against the hydration hold (thread): fixed in 7a8026a. The new session test fails when the call moves after the hold (I checked).
R3 body (5): still open and non-blocking, unanswered across R4-R10; see "Still open" above.
R4: no new findings.
R5 inline (1)
- P2 (merge gate), 12 new domain-boundary violations after the base merge, which failed CI's Fallow gate and skipped the unit suite (thread): fixed in 40e727c. The agent record approves the four producer domains, those records approve
agent, and the test no longer importsLGraphNode. Reply. - R5 body: christian-byrne's queue-gate comment at
7a8026a2, acknowledged (not a code finding).
R6: no new findings. Reply closed the R5 thread.
R7: no new findings.
- christian-byrne's queue-gate disposition at
40e727cb: acknowledged, not a code finding. - christian-byrne's #21044 browser-proof comment: acknowledged; it touches none of my findings, and #21044 now needs a rebase.
- christian-byrne's approval at
40e727cb: dismissed by the push. - skishore23's merge claim: confirmed.
R8
- P3, the refresh queue never recovers from a rejected pass (inline; confirms dante01yoon's suggestion): fixed in
baa62340(my suggestion verbatim, plus a regression test that fails without the catch; I checked). The author replied in the thread. - dante01yoon's contract question: confirmed for renames, contested for added statuses. It is a backend follow-up, not blocking here.
- dante01yoon's review: his checks agree with mine.
c63c8ee5merged base fixes for the two inherited CI failures; the PR diff is unchanged.
R9: no new findings of my own.
- christian-byrne's review: both of his checks confirmed.
- christian-byrne's toast question: confirmed as a product question for the author, non-blocking; I contested that failures are surfaced twice. The author answered that the command is deliberate and the success toast is wanted, and I accept that.
- christian-byrne's required
distributionsuggestion: contested. It repeats my R3 finding, which I accepted as declined. The author kept the parameter optional for the same reasons. da7baaa7merged the base only. Code and records are unchanged from R8, andboundaries.jsonmatchespnpm architecture:update.
R10 (this review): no new findings.
- #17469 merged into
mainat4f1e87df, and the PR now targetsmain. - Code changes since R9: only
baa62340. Domain records unchanged.boundaries.jsonmatchespnpm architecture:update.
Checks at this head
- CI at
a20420ac: 93 passed, 26 skipped, none failed or pending. - Local, against
mainat4f1e87df:fallow auditpasses,pnpm architecture:checkpasses, andpnpm architecture:updateleaves no diff. agentNodeDefinitionRefreshStore.test.ts: 13/13 pass. Reverting the.catchfails only "reports an unexpected refresh failure and keeps refreshing later restarts".
christian-byrne
left a comment
There was a problem hiding this comment.
PM-2119 follow-ups. Non-blocking, three notes.
refresh_catalogleaves dropdowns stale too- reconnect only retries failures; other restarts missed
- README: say the user already gets toasts
Full context for agent readers
PM-2119: the agent tells users to refresh the ComfyUI tab when they don't need to. This PR removes the restart half of that. The notes below cover the remaining places where the agent will still tend to say "refresh". The companion agent prompt change is https://github.com/Comfy-Org/cloud/pull/14149 and is written to be correct with or without this PR.
| function isSuccessfulRestart(event: AgentWsEvent): boolean { | ||
| return ( | ||
| event.type === 'agent_tool_call' && | ||
| event.data.tool_name === 'restart_comfyui' && |
There was a problem hiding this comment.
Consider treating a successful refresh_catalog as stale too.
Full context for agent readers
The local missing-model flow is comfy model download -> refresh_catalog -> set_widget. After that, the open tab's loader dropdown does not list the new file, and missing-model detection may flag it, until the user presses R. That is another place the agent will tend to say "refresh". Updating the dropdowns (app.refreshComboInNodes, which Comfy.RefreshNodeDefinitions already runs) is enough; no workflow reload needed for this case.
There was a problem hiding this comment.
Agreed, as a follow-up. It needs a combo refresh without the workflow reload, so it can't share isSuccessfulRestart. It would also be a second backend tool-name literal, so I'd rather do it with the contract change than add it here.
| enqueueRefresh() | ||
| } | ||
|
|
||
| useEventListener(api, 'reconnected', enqueueRefresh) |
There was a problem hiding this comment.
Possible follow-up: refresh on any real server restart, not only after a failed refresh.
Full context for agent readers
This listener only retries a refresh that already failed. Restarts still missed: an agent restart while the panel is closed (README L30-31 already notes this), a user comfy launch / comfy stop, or Desktop restarting the server. On reconnected, refresh whenever the server actually restarted, detected via a boot id from system_stats or a fingerprint of object_info. That would remove the last reason for the agent to mention refreshing after a restart. Fine as a separate PR.
There was a problem hiding this comment.
Agreed, as a separate PR. With #20971 the events socket runs through ComfyUI, so a restart can drop the success frame. Comparing object_info on reconnected needs no backend change, so I'd start there.
| reloads the open workflow. A failed refresh runs again only when ComfyUI's | ||
| `/ws` reconnects later; until then definitions stay stale, and **Refresh | ||
| Node Definitions** recovers them. A restart made while the panel is closed is | ||
| not observed. |
There was a problem hiding this comment.
Nit: mention the confirmation toasts.
Full context for agent readers
Comfy.RefreshNodeDefinitions shows the "Update requested" and "Node definitions updated" toasts (app.refreshComboInNodes, src/scripts/app.ts ~L2716/L2725). Saying so here makes it clear the user already gets confirmation without being told to refresh.
There was a problem hiding this comment.
Done in afba402: the restart bullet now names both toasts.
There was a problem hiding this comment.
Verdict: not ready: #20971 merged into main after round 10, and this PR now conflicts with it on the standalone force-on policy
The head is still a20420ac, which I reviewed in round 10. Since then, #20971 ("mount the agent panel from ComfyUI's agent feature") merged into main as 9e0e549b. GitHub now reports this PR as not mergeable. git merge-tree against main conflicts in src/extensions/core/agentPanel.ts, src/extensions/core/agentPanel.test.ts and src/workbench/extensions/agent/README.md.
The conflict is a policy decision, not a mechanical one, so I have raised it as a new P2 inline on agentPanel.ts:558-561. I flagged the policy split in round 2 while #20971 was a draft. The author deferred it to whichever PR merged second, and that is now this one.
christian-byrne's review raised three items. My dispositions:
- Treat a successful
refresh_catalogas stale (thread): confirmed as a follow-up, outside this PR's scope.- Nothing in this repository names
refresh_catalogyet, so I cannot check the tool name or its status values here. - It cannot simply join
isSuccessfulRestart. That would also reload the open workflow, and his note says only the dropdowns need refreshing. It needs a path that refreshes without reloading. - It would be a second backend-owned tool-name literal on a hand-declared frame, which is the drift risk dante01yoon raised in his contract question.
- Nothing in this repository names
- Refresh on any real server restart (thread): confirmed as a follow-up, and #20971 makes it more pressing.
- Under #20971, ComfyUI publishes the agent feature, and the events socket at
api.apiURL('/agent/events')(AgentPanelRoot.vue:222) runs through ComfyUI. A restart drops that socket, and nothing replays frames, so thesuccessframe can be missed. I raised this in round 2; it is still unverified and needs a run against an--enable-agentComfyUI. - A boot id would need backend work.
zSystemStatsResponsein@comfyorg/ingest-typeshas no boot or instance field. Comparingobject_infowould need no backend change.
- Under #20971, ComfyUI publishes the agent feature, and the events socket at
- README: mention the confirmation toasts (thread): confirmed, P3 nit.
refreshComboInNodesshows both toasts (app.ts:2713-2728). The paragraph sits next to the README hunk that conflicts withmain, so it is easiest to fold in during that resolution.
The five round-3 P3s below are still open and unanswered. The round-6 sign-off note for the four producer-domain owners still applies.
Still open (1 new merge gate, 5 non-blocking from round 3)
- P2, merge gate: reconcile the standalone force-on policy with #20971 (inline on
agentPanel.ts:558-561). - P3: link the follow-up issue for the pre-existing load race (ops applied between
await beforeLoadGraphandrootGraph.configure) in the PR body. - P3 nit:
/* clean=*/and/* restore_view=*/labels remain inopenWorkflow, which this PR modifies. - P3 nit:
openWorkflow's docblock is detached (workflowService.ts:384-391). - P3: third "refresh definitions, then reload" sequence; a follow-up candidate.
- P3 nit, question: the 30 s
timeouton the two subprocess tests.
Review record
Rounds: R1 at fa89be88, R2 at 57d912f9, R3 at 6f98104b, R4 at 7a8026a2, R5 at 934a0c82, R6 at 40e727cb, R7 at 355961d5, R8 at c63c8ee5, R9 at da7baaa7, R10 at a20420ac, and R11 at a20420ac (this review). The commit SHAs below are from before the author's commit-message rewrite; the rewritten pre-merge tip fa170a72 has the same tree as 40e727cb. Commits: c2370e4 (store redesign), 340f859 (cloud gate), 2f265c7 (subprocess test), 5898f07 (isCurrent), 855e0ad (capture and tail wait), 6f98104 (round-2 follow-ups), 7a8026a (round-3 follow-ups), 40e727c (domain-boundary approvals). The author answered every thread except the R5 one, which I closed with a reply; links point to the thread.
R1 inline (35)
- P2, refresher dies with the panel (thread): fixed in c2370e4 (store outlives the panel). The closed-panel restart is a documented limit.
- P2, retry keyed to the agent socket (thread): fixed in c2370e4 (
reconnected). - P2, deterministic reload failure retried (thread): fixed in c2370e4.
- P3,
stoppedchecked only on entry (thread): moot, there is no stop. - P2, unbudgeted reports and toasts (thread): fixed in c2370e4.
- P3, question on the
tool_call_iddedupe (thread): dedupe removed in c2370e4. - P2, cloned retry engine (thread): moot, module deleted.
- P2, six-variable closure (thread): moot, now one flag plus a queue.
- P3, duplicate
reloadCurrentWorkflow(thread): fixed in c2370e4. - P3, two failure channels (thread): fixed in c2370e4.
- P3 nits on the
restartSucceededname (1, 2): moot. - P3 nit on retry/pending vocabulary (thread): moot.
- P3 nits on the delay table (1, 2): moot.
- P3 nit, "node catalog" vocabulary (thread): fixed in c2370e4.
- P3, JSDoc narrating the implementation (thread): moot (module deleted); the new JSDoc is contract only.
- P3 nits,
forcedOnrename (1, 2): fixed in 340f859. - P3 nit, README wrap (thread): fixed in 340f859.
- P3, devAgentConfig message (thread): fixed in 2f265c7.
- P3, explicit
distributionparameter (thread): declined in R1, contested in R2, fixed in 6f98104. - P2, vite.config wiring untested (thread): fixed in 2f265c7.
- P3 test items on the deleted module (backoff shape, cancel on retry, dedupe running id, redundant test, fixture duplication: 1, 2, 3, 4, 5): moot.
- P3, panel test tail re-proving the module (thread): fixed in c2370e4.
- P3, null-workflow branch untested (thread): moot, the branch is gone.
- P3 nits, shared
failingStepstable (1, 2, 3): moot. - P3 nit, one row per ignored frame (thread): applied in c2370e4.
- P3 nit,
flushhelper (thread): applied in c2370e4.
R1 body
- P2, env leak in the subprocess test: fixed in 2f265c7.
- P3, title: fixed.
- P3,
setupFlagGatecomment: fixed in 340f859. - P3, README "any distribution": fixed. The two out-of-diff comments are left, and I accepted that.
- P3, README restart bullet: fixed in c2370e4.
- P3, "no cancel on stop" claim: moot.
- Questions:
- kit build: answered, PR body corrected;
- pack frontend extensions: answered, claim narrowed;
- dedupe: removed.
- Unverified:
- Other reviewers in R1:
R2 inline (17)
- P1, reload from a pre-capture snapshot (thread): fixed in 855e0ad. The guard was refined to
prepareForSave()in 7a8026a (R3). - P3, stale definitions on a tab switched during the refresh (thread): fixed in 855e0ad.
- P3, question on
reconnectedtiming (thread): answered as a documented limit in 6f98104. - P3 nits, wrapper name (1, 2): fixed in 6f98104.
- P3, double parse (thread): fixed in 6f98104.
- P3, message remedy (thread): fixed in 6f98104.
- P3 nit, README term (thread): fixed in 6f98104.
- P3, cloud-without-harness row (thread): fixed in 6f98104.
- P3,
DEV_AGENT_DATA_DIRpin (1, 2): fixed in 6f98104. - P3, ordering oracle (thread): fixed in 6f98104, stronger than my suggestion.
- P3 nits, redundant timer hook (1, 2): fixed in 6f98104.
- P3, redundant panel reload assertion (thread): fixed in 6f98104.
- P3, over-built regression test (thread): superseded in 855e0ad by two short tests.
- P3 nit, table title (thread): applied; my wording was still off, and the R3 fix landed in 7a8026a.
R2 body
- P3,
distributioncount: fixed in 6f98104. - P3, PR-body failure-path wording: fixed.
- P3,
__DISTRIBUTION__wording: fixed. - Question, #20971: answered.
- Unverified, auxiliary steps: answered (kept as one unit).
- CodeRabbit's re-mark-stale item: withdrawn.
- christian-byrne's queue-gate disposition: acknowledged, not a code finding.
R3 inline (10)
- P3, path guard vs tracker identity on the capture (thread): fixed in 7a8026a (
prepareForSave()). - P3 nit, stale
reloadCurrentWorkflowJSDoc (thread): fixed in 7a8026a. - P3, P1 test did not pin the capture's position (thread): fixed in 7a8026a.
- P3, unguarded-capture mutation survived (thread): fixed in 7a8026a (
nextgets a real tracker). - P3,
skipAssetScansas the only discriminator (thread): fixed in 7a8026a. - P3 nit, misleading test name (thread): fixed in 7a8026a.
- P3 nit, hand-rolled tracker in
createWorkflow(thread): fixed in 7a8026a. - P3 nit, agentPanel table title (thread): fixed in 7a8026a.
- P3 nit, copied distribution union and optional parameter (thread): declined by the author. The runtime gate refuses cloud on its own, and the fix would touch 17 test callers or add a
build/→src/import. I accept that. - P3,
onAgentEventordering against the hydration hold (thread): fixed in 7a8026a. The new session test fails when the call moves after the hold (I checked).
R3 body (5): still open and non-blocking, unanswered across R4-R11; see "Still open" above.
R4: no new findings.
R5 inline (1)
- P2 (merge gate), 12 new domain-boundary violations after the base merge, which failed CI's Fallow gate and skipped the unit suite (thread): fixed in 40e727c. The agent record approves the four producer domains, those records approve
agent, and the test no longer importsLGraphNode. Reply. - R5 body: christian-byrne's queue-gate comment at
7a8026a2, acknowledged (not a code finding).
R6: no new findings. Reply closed the R5 thread.
R7: no new findings.
- christian-byrne's queue-gate disposition at
40e727cb: acknowledged, not a code finding. - christian-byrne's #21044 browser-proof comment: acknowledged; it touches none of my findings, and #21044 now needs a rebase.
- christian-byrne's approval at
40e727cb: dismissed by the push. - skishore23's merge claim: confirmed.
R8
- P3, the refresh queue never recovers from a rejected pass (inline; confirms dante01yoon's suggestion): fixed in
baa62340(my suggestion verbatim, plus a regression test that fails without the catch; I checked). The author replied in the thread. - dante01yoon's contract question: confirmed for renames, contested for added statuses. It is a backend follow-up, not blocking here.
- dante01yoon's review: his checks agree with mine.
c63c8ee5merged base fixes for the two inherited CI failures; the PR diff is unchanged.
R9: no new findings of my own.
- christian-byrne's review: both of his checks confirmed.
- christian-byrne's toast question: confirmed as a product question for the author, non-blocking; I contested that failures are surfaced twice. The author answered that the command is deliberate and the success toast is wanted, and I accept that.
- christian-byrne's required
distributionsuggestion: contested. It repeats my R3 finding, which I accepted as declined. The author kept the parameter optional for the same reasons. da7baaa7merged the base only. Code and records are unchanged from R8, andboundaries.jsonmatchespnpm architecture:update.
R10: no new findings.
- #17469 merged into
mainat4f1e87df, and the PR now targetsmain. - Code changes since R9: only
baa62340. Domain records unchanged.boundaries.jsonmatchespnpm architecture:update.
R11 (this review)
- P2 (merge gate), conflict with #20971 over the standalone force-on policy (inline on
agentPanel.ts:558-561): open. - christian-byrne's
refresh_catalognote: confirmed as a follow-up; it needs a refresh without a reload. - christian-byrne's any-restart note: confirmed as a follow-up. #20971 makes it more pressing, but my R2 proxied-socket concern is still unverified.
- christian-byrne's README toast nit: confirmed; it belongs in the conflict resolution.
Checks at this head
- The head is unchanged since R10. GitHub reports
mergeable: false.git merge-treeagainstmainat9e0e549bconflicts insrc/extensions/core/agentPanel.ts,src/extensions/core/agentPanel.test.tsandsrc/workbench/extensions/agent/README.md, all from #20971 (9e0e549b). - R10's local checks against
4f1e87dfstill apply to the unmerged head.
| const ignoresRemoteFeatureConfig = | ||
| import.meta.env.MODE === 'development' || | ||
| (__DISTRIBUTION__ !== 'cloud' && | ||
| import.meta.env.VITE_AGENT_STANDALONE === 'true') |
There was a problem hiding this comment.
P2, merge gate. #20971 (9e0e549b) rewrote setupFlagGate on main, and these lines now conflict with it on policy, not only text.
- On
main: the gate isdevForcedOn || agentPanelStore.comfyAgent?.state === 'ready', andgateSettledfollowsdevForcedOn || agentPanelStore.flagsSettled.devForcedOnneeds bothMODE === 'development'andVITE_AGENT_STANDALONE === 'true'. Remote config no longer takes part, so the second watch this PR edits is gone too. - Here: a production build with
VITE_AGENT_STANDALONE=trueoutside cloud forces the panel on. Onmain, that build shows the panel only when its ComfyUI reports the agent feature asready.
Whichever policy wins decides what the conflict resolution keeps:
- Keep this PR's policy: widen
devForcedOntoMODE === 'development' || (__DISTRIBUTION__ !== 'cloud' && VITE_AGENT_STANDALONE === 'true')and apply it to both ofmain's watches. Keep theagentPanel.test.tsrows, rebuilt onmain'scomfyAgentsetup. Updatemain's README sentence that limits the force-on to development mode. - Adopt
main's policy: drop this hunk, its test rows and the README paragraph, and retitle the PR without "standalone force-on". ThecreateDevAgentConfigcloud refusal is still worth keeping.mainstill forces the panel on in a cloud dev server started withVITE_AGENT_STANDALONE=true, and that refusal is what stops it.
I have not attached a suggestion block: the change spans three files, and choosing between the two needs a product decision.
There was a problem hiding this comment.
Took main's policy in afba402. The force-on hunk, its two test rows and the README paragraph are gone, so the panel mounts from ComfyUI's agent feature, and VITE_AGENT_STANDALONE forces it on only in development. The createDevAgentConfig cloud refusal stays. Title and body are updated.
# Conflicts: # src/extensions/core/agentPanel.test.ts # src/extensions/core/agentPanel.ts # src/workbench/extensions/agent/README.md
There was a problem hiding this comment.
Re-reviewed at afba402. My three notes are handled. (Merged 2026-10-18 as ae3f60f.)
- conflict fix keeps
main's panel policy: looks right - README toast note: done
- follow-ups: https://linear.app/comfyorg/issue/FE-3482 (done by #21841) and https://linear.app/comfyorg/issue/FE-3483 (open)
Full context for agent readers
- Net diff vs
mainno longer touchessrc/extensions/core/agentPanel.ts; the force-on hunk and its test rows are gone,createDevAgentConfigkeeps the cloud refusal. Matches the "adopt main's policy" option from the merge-gate thread. - README restart bullet names both toasts; checked against
src/scripts/app.tsrefreshComboInNodes(toastMessages.updateRequested/nodeDefinitionsUpdated). agentNodeDefinitionRefreshStore.tsunchanged since my last review.- FE-3482: combo refresh after a successful
refresh_catalog(no workflow reload); landed in #21841. FE-3483: refresh after a ComfyUI restart the panel did not see (closed panel,comfy launch/stop, Desktop, droppedsuccessframe), still open. - Browser proof #21044 merged 2026-10-20.
- Later fix: since comfy-agent 0.1.0-rc2 the restart
successframe arrives before the restart, so this PR's refresh read the old server. Fixed by #21644 (refresh on the following reconnect), merged 2026-10-22. - DrJKL approved at afba402 before merge.
There was a problem hiding this comment.
Verdict: ready for human review
I reviewed afba402c. It merges main at e7fc8af3 and resolves the #20971 conflict by adopting main's policy:
- The PR no longer touches
src/extensions/core/agentPanel.tsor its test. The force-on hunk, its two test rows and the activation README paragraphs are gone. createDevAgentConfigkeeps its cloud refusal.- The README restart bullet now names both toasts.
- The title is now "refresh node definitions after an agent restart", and the body says activation follows #20971.
Outside those removals, the diff against main matches round 10 line for line: 18 files, +605/-14.
Checks:
fallow auditandpnpm architecture:checkpass locally, andpnpm architecture:updateleaves no diff.- The panel, refresh store and dev-agent script suites pass (129/129).
- CI is green: 93 passed, 32 skipped, none failed or pending.
My round-11 P2 is fixed in afba402c, and the author replied in the thread. Dispositions for the other open items:
refresh_catalogas stale (thread): agreed as a follow-up and now tracked as FE-3482. It needs a combo refresh without a workflow reload, as I noted in round 11.- Refresh on any real restart (thread): agreed as a separate PR and now tracked as FE-3483, starting from an
object_infocomparison onreconnected. That ticket also covers the success frame the ComfyUI-proxied socket can drop, which I raised in rounds 2 and 11. - README toasts (thread): fixed in
afba402c. I checked the bullet againstrefreshComboInNodes. - christian-byrne's re-review (review): confirmed. His account of the resolution matches what I found.
One correction to my own reasoning. In round 9 I contested making distribution required partly because setupFlagGate checked __DISTRIBUTION__ !== 'cloud'. That check left with the force-on hunk. On main, VITE_AGENT_STANDALONE forces the panel on in any development build, so the createDevAgentConfig refusal is now the only thing stopping that in a cloud dev server. My conclusion still holds: vite.config.mts:224 passes DISTRIBUTION, and the subprocess test "refuses the standalone harness when the dev server URL selects the cloud distribution" fails if it stops. But that test is now the only line of defence, so it should stay.
The five round-3 P3s below remain open, unanswered and non-blocking. The round-6 note for the human reviewer still applies: the owners of the four producer-domain records that name agent as a consumer need to sign off.
Still open, non-blocking (5, from round 3, unanswered)
- P3: link the follow-up issue for the pre-existing load race (ops applied between
await beforeLoadGraphandrootGraph.configure) in the PR body. - P3 nit:
/* clean=*/and/* restore_view=*/labels remain inopenWorkflow, which this PR modifies. - P3 nit:
openWorkflow's docblock is detached (workflowService.ts:384-391). - P3: third "refresh definitions, then reload" sequence; a follow-up candidate.
- P3 nit, question: the 30 s
timeouton the two subprocess tests.
Review record
Rounds: R1 at fa89be88, R2 at 57d912f9, R3 at 6f98104b, R4 at 7a8026a2, R5 at 934a0c82, R6 at 40e727cb, R7 at 355961d5, R8 at c63c8ee5, R9 at da7baaa7, R10 at a20420ac, R11 at a20420ac, and R12 at afba402c (this review). The commit SHAs below are from before the author's commit-message rewrite; the rewritten pre-merge tip fa170a72 has the same tree as 40e727cb. Commits: c2370e4 (store redesign), 340f859 (cloud gate), 2f265c7 (subprocess test), 5898f07 (isCurrent), 855e0ad (capture and tail wait), 6f98104 (round-2 follow-ups), 7a8026a (round-3 follow-ups), 40e727c (domain-boundary approvals). The author answered every thread except the R5 one, which I closed with a reply; links point to the thread.
R1 inline (35)
- P2, refresher dies with the panel (thread): fixed in c2370e4 (store outlives the panel). The closed-panel restart is a documented limit.
- P2, retry keyed to the agent socket (thread): fixed in c2370e4 (
reconnected). - P2, deterministic reload failure retried (thread): fixed in c2370e4.
- P3,
stoppedchecked only on entry (thread): moot, there is no stop. - P2, unbudgeted reports and toasts (thread): fixed in c2370e4.
- P3, question on the
tool_call_iddedupe (thread): dedupe removed in c2370e4. - P2, cloned retry engine (thread): moot, module deleted.
- P2, six-variable closure (thread): moot, now one flag plus a queue.
- P3, duplicate
reloadCurrentWorkflow(thread): fixed in c2370e4. - P3, two failure channels (thread): fixed in c2370e4.
- P3 nits on the
restartSucceededname (1, 2): moot. - P3 nit on retry/pending vocabulary (thread): moot.
- P3 nits on the delay table (1, 2): moot.
- P3 nit, "node catalog" vocabulary (thread): fixed in c2370e4.
- P3, JSDoc narrating the implementation (thread): moot (module deleted); the new JSDoc is contract only.
- P3 nits,
forcedOnrename (1, 2): fixed in 340f859. - P3 nit, README wrap (thread): fixed in 340f859.
- P3, devAgentConfig message (thread): fixed in 2f265c7.
- P3, explicit
distributionparameter (thread): declined in R1, contested in R2, fixed in 6f98104. - P2, vite.config wiring untested (thread): fixed in 2f265c7.
- P3 test items on the deleted module (backoff shape, cancel on retry, dedupe running id, redundant test, fixture duplication: 1, 2, 3, 4, 5): moot.
- P3, panel test tail re-proving the module (thread): fixed in c2370e4.
- P3, null-workflow branch untested (thread): moot, the branch is gone.
- P3 nits, shared
failingStepstable (1, 2, 3): moot. - P3 nit, one row per ignored frame (thread): applied in c2370e4.
- P3 nit,
flushhelper (thread): applied in c2370e4.
R1 body
- P2, env leak in the subprocess test: fixed in 2f265c7.
- P3, title: fixed.
- P3,
setupFlagGatecomment: fixed in 340f859. - P3, README "any distribution": fixed. The two out-of-diff comments are left, and I accepted that.
- P3, README restart bullet: fixed in c2370e4.
- P3, "no cancel on stop" claim: moot.
- Questions:
- kit build: answered, PR body corrected;
- pack frontend extensions: answered, claim narrowed;
- dedupe: removed.
- Unverified:
- Other reviewers in R1:
R2 inline (17)
- P1, reload from a pre-capture snapshot (thread): fixed in 855e0ad. The guard was refined to
prepareForSave()in 7a8026a (R3). - P3, stale definitions on a tab switched during the refresh (thread): fixed in 855e0ad.
- P3, question on
reconnectedtiming (thread): answered as a documented limit in 6f98104. - P3 nits, wrapper name (1, 2): fixed in 6f98104.
- P3, double parse (thread): fixed in 6f98104.
- P3, message remedy (thread): fixed in 6f98104.
- P3 nit, README term (thread): fixed in 6f98104.
- P3, cloud-without-harness row (thread): fixed in 6f98104.
- P3,
DEV_AGENT_DATA_DIRpin (1, 2): fixed in 6f98104. - P3, ordering oracle (thread): fixed in 6f98104, stronger than my suggestion.
- P3 nits, redundant timer hook (1, 2): fixed in 6f98104.
- P3, redundant panel reload assertion (thread): fixed in 6f98104.
- P3, over-built regression test (thread): superseded in 855e0ad by two short tests.
- P3 nit, table title (thread): applied; my wording was still off, and the R3 fix landed in 7a8026a.
R2 body
- P3,
distributioncount: fixed in 6f98104. - P3, PR-body failure-path wording: fixed.
- P3,
__DISTRIBUTION__wording: fixed. - Question, #20971: answered.
- Unverified, auxiliary steps: answered (kept as one unit).
- CodeRabbit's re-mark-stale item: withdrawn.
- christian-byrne's queue-gate disposition: acknowledged, not a code finding.
R3 inline (10)
- P3, path guard vs tracker identity on the capture (thread): fixed in 7a8026a (
prepareForSave()). - P3 nit, stale
reloadCurrentWorkflowJSDoc (thread): fixed in 7a8026a. - P3, P1 test did not pin the capture's position (thread): fixed in 7a8026a.
- P3, unguarded-capture mutation survived (thread): fixed in 7a8026a (
nextgets a real tracker). - P3,
skipAssetScansas the only discriminator (thread): fixed in 7a8026a. - P3 nit, misleading test name (thread): fixed in 7a8026a.
- P3 nit, hand-rolled tracker in
createWorkflow(thread): fixed in 7a8026a. - P3 nit, agentPanel table title (thread): fixed in 7a8026a.
- P3 nit, copied distribution union and optional parameter (thread): declined by the author. The runtime gate refuses cloud on its own, and the fix would touch 17 test callers or add a
build/→src/import. I accept that. - P3,
onAgentEventordering against the hydration hold (thread): fixed in 7a8026a. The new session test fails when the call moves after the hold (I checked).
R3 body (5): still open and non-blocking, unanswered across R4-R12; see "Still open" above.
R4: no new findings.
R5 inline (1)
- P2 (merge gate), 12 new domain-boundary violations after the base merge, which failed CI's Fallow gate and skipped the unit suite (thread): fixed in 40e727c. The agent record approves the four producer domains, those records approve
agent, and the test no longer importsLGraphNode. Reply. - R5 body: christian-byrne's queue-gate comment at
7a8026a2, acknowledged (not a code finding).
R6: no new findings. Reply closed the R5 thread.
R7: no new findings.
- christian-byrne's queue-gate disposition at
40e727cb: acknowledged, not a code finding. - christian-byrne's #21044 browser-proof comment: acknowledged; it touches none of my findings, and #21044 now needs a rebase.
- christian-byrne's approval at
40e727cb: dismissed by the push. - skishore23's merge claim: confirmed.
R8
- P3, the refresh queue never recovers from a rejected pass (inline; confirms dante01yoon's suggestion): fixed in
baa62340(my suggestion verbatim, plus a regression test that fails without the catch; I checked). The author replied in the thread. - dante01yoon's contract question: confirmed for renames, contested for added statuses. It is a backend follow-up, not blocking here.
- dante01yoon's review: his checks agree with mine.
c63c8ee5merged base fixes for the two inherited CI failures; the PR diff is unchanged.
R9: no new findings of my own.
- christian-byrne's review: both of his checks confirmed.
- christian-byrne's toast question: confirmed as a product question for the author, non-blocking; I contested that failures are surfaced twice. The author answered that the command is deliberate and the success toast is wanted, and I accept that.
- christian-byrne's required
distributionsuggestion: contested. It repeats my R3 finding, which I accepted as declined. The author kept the parameter optional for the same reasons. da7baaa7merged the base only. Code and records are unchanged from R8, andboundaries.jsonmatchespnpm architecture:update.
R10: no new findings.
- #17469 merged into
mainat4f1e87df, and the PR now targetsmain. - Code changes since R9: only
baa62340. Domain records unchanged.boundaries.jsonmatchespnpm architecture:update.
R11
- P2 (merge gate), conflict with #20971 over the standalone force-on policy (thread): fixed in
afba402cby adoptingmain's policy. The force-on hunk, its test rows and the README paragraph are gone, thecreateDevAgentConfigrefusal stays, and the title and body are updated. The author replied in the thread. - christian-byrne's
refresh_catalognote: confirmed as a follow-up; it needs a refresh without a reload. Now tracked as FE-3482. - christian-byrne's any-restart note: confirmed as a follow-up. #20971 makes it more pressing, but my R2 proxied-socket concern is still unverified. Now tracked as FE-3483, starting from an
object_infocomparison onreconnected. - christian-byrne's README toast nit: confirmed; fixed in
afba402c.
R12 (this review): no new findings.
- Correction to my R9 reasoning on the required-
distributionsuggestion: the__DISTRIBUTION__ !== 'cloud'runtime gate I cited has left the diff. Onmain, thecreateDevAgentConfigrefusal is the only guard against the standalone harness in a cloud dev server. The decline still holds, becausevite.config.mts:224passesDISTRIBUTIONand the subprocess test pins it. - christian-byrne's re-review: confirmed.
Checks at this head
- PR diff against
mainate7fc8af3: 18 files, +605/-14. It matches R10 except that theagentPanel.ts/agentPanel.test.tshunks and the activation README paragraphs are gone, and the README restart bullet names both toasts. - CI at
afba402c: 93 passed, 32 skipped, none failed or pending. - Local:
fallow audit --changed-since e7fc8af3passes,pnpm architecture:checkpasses, andpnpm architecture:updateleaves no diff.agentPanel.test.ts, the refresh store tests andscripts/vite-config-dev-agent.test.tspass, 129/129.
| export function createDevAgentConfig(env: NodeJS.ProcessEnv) { | ||
| export function createDevAgentConfig( | ||
| env: NodeJS.ProcessEnv, | ||
| distribution?: 'desktop' | 'localhost' | 'cloud' |
There was a problem hiding this comment.
| distribution?: 'desktop' | 'localhost' | 'cloud' | |
| distribution: 'desktop' | 'localhost' | 'cloud' = 'localhost' |
There was a problem hiding this comment.
Good call. A default reads better than the optional parameter. I'll take it in the FE-3482 follow-up so this approval stays on the merged head.
|
|
||
| it( | ||
| 'refuses the standalone harness when the dev server URL selects the cloud distribution', | ||
| { timeout: 30_000 }, |
There was a problem hiding this comment.
That's pretty long for a unit test.
There was a problem hiding this comment.
Agreed. It runs vite.config.mts in a subprocess to prove the derived-cloud refusal end to end. I'll look at a cheaper seam for it in the same follow-up.
| changeTracker: { reset: vi.fn(), restore: vi.fn() } | ||
| changeTracker: createMockChangeTracker() | ||
| }) | ||
| } as Partial<ComfyWorkflow> |
There was a problem hiding this comment.
note to self: Need to hunt down more of these as Partial<>
Summary
Two changes split out of #17469 so that PR keeps to the one backend contract. #17469 is safe to merge on its own: it carries the bound-document draft guard and its fallback for a document that can no longer sync. The local agent needs this PR before a local-agent release. #17469 has merged; this PR targets
main.restart_comfyui. After a successful restart, node definitions are registered again and the open workflow is reloaded, so a node from a pack the agent just installed stops rendering as a missing type. The local agent reportssuccessonly after the restarted ComfyUI answers/system_statsand has served/object_infoagain (Comfy-Org/cloudservices/agent/local/internal/runtime/restartcomfy.go), so the refresh runs as soon as the frame arrives. It lives inagentNodeDefinitionRefreshStore, which outlives the panel and receives typed events through the session'sonAgentEventdependency, so each frame is parsed once. If the refresh fails, the store stays stale and refreshes again on ComfyUI'sreconnectedevent, the same signal the Manager restart flow waits on. Because/wsnormally reconnects before thesuccessframe arrives, that retry only helps when ComfyUI drops again; otherwise definitions stay stale until Refresh Node Definitions or the next restart (stated in the README). A refresh failure is reported once per attempt. A failed workflow reload is not retried: a failed load shows its error dialog, and a rejected load is reported by the load queue asworkflow_load_failure. Restarts that arrive during a refresh are combined into one more refresh.broadcast.go:255,localbus/bus.go:88). A restart made while the panel is closed is therefore not observed. A frame received before the panel closes is still handled, because the store outlives the panel.workflowService.reloadCurrentWorkflowwaits for queued loads and then reloads whichever workflow is active, and passesisCurrent, so a forced reload no longer switches the user back to a tab they left or skips the tab they switched to. The queued load captures the canvas into the active workflow before loading it, so edits the change tracker has not captured yet (agent ops applied through the CRDT follower) survive the reload instead of vanishing from the canvas while the bound document keeps them. This covers the agent refresh, Manager apply-changes and locale change.build/devAgentConfig.tstakes the resolved distribution as a parameter and refusesVITE_AGENT_STANDALONEin a cloud distribution, including one derived from a*.comfy.orgDEV_SERVER_COMFYUI_URL. Panel activation followsmain(feat(agent): mount the agent panel from ComfyUI's agent feature #20971): the panel mounts from ComfyUI'sagentfeature, andVITE_AGENT_STANDALONEforces it on only in development mode.Verification
vite.config.mtsin a subprocess.errorHandler, reload rejection escaping, status unchecked, reload before refresh finishes, noonAgentEventwiring, no canvas capture before the reload, no wait for queued loads, noisCurrent, cloud guard without its standalone half, no cloud gate, no distribution passed tocreateDevAgentConfig.pnpm typecheck,typecheck:browser,typecheck:scripts, oxlint, eslint, format check and knip pass. The agent,src/platform/workflow, Manager, graph and touched script vitest suites pass.