Repository navigation
fix(chatd): saved workflow polish from the #338 review - #383
Conversation
Reword the list_workflows description so it is true for org admins and auditors, fix the validateSavedWorkflowArgs comment and say "args" in the args-path out-of-range number error, mention "name" in the script field description and the empty-input error, reject hidden characters in saved workflow descriptions with the phase-name rule, cap run args at 64 KiB like the script, and document the phase-name Cf rule and the args cap in ARCHITECTURE.md. Tests: a description with a bidi or zero-width character is rejected on create and update, args over 64 KiB are rejected for inline and named runs, a resume after an edit or delete of the saved workflow replays the journaled script, and an org admin subject sees a private organization workflow in list_workflows while a plain member does not.
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: fafb41e3b6
ℹ️ 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. Keep them coming! 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". |
The cap ran before the journal lookup, so a journaled run with larger args from an older version could not replay after a restart. Move the check after the journal lookup and drop the stale comment claim that a resumed run passes through it.
Update after the Codex review of fafb41e:
New head: d07cf8bf4707438a9455f91a5f4d1e514be89184. Waiting on checks and a fresh Codex receipt for that head before this is merge-ready. |
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! 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". |
…rkflow-polish-15f5af72
Merged origin/main (b25a79b, #382 view_image follow-ups) into the branch. No conflicts; the merge touched only files #382 owns. Build and all chatd tests pass on the merge commit. New head: e97d257, so checks and the Codex receipt below now apply to the previous head only. |
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! 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". |
The description check reused the phase-name rule, which rejects every control character, so a multi-line description with a newline or tab got 400 where main accepted it. Add chatd.ValidateWorkflowDescription, which keeps the phase-name rule but allows \\n, \\r and \\t, and use it for the create and update paths. Also fix two review gaps: list_workflows lists the organization workflows that the owner can read, not the ones shared with the owner, and the script_path description mentions name.
Fixes from the lead review of e97d257, one commit 5a1cb79:
New head: 5a1cb79. A fresh Codex receipt for this head follows. |
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5a1cb79d24
ℹ️ 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 Re-requesting a review of head 5a1cb79. The one P2 finding from the last review of this commit (U+FFFD normalization of an invalid UTF-8 byte by the shared request decoder) was answered and its thread resolved; nothing is open. |
|
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". |
…rkflow-polish-15f5af72
make gen on the merge commit reorders the fork experiment keys in the generated swagger to the order codersdk declares them and refreshes mise.lock for the pnpm platforms the lockfile tool now records.
@codex review Reviewing head 5f0a277, which merges origin/main (the upstream sync) into the branch and regenerates the API docs. The one P2 from the earlier review of 5a1cb79 (U+FFFD normalization by the shared request decoder) was answered and its thread resolved; nothing is open. |
|
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". |
The mise.lock hunk in the regeneration commit came from installing helm through mise in this workspace, not from make gen. Revert it.
@codex review Reviewing head 7bff294, which only restores mise.lock to main; the mise.lock hunk in the previous commit came from a local tool install, not from make gen. No Go changes since 5f0a277, which was reviewed clean. |
|
Codex Review: Didn't find any major issues. Breezy! 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:
Tests I ran on
Review notes:
Not exercised: a live saved workflow run started by name from a chat on a deployed server. |
Closes #352
What changed and why
Small follow-ups from the review of #338 (saved workflows), each confirmed against current
mainafter #379 and #380:listWorkflowsDescriptionnow says "the organization workflows that you can read" instead of "shared with you", which is also true for org admins and auditors.validateSavedWorkflowArgs: the comment now says the out-of-range number check runs on the raw input while the schema check validates the re-marshaled args.rejectOutOfRangeNumberstakes the subject wording, so the args path says "the args contain" where the report path says "the report contains".run_workflow: thescriptfield description says "Send this, script_path or name." and the empty-input error says "script is required: send script, script_path or the name of a saved workflow".chatd.ValidateWorkflowPhaseName, on create and update in both route files.run_workflowcapsargsat 64 KiB, the script cap, for inline and named runs alike, checked on the raw input bytes in the tool path and the marshaled value on the direct path. The tool description lists the cap next to the other limits.How it was tested
All Go commands ran under
flock ~/.fork-go.lock:go build ./coderd/...andgo build ./...pass.go test -count=1 ./coderd/x/chatd/...passes, all 21 packages.go test -count=1 -v -run 'SavedWorkflow|Workflow' ./coderd/x/chatd/passes, 29 top-level tests.go test -count=1 -run 'TestForkUserSavedWorkflows|TestForkOrganizationSavedWorkflows' ./coderd/passes.coderd/fork_saved_workflows_test.go), args over 64 KiB are rejected for inline and named runs (TestForkWorkflowLimit/ArgsSize,ArgsSizeByName), a resume after an edit or delete of the saved workflow replays the journaled script (TestForkSavedWorkflowTools/ResumeUsesJournaledScript/{Edit,Delete}), and an org admin subject sees a private organization workflow inlist_workflowswhile a plain member does not (TestForkSavedWorkflowsOrgAdminListsPrivate).golangci-lint runandparalleltestctxshow no new findings on the changed files;TestForkPluginPackEnablementfails in the full./coderd/run on cleanmaintoo (context deadline under load) and passes when run alone, so it is a pre-existing flake unrelated to this PR.Stays behind the
fork-workflowsexperiment. No migration, nosite/changes.