I want to make it so when someone creates a workspace and there are other…

merged…
osebo29d ago

I want to make it so when someone creates a workspace and there are other members they should be able to assign who is able to ask Osebot, everyone shouldn’t get it by default

4 repliesoldestnewest
Osebotfable-5-129d ago

Today asking Osebot is tied to membership: every workspace_members row (owner or member) may tick Ask Osebot, use the per-post Ask Osebot button and run posts. Plan:

  1. Schema: workspace_members.can_ask boolean NOT NULL DEFAULT false (drizzle/0014). Owners always may ask regardless. Backfill: existing members keep what they have today (true), so nothing changes for current workspaces on deploy; new members joining via an invite link start at false.
  2. Gate (lib/session.ts): one helper canAskOsebot(member) = owner or can_ask. requireMemberForAgent uses it (Ask Osebot on new thread / reply, per-post run). Stop and Merge stay plain membership (stopping a run or merging with your own GitHub token isn't "asking").
  3. API: GET …/members returns canAsk; new PATCH /api/workspaces/[id]/members { userId, canAsk }, owner only.
  4. UI: the Members card on /workspaces/[id] gets an owner-only "Can ask Osebot" switch per member row (owner row just shows it's always on); other members see a small "asks Osebot" badge. Thread page / workspace home composers pass canAskClaude from the new rule, so a member without the permission just gets a plain composer.
  5. README / architecture / copy updates.
Osebotfable-5-129d agothreadide@024ed03

Pushed 024ed03 on thread/2ad0251b. What's in it:

  • workspace_members.can_ask (drizzle/0014). Default false for new rows; the migration backfills everyone who is a member today to true so no existing workspace loses Osebot on deploy. Owners always may ask, whatever the flag says.
  • lib/session.ts canAskOsebot(member) is the one rule; requireMemberForAgent enforces it on Ask Osebot (new thread, reply) and the per-post run route, with a 403 that says "needs the workspace owner's say-so" for a member who hasn't been allowed yet (different from the non-member message). Stop and Merge stay plain membership.
  • PATCH /api/workspaces/[id]/members { userId, canAsk }, owner only (400 if you try to switch off an owner); GET …/members returns canAsk.
  • Manage page Members card: owner sees a Can ask Osebot checkbox on every non-owner row, saved on change; everyone else sees an "asks Osebot" badge on the rows that have it. Short line above the list explains the rule.
  • Thread page + workspace home compute canAskClaude from the new rule, so a member without the grant gets a plain composer (no Ask Osebot chip, no per-post button).

tsc is clean. Taking a mockup screenshot of the Members card next, then writing the PR description.

Osebotfable-5-129d agothreadide@024ed03

Done on thread/2ad0251b, commit 024ed03 (pushed). Asking Osebot is now a per-member grant the owner hands out, not something membership gives.

How it works

  • workspace_members.can_ask (drizzle/0014). Owners always may ask. Other members only once an owner ticks Can ask Osebot on their row in the Members card on /workspaces/[id]. Joining via the invite link leaves it off.
  • Existing members are backfilled to true in the migration, so nothing changes for workspaces that exist today; only new joins start without it. Say the word if you'd rather everyone except owners start at off after deploy, that's a one-line change in the SQL.
  • The rule lives in one place, lib/session.ts canAskOsebot(member), used by the API gate (requireMemberForAgent: Ask Osebot on a new thread or reply, per-post run) and by the pages (canAskClaude), so a member without the grant simply gets a plain composer, and the API answers 403 "needs the workspace owner's say-so" if they call it anyway.
  • Stop and Merge stay with every member (merging uses your own GitHub token; stopping a runaway run shouldn't need the grant). Flag it if you want those restricted too.
  • API: PATCH /api/workspaces/[id]/members { userId, canAsk } (owner only; 400 for an owner row), GET …/members now includes canAsk.

Screenshot is a static mockup of the Members card on the real stylesheet (the app can't run in the sandbox): owner sees the checkbox on non-owner rows and an "asks Osebot" badge on their own; non-owners see badges only.

Not verified live: the migration and the PATCH round-trip against a database (SQL is an add-column + update). Note for whoever merges: two unmerged branches (connectors, usage metering) also use migration number 0014; the second one in needs renumbering.

Members card on /workspaces/[id], owner view: "Can ask Osebot" checkbox per member, "asks Osebot" badge on the owner row (static mockup on the real globals.css, 390px and 720px)
Members card on /workspaces/[id], owner view: "Can ask Osebot" checkbox per member, "asks Osebot" badge on the owner row (static mockup on the real globals.css, 390px and 720px)
Osebot29d ago

Merged threadide #163 by @osebo (merge, ebceb24).