Repository navigation
site: Save workflow action on the run card - #411
Conversation
Adds a Save workflow action (fork-workflows experiment) to completed workflow runs in the chat tool card and the right panel run detail. A dialog prefills the name from the run title, collects a description and a Personal or Organization tier, and creates the saved workflow through the existing forkSavedWorkflows API. After a successful save the action becomes a link to the matching settings page. Closes #326
@codex review |
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. |
Merged origin/main (58f9009, #409 fmt sweep) into the branch as 70d147b. The merge kept the export of SavedWorkflowNameField and the sentence-case-expect comment, which the fmt sweep had removed from main but this PR still needs; verified with the sentence case check (0 issues) and the full vitest and biome reruns. New head: 70d147b. @codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 70d147b032
ℹ️ 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 reviewed 70d147b and flagged two P1 and five P2 findings. This commit fixes all seven: - P1: the saved link hard-coded the user tier, so an organization save pointed at the personal workflows page. The hook now records the tier the save used and the link targets the matching settings page. - P1: a pending organization permission check fell through to Personal. The dialog now holds the submit while the check is pending, shows a loader in place of the tier choice and surfaces the check's error. - P2: the request now goes through buildCreateSavedWorkflowRequest, so the saved name and description are trimmed the same way the editor trims them. - P2: the story plays no longer assert the link href; the vitest tests keep that assertion. - P2: the dialog builds its form values on each render instead of memoizing them. - P2: focus returns to the saved link after the dialog closes instead of being lost with the unmounted Save button. - P2: the tests and stories reuse the MockForkSavedWorkflow fixture instead of restating its fields. The panel test file also restores the checkAuthorization spy it installs, which the shared afterEach does not undo and which leaked a never-resolving mock into the next test.
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 114e380bd8
ℹ️ 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 reviewed 114e380 and flagged one P1 and five P2 findings. P1: the personal link dropped the organization. Personal workflows are organization scoped, so the link now carries the chat's organization for both tiers and the member workflows page reads the org search parameter before its default, which a new page test covers. P2: a failed authorization check left the dialog stuck on Checking organization permission with Save disabled. The hook now distinguishes pending from failed, only a pending answer holds the submit, and a failed check shows its error while Personal stays usable, which a new test covers. P2: closing the dialog without a save lost focus because the dialog prevented the close autofocus before learning the saved link did not exist. The dialog now delegates the event and the hook prevents the default only when the link exists. P2: the denial test seeded a client renderDetail never rendered with. renderDetail now accepts a query client override and the test drives the dialog to prove the seeded denial reached it. P2: the save stories shared a pre-wired query factory. Each story now inlines its own cache entries per FE9. P2: Save sat behind the chat-update gate. Saving creates a new workflow and does not update the chat, so the run detail and the live card render it from the completed run alone, including on archived chats and when the update check is pending or failed. The dashboards in the touched tests and stories now include a MockChatOrganization fixture matching MockChat.organization_id, which the saved link's org lookup needs.
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e8973406a6
ℹ️ 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".
Treat a failed organization permission check like a denied one in the save dialog and prove it in the failed check test. Add pending and failed permission stories to the card and panel story files. Document the shared saved workflow name field. Inline the single-use organization name helper. Correct the dialog comment that claimed only the panel prefills the name. Drop the two card tests that only repeated what the stories and sibling tests already cover.
…orkflow-from-run-card
The save action of issue 326 is built, so the workflows page describes the Save workflow button on a completed run card and run detail, the save dialog, the Personal and Organization choice with its permission check, and the Saved link afterward. The Not built yet section goes away.
@codex review |
|
To use Codex here, create an environment for this repo. |
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 620a311749
ℹ️ 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".
All 8 round-4 findings on 620a311 are answered and resolved. No P1s; the follow-ups are tracked in #413. Requesting a fresh review of the same head. @codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 620a311749
ℹ️ 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".
…mment The saved link now shrinks with the run controls and truncates a long name visually while its accessible name keeps the whole name, with a 128-character name story on the card and the panel and a unit assertion on the accessible name. The dialog comment no longer claims the submit waits for typing, because a valid run title slug already enables it. The exported save controls got their API comments.
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 207e0924fb
ℹ️ 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".
…orkflow-from-run-card
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7131b2b9f2
ℹ️ 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".
…lection A saved workflows URL whose org param names an organization the member does not belong to, or an unknown one, now renders an unavailable state with no tables and no create control instead of falling back to the default organization. An absent org param keeps the default behavior. The page now derives the selection from the URL alone, so back and forward follow it. The saved link's button overrides the Button shrink-0 with shrink so long names still fit the narrow panel.
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ff35bd2dfe
ℹ️ 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".
…orkflow-from-run-card
The unavailable state told the user to pick one of their organizations but rendered no control to do it. It now renders the organization picker whenever the member has any organization, and the text matches what is on screen.
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ccf1245e84
ℹ️ 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".
- Offer Save on an await_workflow or run_workflow card whose result is already completed when the chat loads: the ended card fetches the run's detail once instead of polling and retries transient failures. - The saved-workflows page picker writes push history entries, so back and forward move between the organizations the member viewed. - Recovering from an invalid org keeps focus: both states render the same picker element chain, and the unavailable state takes focus on mount. - Submitting the Organization tier sends the organization scope, and a stale tier selection cannot send an organization write after the permission answer denies or fails. - The saved link renders only when the organization's name is known.
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ba5fe29e7f
ℹ️ 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: 7e20b1979e
ℹ️ 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: 646334bfe6
ℹ️ 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 |
|
Codex Review: Didn't find any major issues. Another round soon, please! 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". |
Merged at head Gates on this exact head:
What this adds: a Save workflow action on the workflow run card and run detail, for both Personal and Organization tiers. It handles the organization permission, links to the saved workflow, works on cards that were already complete when the chat loaded, and handles an unknown Not exercised: a live server and browser session. Everything above is unit and story tests. #413 tracks the deferred cleanups:
Pre-commit hook: the workstream used the worktree-only opt-out from #407 and ran the targeted checks above. |
Closes #326
What
Adds a Save workflow action to completed workflow runs, behind the existing
fork-workflowsexperiment, in two places:ForkWorkflowTool), rendered byForkWorkflowRunControlswhenrun.status === "completed".ForkWorkflowRunDetailsummary), under the same condition.The action opens a save dialog that:
checkAuthorizationgrantscanCreateOrganizationSkillfor the chat's organization.createSavedWorkflowmutation and shows API errors in the dialog viaSkillErrorDisplay.After a successful save the action becomes a read-only link ("Saved <name>") to the matching settings page: personal workflows on
/agents/settings/workflows, organization ones on/ai/settings/workflows?org=\<name>.New files under
site/src/pages/AgentsPage/components/ForkWorkflows/:ForkWorkflowSaveAction.tsx: gating (experiment, non-empty script, organization id, dashboard context) and button/link rendering.useForkWorkflowSave.tsx: dialog state, org permission query, create mutation.ForkWorkflowSaveDialog.tsx: the dialog itself.ForkWorkflowSaveControls.tsx:ForkWorkflowSaveButtonandForkWorkflowSavedLink.Also exports
SavedWorkflowNameFieldfromForkSavedWorkflowEditorDialogso the dialog can reuse it, and threadsorganization_idfrom the chat query into the action.Test evidence
All commands run in
site/on the branch head before push.pnpm exec vitest run --project uniton the four changed test files: 103 passed.ForkWorkflowTool.test.tsx: 12 upstream tests restored plus 8 new save tests (saves personal from card with organization id, name and script asserted on thecreateUserSavedWorkflowcall, then the Saved link href; server error shown in dialog; hidden without script; hidden when the chat is unknown; Organization tier hidden without permission; not shown for running runs; polling keeps working; failed run error shown).ForkWorkflowRunDetail.test.tsx: 7 upstream plus 2 new (saves from the panel with the prefilled name; save hidden without create permission).pnpm test:storybookon both changed story files: 43 passed (24 tool stories including 3 new save stories, 19 run detail stories including the save dialog and saved states).pnpm test:ci src/pages/AgentsPage: 185 files, 3174 passed, 2 skipped.pnpm run lint:types: passed.pnpm exec biome checkon all 16 changed files: passed (import order and formatting fixed withbiome check --write, a11y radio labels fixed to theid/htmlForpattern).main, none in this diff.Pre-commit hook
The pre-commit hook was disabled for the commits in this PR through the documented worktree opt-out (
git config --worktree coder.pre-commit false, per issue #407). Cleanmainat 5c8c0e2 failsmake pre-commitin this workspace: fmt rewrites unrelated files,make genleaves swagger output dirty, golangci reports pre-existing issues and the sentence case check reports the 24 pre-existing findings listed above. The checks the hook would have run were executed manually against the changed files with the results above.