Skip to content

feat: let members run workflows in their own chats - #261

Merged
ibetitsmike merged 3 commits into
mainfrom
mike/chat-workflows-member-access
Nov 13, 2026
Merged

ibetitsmike merged 3 commits into
mainfrom
mike/chat-workflows-member-access

Conversation

@ibetitsmike

Copy link
Copy Markdown
Owner

Xum opened this PR on behalf of @ibetitsmike.

Part of #226

Members can now run workflows in their own chats. Until now the fork-workflows tools and the run API worked only when the chat owner held the deployment owner role (#242). This PR removes that role check, so a run follows the access rules of its chat:

  • Run tools. run_workflow and await_workflow are offered on every root chat turn outside plan mode and explore mode, whatever role the chat owner holds. await_workflow and the stop still resolve a run only through its own chat ID, so one chat never reads or stops another chat's run.
  • Run list, detail and stop API (feat: workflow run list, detail, and stop API #258). The owner-role check is gone. ExtractChatParam already authorizes the chat read through dbauthz, so whoever cannot read the chat gets a 404, and the stop still authorizes as a chat update first.
  • Workflows tab. The tab no longer checks for the owner role. It shows on a root chat with at least one run, for any user who can read the chat.

Everything stays behind fork-workflows. Saved workflows are not on main yet, so they need no tier rules here. docs/fork/pstack-adapter.md says nothing about workflow access, so it is unchanged.

Tests

  • TestForkWorkflowToolsGate/MemberRunsAndStopsOnlyInOwnChat: a plain member gets both tools and starts a run through run_workflow. Another member's chat cannot await or stop that run. The owner of the chat stops it, and await_workflow then reads stopped.
  • TestForkWorkflowRunsRoutes/MemberOwnChatOnly: a member lists and reads the runs of their own chat and stops a running run (the journal says stopped). Another member gets a 404 on the list, the detail and the stop, and the run stays running after that refused stop. The member also gets a 404 on the deployment owner's chat.
  • The workflow fixture no longer grants the owner role, so every existing workflow engine test now runs as a member.
  • With the old owner gate restored, both new subtests fail.

The fork-workflows tools, the run list and detail API and the stop path
no longer require the chat owner to hold the deployment owner role. A
run belongs to its chat, so the chat's access rules cover it: the owner
of a chat runs, awaits, reads and stops its runs, and nobody reaches the
runs of a chat they cannot read. The Workflows tab shows for members too.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 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-13T00:15:13.297197Z aaccdd8 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: 9dc852f6e7

ℹ️ 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 coderd/fork_workflow_runs.go Resolved
A run ID of a chat the caller cannot read failed authorization in the
run detail and answered 500 with the denial; it now answers 404 like a
missing run. A Vitest covers the Workflows tab on a member's root chat.
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum posted this on behalf of @ibetitsmike.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 45e475c4d3

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

Xum posted this on behalf of @ibetitsmike.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: aaccdd8129

ℹ️ 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
ibetitsmike merged commit 0896529 into main Nov 13, 2026
9 checks passed
@ibetitsmike

Copy link
Copy Markdown
Owner Author

Xum merged this PR on behalf of @ibetitsmike.

Merge evidence for head aaccdd8129:

  • fork-ci run 43335052211 succeeded on this head, and all check runs succeeded.
  • Codex reviewed aaccdd8129 and found no major issues. No review threads are unresolved.
  • The Fork ops Go lane passed go6 and go7 on 45e475c4d3. The only difference to this head is the main merge, which changed .github/fork/start-postgres.sh.
  • Fork ops ran member UAT on :3100 with the PR binary, and U1 to U5 passed. A member ran a workflow with a real model, saw the Workflows tab and stopped a live run. Another member got 404 on 6 of 6 requests. With the flag off, requests got 403 and the workflow tools were absent.

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.

1 participant