Comfy-Org / Comfy-Org/ComfyUI_frontend

test(agent): browser spec for follower S1/S2 ops on graphs with existing subgraphs

Open
#17,224 0 comments 0 reactions 1 assignee Claimed by @christian-byrne View on GitHub
area:subgraph audit:testing
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

Add a browser test that drives the agent follower with a synthetic subgraph frame, so S1 host widget writes and S2 promoted connects are covered end to end, not only in unit tests.
Blocked on nothing; deferred from #17202 so the 1.54 fix could land on unit tests alone.
Two specs, both through the existing WebSocket fixture; no model call.

Full context for agent readers

**Why**

[PR #17202](https://github.com/Comfy-Org/ComfyUI_frontend/pull/17202) fixes two follower paths that dropped or misrouted agent ops on graphs with existing subgraphs:

- S1: an agent `set_widget` on a `SubgraphNode` host's promoted widget (cmp writes the host's opaque widget array as a whole value).
- S2: an agent `connect` whose target is a `SubgraphNode` promoted input, resolved by declared name first and doc index second.

It ships with unit tests in `src/workbench/extensions/agent/crdt/` (36 files, 508 tests at head `03ed0b00c0`). The blind review on that PR noted an in-repo deterministic browser test is feasible, so this issue tracks it.

**Plan**

Reuse `browser_tests/tests/agent/agentPanelMocks.ts` (thread/turn/workflow ids, `AgentWsEvent` shapes) and `browser_tests/fixtures/ws.ts` (`webSocketFixture`) to deliver a synthetic cmp frame to a page whose canvas already contains a `SubgraphNode` with one promoted widget and one promoted input.

1. `agentSubgraphHostWrite.spec.ts` (S1): frame carries an opaque host widget array change; assert the host widget value on the live `SubgraphNode` and that the interior node is untouched.
2. `agentSubgraphPromotedConnect.spec.ts` (S2b): frame carries a connect whose target is the host's promoted input by declared name, with the doc slot order shuffled relative to the definition; assert the link's target slot name, not index.

Fixture frames should be produced offline by cmp `applyOps` and checked in as JSON so cli and cmp can regenerate them from their own tests.

**Design doc**

Notion TDD, "Playwright plan" section: https://www.notion.so/3d16d73d365081719b85ed515af98276

**Related**

- #16932 materializer follow-ups from #16922
- Linear FE-2033 / BE-10305 (PM scope: S1 and S2 immediate)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.