Repository navigation
feat(chatd): gate the workflow tools to deployment owners - #242
Conversation
The fork-workflows experiment flag is deployment-wide, so with the flag on every member's root chat got run_workflow and await_workflow and could fan out model-backed step children. While the engine is experimental, the tools now require the chat owner to hold the deployment owner role: one primary-key read per gated turn, failing closed when the owner row is missing, with the role change applying on the owner's next turn. There is no escape hatch; widening to members is a later decision. The workflow fixture's chat owner is an owner, and the gate test now drives real chats: owner gets both tools, a member-owned chat and a missing owner row get none, on top of the existing experiment, child, explore, and plan-mode guards.
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. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bf54781ff5
ℹ️ 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".
…sible row - the turn runs under the daemon subject, which has only read_personal on users, so the plain GetUserByID in the owner gate failed for every real turn and the fail-closed branch removed the tools from owners too. The gate now reads the owner row as the system-restricted actor, the way UserRBACSubject reads roles for the same purpose. - MemberOwnerGetsNothing inserted a chat whose owner row does not exist, which dies on the chats.owner_id foreign key before the fail-closed assertion runs; the stale-owner case is now an in-memory chat value, which is all the gate reads.
|
@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". |
Merge gates on head 3a7d0ae:
With this gate in place, fork-workflows can be enabled for deployment owners only. |
Part of #226. Third PR of the chat-workflows stack, and a prerequisite for turning the
fork-workflowsexperiment on anywhere.What this adds
The experiment flag is deployment-wide, so with it on, every member's root chat got
run_workflowandawait_workflowand could fan out model-backed step children. While the engine is experimental,forkWorkflowToolsnow also requires the chat owner to hold the deployment owner role:appendForkToolsonly passes the ctx it already has.Tests
TestForkWorkflowToolsGatenow drives real chats: owner gets both tools (RootTurnGetsBothTools), a member-owned chat gets none (MemberOwnerGetsNothing), a missing owner row fails closed, flag-off gets none, plus the existing child, explore, and plan-mode guards, which now use variants of a real parent so each guard is isolated. The workflow fixture's chat owner is an owner so the engine tests keep working. Negative control to follow in an ops slot (chatd tests cannot link on the host).Notes for reviewers
run_workflowtool result itself showssteps: []withstatus: running(the snapshot precedes the re-executed spawns); thereused: truestep list appears in theawait_workflowresult. Carried over from the UAT-238 review of feat(chatd): add the workflow run engine behind fork-workflows #238.