Skip to content

feat(desktop): answer structured form interactions - #4384

Open
me2seeks wants to merge 10 commits into
feat/4364-runtime-form-interactionsfrom
feat/4364-desktop-form-interactions
Open

feat(desktop): answer structured form interactions#4384
me2seeks wants to merge 10 commits into
feat/4364-runtime-form-interactionsfrom
feat/4364-desktop-form-interactions

Conversation

@me2seeks

@me2seeks me2seeks commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • render Runtime Host-owned structured form interactions in the Desktop composer for both the main conversation and Side Chat
  • preserve omitted optional fields separately from explicit empty or false values, while validating all six primitive field kinds through the shared core contract
  • decode renderer responses at the IPC boundary and retire prompts only after Host settlement or its projected acknowledgement

Why

PR #4379 establishes the durable form interaction contract and Runtime Host continuation authority. Desktop still needs a surface adapter so a tool can collect bounded structured input without falling back to an untyped text question or inventing a second pending-interaction owner in the renderer.

This PR is stacked on #4379 and implements the Desktop slice of the rollout in #4364. It does not add provider-specific form state or change the MCP wire path.

Screenshots

Before, Desktop could only render the fixed question prompt. After, the same composer slot renders a structured form, preserves optional field intent, and reports field-local validation errors.

Before: fixed question prompt After: structured form prompt
Desktop fixed question prompt before this PR Desktop structured form prompt after this PR

Usability states

Optional field included with explicit true Field-local validation after submit
Optional boolean inclusion and explicit true value Invalid string value with field-local error

Test plan

  • npm run build
  • 122 focused UI/Desktop interaction tests
  • 45 focused storage tests with a non-worktree temporary directory
  • Storybook interaction check at 1440x900: defaults, optional boolean inclusion/value, invalid required string

Part of #4364.

@me2seeks
me2seeks force-pushed the feat/4364-desktop-form-interactions branch from f6247a5 to b814c29 Compare August 31, 2026 17:50
@me2seeks
me2seeks force-pushed the feat/4364-desktop-form-interactions branch from b814c29 to 661ee44 Compare August 31, 2026 17:56
@me2seeks
me2seeks force-pushed the feat/4364-desktop-form-interactions branch from 828699d to 098cac3 Compare August 31, 2026 19:03
@github-actions github-actions Bot added the effort/XL Over 1000 readable lines label Sep 1, 2026

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR #4384098cac3 — blind review sealed

Summary: Desktop structured-form answer surface stacked on #4379. Exact head 098cac3a547454b51cf0a37c36b775024583ddc9 frozen. Source is approvable with comments; inherits #4379's 2×P2+1×P3. No simplify finding. Full build passed; 91 focused Desktop/UI tests passed; exact-head hosted test green. 0 reviews/0 threads on stacked base; mergeable on stacked base.

Findings (reproducible):

  • P2 — drafts reset on fields identity change — form resets drafts when fields array identity changes. Runtime Host recovery republishes same pending request as freshly projected objects; React DOM probe typed release-candidate, rerendered clone with same request ID → input became empty. Any pending-set change can trigger. Fix: reset only on stable requestId/semantic revision, add recovery regression.
  • P2 — constraints not rendered — surface enforces minimum/maximum, length, cardinality, format but renders only generic invalid message. Production render of integer min=max=997 + date-time field contained neither 997 nor date-time, so legal opaque forms can be undiscoverably unanswerable. Fix: render visible/accessible constraint help and cover formats/ranges.

Gating: hosted test green on stacked base; full stack inherits #4379 risk. Direct current-main merge has explicitly ignored epoch conflict plus generated inventory conflicts (base stack not landed) — not retained as finding.

Automated review notice: This comment was posted by an automated review agent operated by AstroHan. It is not an independent human review and does not replace one.


简体中文

本条结论来自 @捣蛋鬼 在 exact head 098cac3 的独立盲审,已按 @me2seeks 指示排除 compatibility epoch 冲突的计分。编排仅核对 head 未漂移与 CI 状态。

@me2seeks
me2seeks force-pushed the feat/4364-desktop-form-interactions branch from 098cac3 to 28ad94a Compare September 1, 2026 08:26
@me2seeks

me2seeks commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Fixed both findings in 28ad94a. Draft state is now keyed by requestId, so a recovery projection of the same request keeps local edits while a different request resets them. Field constraints are rendered visibly and linked to their field group through aria-describedby.

Added a DOM regression covering cloned fields, request replacement, ranges, formats, and accessible descriptions.

@me2seeks
me2seeks requested review from ARE404, Astro-Han and M4n5ter and removed request for ARE404 and Astro-Han September 1, 2026 14:49
Define a bounded provider-neutral primitive form contract and carry its request and acknowledgement facts through the Runtime Event Log. Broker pending forms through the existing InteractionStore authority so schema-invalid answers remain pending, concurrent equivalent answers converge on one canonical outcome, and Turn closure or Host restart closes the exact continuation.

Part of #4364.

Generated-by: OpenAI Codex
Expose one closed decoder for renderer-to-runtime form responses so surface adapters do not copy protocol validation. Queue the same canonical continuity refresh for form requests that user questions already receive.

Refs #4364.

Generated-by: OpenAI Codex
@me2seeks
me2seeks force-pushed the feat/4364-desktop-form-interactions branch from 28ad94a to 5bf55c9 Compare September 1, 2026 15:04
@me2seeks

me2seeks commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

The previous CI failure was the renderer architecture ledger after the rebase, not a form test failure. This head refreshes that ledger and retains the form variant in the composer interaction union alongside main's Goal projection ownership. Local full build, renderer architecture check, UI form regression, and AppShell response regression pass.

Render the Host-owned primitive form contract in the shared composer slot for both the main conversation and Side Chat. Preserve optional omission separately from explicit values, validate through the shared core contract, and expose cancel, decline, and accept without introducing surface-owned continuation state.

Decode renderer responses at the Desktop IPC boundary, settle them through Runtime Host, and retire prompts only after the authoritative answer succeeds or its acknowledgement is projected. Cover all six field kinds, malformed responses, reconnect hydration, and both Desktop surfaces.

Part of #4364.

Generated-by: OpenAI Codex
Route main-surface form answers through the existing Desktop platform adapter, expose test-only companion helpers from the Workbar testing entry, and keep legacy AppShell debt monotonic while sharing response settlement behavior.

Add focused coverage for answer acceptance and failure retention.

Part of #4364.
Refresh the generated Astryx surface inventory for the aligned structured-form prompt.

Part of #4364.
Keep the Session Workbar Storybook services aligned with the required structured-form response capability.

Part of #4364.
@me2seeks
me2seeks force-pushed the feat/4364-desktop-form-interactions branch from 5bf55c9 to addd05b Compare September 1, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/XL Over 1000 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants