Skip to content

feat(site): offer saved workflows in the composer @ menu - #397

Merged
ibetitsmike merged 29 commits into
mainfrom
mike/issue-328-workflows-mention-menu
Nov 21, 2026
Merged

ibetitsmike merged 29 commits into
mainfrom
mike/issue-328-workflows-mention-menu

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Coder Agents opened this PR on behalf of @ibetitsmike.

Closes #328

Offer saved workflows in the composer @ menu, next to agent types.

What changed

  • A new mention plugin (ForkAgentMentionPlugin.tsx) offers saved workflows after @ in the chat composer, in personal then organization tier order, filtered as you type.
  • Selecting a workflow inserts text naming the run_workflow tool call: Run the <name> saved workflow (run_workflow name <name>) with args: <summary>. The summary is the union of args_schema property names and required names, with required ones marked; no summary means the workflow takes no args the menu can name.
  • Workflows show when the fork-workflows experiment is on and the chat can run them: a root chat that is not in plan mode, not an explore chat, and not a child. The gate covers an existing chat and a new chat whose composer has plan mode on or an explore-based agent type picked (including while the agent type catalog reloads). The workflow menu keeps working on its own experiment when fork-agent-definitions is off.
  • Workflow options hide behind any agent mention of the same name and behind reserved agent type names (general, explore, computer_use), so one @name cannot be ambiguous. Cached workflow rows and their status flags are masked by the same gate, so a plan, explore or child chat sees no stale workflows from the shared query cache.
  • Enter is held while the menu shows nothing selectable and the agents or workflows are loading or failed, so an unfinished mention is never sent.
  • The args schema of the saved workflow API is typed through ForkSavedWorkflowSchema, and both the create and the update request narrow args_schema to that object shape. The generated args_schema fields are unknown.

Tests

  • pnpm exec vitest run --project=unit src/pages/AgentsPage/components/ChatMessageInput/ src/api/queries/forkSavedWorkflows.test.ts src/pages/AISettingsPage/ForkWorkflowsPage/: 8 files, 197 passed. The plugin file covers tier order, schema summaries (properties, required-only, mixed), the workflow gate for a child chat, plan mode, an explore chat, a new chat in plan mode and a new chat as an explore-based agent, name dedupe against agent mentions and reserved types, query filtering, the workflows-only mode, and the Enter guard while workflows load or failed.
  • Storybook interaction tests (vitest --project=storybook) on the mention menu stories and the workflows page stories: 10 files, 121 passed, including the agent-only and workflows-only empty states.
  • pnpm exec biome check --error-on-warnings on the touched files: clean.
  • pnpm exec oxlint on the touched files: 0 warnings, 0 errors.
  • pnpm exec tsc -p . --noEmit: clean.
  • flock ~/.fork-go.lock go test ./scripts/apitypings/: passed.
  • Negative controls, each reverted after the run: removing the child-chat gate failed its test, removing the plan-mode gate failed its test, removing the new-chat gates failed both new-chat tests, and removing the required-name union failed the mixed schema test.

Not verified

  • No runtime browser check and no e2e test ran for this PR.
  • The child-chat project tier relies on root_chat_id handling covered by unit tests only.
  • A custom agent whose tool policy drops run_workflow is not distinguished from a general agent by the menu; only its explore or general base type is.

Adds a Workflows group to the @ agent menu of ChatMessageInput, behind the
fork-workflows experiment and root chats only. It lists the personal and
organization saved workflows the user may read, with descriptions, the tier
label, and the run_workflow args an args schema implies, and inserts a
request to run the chosen workflow by name, naming its arguments when it
has any. Organization names a personal workflow hides are deduped as
run_workflow resolves them, and an unloaded tier list hides the tiers after
it. Loads and failures of both sources surface in the menu status line, and
Enter stays blocked while either is loading or failed.
Address review findings on the workflows mention menu:

- Parse args_schema as JSON on the wire (json.RawMessage), not a string,
  so arg summaries show instead of 'no args' for every workflow.
- Offer workflows when fork-agent-definitions is off: gate agent queries
  and mentions on a separate canOfferAgents flag.
- Split the loading label into Loading agents and Loading workflows.
- Name the run_workflow tool call in the inserted workflow text.
- Tighten the dedupe test to assert exactly one option per workflow.
- Use the real args_schema object shape in the shared mock helper.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T08:43:42.483315Z d072a70 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: ca751ec02f

ℹ️ 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".

@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

@codex review

@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: ca751ec02f

ℹ️ 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".

… schema

Address the Codex review findings:

- Offer no workflows in plan mode or an explore chat, which chatd also
  excludes from run_workflow, and hide cached workflows behind the gate
  so a shared query cache cannot leak them into a gated chat.
- Hide a workflow whose name an agent mention already takes, so one
  @name cannot mean both delegate and run.
- Summarize a schema that lists required without properties instead of
  calling it arg-free, which run_workflow would reject.
- Fix the generated args_schema type to unknown through the apitypings
  override, add a typed ForkSavedWorkflowSchema boundary, and drop the
  as-unknown-as casts in the fixtures.
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

@codex review

@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: faed5a7aeb

ℹ️ 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".

…state

Address the second Codex review round:

- Mask workflow and agent query status with their capability gates, so a
  cached error or fetch from another page cannot announce a workflow
  error or hold Enter in a gated or agent-only menu.
- Show No workflows match that query when agents are not offered, and
  keep No agents match that query when workflows are not offered.
