-
Notifications
You must be signed in to change notification settings - Fork 610
feat(frontend): elicitation M1 follow-ups — enum "Other" option + emit-harness coverage #5177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
5da3d20
test(runner): add history-driven client-tool relay integration tests
ardaerzin 66cc1a2
Merge remote-tracking branch 'origin/big-agents' into test/runner-cli…
ardaerzin 2a0a6a1
feat(frontend): add "Other…" custom value to elicitation enum fields
ardaerzin 06a4a0c
test(frontend): add elicitation E2E scaffold with SSE transport mock
ardaerzin dfa8cb0
Merge remote-tracking branch 'origin/big-agents' into test/runner-cli…
ardaerzin 6bc3f51
test(frontend): address review — validate seed ids, consistent scenar…
ardaerzin 963cd80
Merge branch 'big-agents' into fe-feat/elicitation-m1-followups
ardaerzin c2e189c
feat(frontend): support default values on elicitation form fields
ardaerzin 0196a6d
feat(frontend): multi-select fields in elicitation forms
ardaerzin 0affc05
feat(frontend): choice cards for context-ful elicitation options
ardaerzin d665f12
test(frontend): extract and pin the enum controls' decision logic
ardaerzin b8e01fb
test(frontend): one-click-accept E2E spec + dialect decision record
ardaerzin 81f6da0
Merge remote-tracking branch 'origin/big-agents' into fe-feat/elicita…
ardaerzin e56d887
Merge remote-tracking branch 'origin/big-agents' into fe-feat/elicita…
ardaerzin f2ff411
fix(frontend): address review — fold misplaced array options, type-ma…
ardaerzin e37a178
Merge branch 'big-agents' into fe-feat/elicitation-m1-followups
ardaerzin 8df62f5
Merge branch 'big-agents' into fe-feat/elicitation-m1-followups
ardaerzin a640dcf
fix(frontend): dogfooding round — collapsed defaults registered, empt…
ardaerzin c73c41d
fix(frontend): dogfooding polish — subtle selected card, no premature…
ardaerzin 3f6bbf8
feat(frontend): elicitation form drafts survive a reload
ardaerzin 45ed92c
Merge remote-tracking branch 'origin/big-agents' into fe-feat/elicita…
ardaerzin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| # Agent chat — Elicitation E2E (interaction kinds M1, layer A) | ||
|
|
||
| Deterministic Playwright coverage for the `elicitation` interaction kind: emit → render → settle → | ||
| resume → replay, driven by a **transport mock** rather than a live LLM. | ||
|
|
||
| ## How it works | ||
|
|
||
| Auth, the ephemeral project, the seeded agent revision, and the playground shell stay **real**. Only | ||
| the agent run (`**/invoke*`) is intercepted (`mockElicitationInvoke` in `tests.ts`) and fulfilled with | ||
| byte-accurate AI SDK v6 SSE (`assets/elicitationStream.ts`): | ||
|
|
||
| - **1st run** → a paused turn: `request_input` left `input-available` (no output) + the sibling | ||
| `data-render` part (`{kind: "elicitation"}`) → the FE renders the form. | ||
| - **2nd run** (the auto-resume after the form settles) → a normal text turn echoing the values. | ||
|
|
||
| The SSE shapes are pinned against the real producer, | ||
| `sdks/python/agenta/sdk/agents/adapters/vercel/{stream,sse}.py`. The mocked response **must** set | ||
| `Content-Type: text/event-stream` or the FE's negotiating fetch parses it as batch JSON. | ||
|
|
||
| ## Specs (`index.ts`) | ||
|
|
||
| 1. **Round-trip** — form renders, accept resumes with the submitted values (asserts the resume POST | ||
| carried the settled output). Mock-only, no reload. | ||
| 2. **Required-field gate** — empty Accept shows an inline error and does not resume. Mock-only. | ||
| 3. **Settled replay** — after accept, a reload shows the read-only chip. | ||
| 4. **Reload-while-pending** — reload with the form pending, then accept. | ||
|
|
||
| ## First-run seams (resolve against the live stack — do NOT assume) | ||
|
|
||
| These are isolated on purpose; the SSE/transport core above is solid, these need one live pass: | ||
|
|
||
| - **`seedAgentChatApp` (`tests.ts`) — the one hard blocker.** The playground mounts `AgentChatPanel` | ||
| only for an `is_agent` workflow (`Playground.tsx:106`); the base fixture only seeds | ||
| completion/chat. Since `/invoke` is mocked, the agent's config is irrelevant — a **minimal rendered | ||
| `is_agent` revision** is all that's needed. Seed it by replaying the product's create-agent API | ||
| calls (mirror `apiHelpers.createApp`) or by driving the create flow once and capturing the appId + | ||
| latest revision id. The fixture currently throws until this is done. | ||
| - **Composer + field selectors** — `sendChatMessage` and `getByLabel("First Name")` are best-effort | ||
| against `RichChatInput` and the `SchemaForm` DOM; confirm and adjust on first run. | ||
| - **Reload rehydration source (specs 3 & 4)** — a mocked run records no server-side session | ||
| transcript. If reload rehydrates the chat from client persistence these pass as-is; if it loads from | ||
| the server transcript, the mock must also serve the session-history endpoint. Confirm first. | ||
|
|
||
| ## Run one spec (from `web/tests/`, with the stack up) | ||
|
|
||
| ```bash | ||
| AGENTA_LICENSE=oss \ | ||
| AGENTA_WEB_URL="http://localhost:3000" \ | ||
| AGENTA_API_URL="http://localhost:3000/api" \ | ||
| AGENTA_TEST_LLM_PROVIDER=mock \ | ||
| npx playwright test ../oss/tests/playwright/acceptance/agent-chat/elicitation.spec.ts \ | ||
| --workers=1 --retries=0 --headed | ||
| ``` | ||
|
|
||
| Start with spec 1 (round-trip) — it needs no reload and proves the transport-mock pattern end to end. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Remove duplicate assertion line.
Line 389 is duplicated — the same
assert.deepEqualcall appears twice consecutively. This is a copy-paste artifact; the test still passes but the redundant line should be removed.🧹 Proposed fix
assert.equal((s.events[0] as { kind: string }).kind, "client_tool"); assert.deepEqual((s.events[0] as { payload: { render: unknown } }).payload.render, { - assert.deepEqual((s.events[0] as { payload: { render: unknown } }).payload.render, { kind: "elicitation", });📝 Committable suggestion