Repository navigation
Session roles: who can drive a Slack session - #1062
Merged
Merged
Conversation
…ds (work 112) computer/src/access.ts and access-views.ts hold roles, the permission table, drivers encoding, !access parsing, the S1-S15 strings and the Block Kit messages and modal, byte-identical in services/managed-agents/src/computer/ (checked by test/computer-access.test.ts). Protocol gains optional role fields and NOT_ASKED; Linked gains context with its block sentence. No behaviour change.
The gateway computes each sender's role from the session's owner and drivers and gates messages, commands, prompt clicks and stop on it. Participants' messages are held as context for the next driver message; a participant's mention posts a request the owner answers. Access is changed from a modal behind an Access button or with !access; restricted threads carry a lock reaction. The runner lets only the asked driver or the owner click a prompt. Spec: serverless-agents-ws .agents/work/112-session-roles-build-spec.md
The same rules as the self-host gateway at the Durable Object's seams: role per event, held context, request to drive, the access modal and !access, the lock marker, stop naming who stopped. Member is the secrets store's check, now shared; admin is a Slack user linked to a dashboard owner or admin. Spec: serverless-agents-ws .agents/work/112-session-roles-build-spec.md
|
View docs preview Docs hosted with Margin |
- One gate: gateway commands and the secret form in a session thread need the right to instruct; only !access skips it. - One user lookup in production (ThreadAccess): a failed users.info retries the message instead of reading as not-a-member. - One delivery path: Allow requeues the held message through process. - setDrivers takes an edit, validates (members, limit) and writes with no await between read and write. - Request and context rows are the duplicate guards. - Self-host: unknown people do nothing again; role logic moves from routing into the flow. - !access add/remove on an open session answers usage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by @ZIJ (Igor) in Slack. Spec: work 112 (mocks of the four user journeys are in its "User journeys" section).
What it does
A session stores its owner and one new field,
drivers(*or a list of Slack user ids). Each gateway computes a role per event (owner, driver, participant, outsider) and gates on it. Default is*, so open threads behave as today except for the three changes below.!accessis the typed fallback. Restricted threads carry a 🔒 reaction. A change posts one line only when it lets more people drive.Behaviour changes to review
!mode,!restart,!doneare the owner's, in open threads too.Not verified (gates)
Nothing here has run against Slack. Before deploy, on a dev workspace:
reactions.addaccepts the namelock;agent_session_stoppedevents carryuser.Review map
computer/src/access.ts,access-views.ts: pure rules, strings and Block Kit builders; byte-identical copies inservices/managed-agents/src/computer/(a test checks identity).computer/src/gateway/access-{store,flow,ui}.tsand seams inrouting.ts,main.ts,db.ts.services/managed-agents/src/computer/access-{store,flow,ui}.tsand calls indurable-object.ts,slack.ts.prompts.ts(asked driver),thread.ts(Access button),session.ts,main.ts.Deploy order
Gateways before hosts. A new gateway with an old runner gates everything except "who may click a prompt" and shows no Access button (
!accessworks).Known rough edges
users.infoonce per message from a non-owner in an existing session, uncached.Verification
computer:npm run checkpasses (137 files, 992 tests).src/host/workspace-files.test.tsflaked once under load and passed on rerun, as onmain.services/managed-agents:npx tsc --noEmitclean; allcomputer-*tests pass (8 files, 138 tests run directly). Fullnpm testin this environment has failures outside this change: six files cannot load@opencode-ai/sdk/workerd, and seven tests time out in the full run and pass alone. CI is the authority there.