- Drop the string-valued args schema fixture and its compatibility
  parsing: the backend returns properties as an object and required as
  an array.
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

@codex review

@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: 536e7858b2

ℹ️ 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".

@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

@codex review

@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: 33cbc10e7f

ℹ️ 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".

@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

@codex review

@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: af61063bff

ℹ️ 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".

@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

@codex review

@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: 01858b33b9

ℹ️ 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".

@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

@codex review

@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: b31cdceef2

ℹ️ 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".

@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

@codex review

@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: 1c2b6fa6a8

ℹ️ 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".

@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

@codex review

@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: 35ce753e46

ℹ️ 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 site/src/api/typesGenerated.ts Resolved
A model, project or workspace change switches the agent-types query key
and briefly leaves the catalog undefined, which made every retained
general selection read as explore and hid saved workflows. The known
built-in names now resolve directly; only unknown names keep the
conservative gate while the catalog loads.
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 98b3468464

ℹ️ 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".

@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

@codex review

@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: 15a33a881b

ℹ️ 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".

A failed background refetch keeps the cached agent list usable while
TanStack Query reports isError, so the old unconditional predicate hid
options and swallowed Enter for an unmatched @ query. Match
hasWorkflowError: block only when the failed result has no data.
Rewrites the cached-agents regression test to wait on the query error
state instead of UI text.
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

@codex review

@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: e6a7cbd346

ℹ️ 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 scripts/apitypings/fork_workflow_run.go Resolved
Restores the required trailing newline on fork_workflow_run.go that the
last commit dropped. Rewords the WorkflowMention.argsSummary doc so an
empty summary means the schema names no args, not an arg-free contract:
a missing args_schema still accepts any args object.
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

@codex review

@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: ecbe934d7b

ℹ️ 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".

A schema property name can contain a comma or a newline, so the summary
now JSON-stringifies each name before joining, keeping one entry per
argument. Renames the schema-less workflow test so its title no longer
claims a missing args_schema means no args.
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

@codex review

@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: 84bea8a354

ℹ️ 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".

The both-tiers test only inserted the personal workflow, so a regression
that dropped every organization result would still pass. It now reopens
the menu and inserts the org workflow too, asserting its composer prompt.
Adds a workflow row whose args summary is long enough to wrap, so the
two-line clamp of the args text is exercised in the story snapshots.
Typing @ directly after an insertion raced the typeahead trigger, which
flaked the new both-tiers assertion in CI. A space before the @ makes
the trigger match a line start unconditionally, and the expected value
keeps the double space that produces.
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 30b7146cf3

ℹ️ 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".

@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

Re-ran fork-ci on head 30b7146 after the flaky agent-sdk test failure.

Empty push to retrigger fork-ci, whose previous run on 30b7146 failed
only on the flaky TestWatcher_MovedWatchDirsDoNotBlockEventLoop, which
passes locally with -count=2.
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: d072a70440

ℹ️ 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".

@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

All gates are green on head d072a70:

Test evidence run in this worktree: vitest 121 tests (ChatMessageInput + ForkAgentMentionPlugin), 12 storybook tests (ForkAgentMentionMenu), 34 AgentCreateForm tests, tsc clean, biome clean, go test ./agent/agentcontext/ and ./scripts/apitypings/ pass under flock. Not exercised: browser UAT. One prior fork-ci failure on 30b7146 was the known flaky TestWatcher_MovedWatchDirsDoNotBlockEventLoop in agent-sdk; it passes locally with -count=2 and the rerun on d072a70 is green.

@ibetitsmike
ibetitsmike merged commit 5c8c0e2 into main Nov 21, 2026
9 checks passed
@ibetitsmike
ibetitsmike deleted the mike/issue-328-workflows-mention-menu branch November 21, 2026 08:46
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Coder Agents acted on behalf of @ibetitsmike.

Merged at head d072a70440c51b89b0c0827a6b960191fced8d1f as 5c8c0e2, on main 415b6b58be0e509a6f2249f4334ee27a9cce9bd2, with the server running that main.

Gates on this exact head:

  1. The head matched the SHA I verified (--match-head-commit).
  2. Every check run passed. fork-ci run 44884864171 passed on this head.
  3. Codex receipt for this head: feat(site): offer saved workflows in the composer @ menu #397 (comment) ("Didn't find any major issues").
  4. No unresolved review thread.
  5. 0 commits behind main.
  6. I ran the tests below on this exact head.

Tests I ran on d072a70440:

  • pnpm exec vitest run --project unit on AgentsPage/components/ChatMessageInput and AgentsPage/components/AgentCreateForm: 6 files, 186 tests passed.
  • Negative control: with the inserted prompt missing the run_workflow name, 7 tests fail. The source was restored after it.
  • A second control did not fail: removing the name check in the tier dedupe loop of ForkAgentMentionPlugin.tsx. The test "hides an organization workflow that a personal one hides" still passed, so another filter may also cover that path. I did not trace it further.
  • The workstream ran 12 storybook tests for ForkAgentMentionMenu, tsc, biome, and go test ./agent/agentcontext/ ./scripts/apitypings/.

Review notes:

  • With fork-workflows on, typing @ in the composer offers the user's readable saved workflows next to agent types. Personal ones come first and hide an organization workflow of the same name, matching how run_workflow resolves names. Choosing one inserts a prompt that asks the agent to run that workflow by name.
  • With the experiment off, the menu shows only agent types, as before.

Not exercised: the menu in a browser on a dev build. Coverage uses mocked API calls.

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.

site: saved workflows in the composer @ menu

1 participant