Skip to content

Add custom React views to workflow runs - #7

Merged
sergeyzenchenko merged 6 commits into
mainfrom
codex/custom-react-workflow-ui
Aug 26, 2026
Merged

Add custom React views to workflow runs#7
sergeyzenchenko merged 6 commits into
mainfrom
codex/custom-react-workflow-ui

Conversation

@sergeyzenchenko

@sergeyzenchenko sergeyzenchenko commented Aug 26, 2026

Copy link
Copy Markdown
Member

Summary

  • add typed .ui.tsx authoring APIs for input views and replayable result views
  • compile workflow code and browser UI as separate graphs with independent definition and UI build hashes
  • persist immutable UI assets and props through journals, registries, inline runs, MCP runs, resume, and child workflows
  • supersede changed same-key human requests and reject answers to obsolete request IDs
  • serve only journal-associated UI bundles through a CSP-protected sandbox frame
  • render custom views in Workflow Manager with host-owned candidate confirmation, standard form/raw output fallbacks, timeouts, error handling, and per-frame disable controls
  • add a runnable examples/09-custom-react-ui workflow covering result views, custom human input, and a composed final presentation, plus a key-feature coverage matrix for all examples
  • add five minimal cookbook workflows covering all 67 public workflow APIs, with an SDK-derived coverage check that fails CI when the API or examples drift
  • enforce compiler-owned dependency provenance, cancel stale frame initialization, and share a 512 KiB UTF-8 props limit across runtime and Workflow Manager
  • preserve custom input views when Engine.pending() reconstructs root or descendant requests after restart
  • document the feature, execution boundary, replay behavior, and remaining browser verification matrix

Important behavior

  • workflow components can stage candidate answers but cannot resume a run directly
  • the server-side answer schema remains authoritative
  • ctx.ui.render() is a separate replayable step, so visual presentations do not invalidate their producing computation
  • UI steps never use reuse-by-key salvage when props or view revision change
  • generic blob routes cannot be used to execute arbitrary JavaScript

Validation

  • pnpm lint
  • pnpm typecheck
  • pnpm build
  • pnpm verify:examples (67 public workflow surfaces mapped)
  • focused custom UI core/compiler tests: 72 passed
  • gate example/compiler suite: 66 passed
  • npx tsx examples/09-custom-react-ui/main.ts (offline compile, suspend, answer, replayable presentations)
  • Workflow Manager tests: 58 passed
  • unrestricted full suite: 908 passed, 1 skipped

Browser verification

The implementation has daemon-frame and Workflow Manager integration coverage, but this environment did not expose the persistent JavaScript REPL required for a real Playwright painted-browser pass. The implementation article explicitly keeps the Chromium/Firefox/WebKit isolation and visual matrix as a pre-production verification requirement rather than claiming it was completed here.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 68b49aa7f9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/gate/src/ui-bundle.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1a8f155dad

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/ui/src/components/molecules/WorkflowViewFrame.tsx

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bcb09225a5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/core/src/runtime.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: af869ef4a6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/core/src/runtime.ts
@sergeyzenchenko
sergeyzenchenko merged commit a60a574 into main Aug 26, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 73dab300a3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

<span>
{presentation.asset.id} · revision {presentation.asset.revision}
</span>
<button type="button" onClick={() => setStatus("disabled")}>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Close the frame channel when disabling the custom view

When a user disables a loading or ready view, this only changes React state; it does not invalidate initialization, clear readyTimer, or close the MessageChannel. Consequently, a loading view's timeout can later set the status to error and remount the iframe without user action, while an input view that already received its port can continue sending candidates after being disabled. Route this action through the same channel/timer cleanup used for identity changes before setting disabled.

Useful? React with 👍 / 👎.

Sign up for free to 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