fix(webui): resolve a selected org's workspaces as the caller, wire selection into gateway and harness, and let a member start tasks in the org they selected

This commit is contained in:
sam committed 2026-10-27 11:06:18 +11:00
1 parent c3d49cbc6c
commit 4bb473c0b0
12 files changed
+101 -21

No files matched your search

@@ -420,6 +420,8 @@ SELECT
$10::text
FROM number, (SELECT COALESCE(
(SELECT a.org_id FROM org_agents a WHERE a.identity_id = $7),
(SELECT m.org_id FROM memberships m WHERE m.identity_id = $7
AND m.org_id = $11::text LIMIT 1),
(SELECT m.org_id FROM memberships m WHERE m.identity_id = $7
ORDER BY m.created_at, m.org_id, m.workspace_id NULLS LAST LIMIT 1),
'org-sys'
@@ -88,6 +88,8 @@ SELECT
sqlc.arg(draft_digest)::text
FROM number, (SELECT COALESCE(
(SELECT a.org_id FROM org_agents a WHERE a.identity_id = sqlc.arg(identity)),
(SELECT m.org_id FROM memberships m WHERE m.identity_id = sqlc.arg(identity)
AND m.org_id = sqlc.narg(scope_org)::text LIMIT 1),
(SELECT m.org_id FROM memberships m WHERE m.identity_id = sqlc.arg(identity)
ORDER BY m.created_at, m.org_id, m.workspace_id NULLS LAST LIMIT 1),
'org-sys'