Repository navigation
feat(site): offer saved workflows in the composer @ menu - #397
Conversation
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.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 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".
@codex review |
There was a problem hiding this comment.
💡 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.
@codex review |
There was a problem hiding this comment.
💡 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.
@codex review |
There was a problem hiding this comment.
💡 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".
@codex review |
There was a problem hiding this comment.
💡 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".
@codex review |
There was a problem hiding this comment.
💡 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".
@codex review |
There was a problem hiding this comment.
💡 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".
@codex review |
There was a problem hiding this comment.
💡 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".
@codex review |
There was a problem hiding this comment.
💡 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".
@codex review |
There was a problem hiding this comment.
💡 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".
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.
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
@codex review |
There was a problem hiding this comment.
💡 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.
@codex review |
There was a problem hiding this comment.
💡 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".
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.
@codex review |
There was a problem hiding this comment.
💡 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.
@codex review |
There was a problem hiding this comment.
💡 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.
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
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.
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
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. |
Merged at head Gates on this exact head:
Tests I ran on
Review notes:
Not exercised: the menu in a browser on a dev build. Coverage uses mocked API calls. |
Closes #328
Offer saved workflows in the composer @ menu, next to agent types.
What changed
ForkAgentMentionPlugin.tsx) offers saved workflows after@in the chat composer, in personal then organization tier order, filtered as you type.run_workflowtool call:Run the <name> saved workflow (run_workflow name <name>) with args: <summary>.The summary is the union ofargs_schemaproperty names and required names, with required ones marked; no summary means the workflow takes no args the menu can name.fork-workflowsexperiment 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 whenfork-agent-definitionsis off.general,explore,computer_use), so one@namecannot 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.ForkSavedWorkflowSchema, and both the create and the update request narrowargs_schemato that object shape. The generatedargs_schemafields areunknown.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.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-warningson the touched files: clean.pnpm exec oxlinton the touched files: 0 warnings, 0 errors.pnpm exec tsc -p . --noEmit: clean.flock ~/.fork-go.lock go test ./scripts/apitypings/: passed.Not verified
root_chat_idhandling covered by unit tests only.run_workflowis not distinguished from a general agent by the menu; only its explore or general base type is.