Repository navigation
Workspaces phase 3j: what the review of phase 3 found (#277) - #342
Merged
Merged
Conversation
A review of 3a-3i (027eb9f..04ef613), each finding checked by hand, found no cross-workspace path. Fixed here: - Losing the admin role makes an owner of the default workspace a member, as 1.x took the dashboard away; owners of other workspaces stay owners. - Agent roles written to users.roles for a member of another workspace only join the default workspace instead of being lost. - The last-owner check locks the workspace's row, so two owners stepping down at once can't leave none. - An RBAC refusal names the agent roles of the agent's workspace, not users.roles (ADK callback and LangGraph hook). - The Users page adds admin or pending only and keeps what a user already has, so a widget visitor or a system caller can still be saved. - A workspace budget reads its hour, day and month tokens in one query. - /dashboard/api/usage/logs bounds limit, page and hours. - One _session helper and one clock for the new routers. - api_roles fails closed without a database session.
This was referenced Nov 13, 2026
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.
Phase 3j of #277 (
documents/design/2.0-plan.md): a review of 3a–3i, run as in phase 2, and the fixes it calls for. The review used code-review athighover027eb9f..04ef613, and I checked each finding by hand.It found no cross-workspace path. 3i had already found one (
/list-appslisting the default workspace's agents to someone who isn't a member) and fixed it.Fixed
adminon the Users page left the user owner of Default, so they kept its dashboard. In 1.x that took the dashboard away.Userlistener makes an owner of Default a member whenadmingoes. Ownership of other workspaces stays.test_losing_the_admin_role_takes_the_default_workspace_s_ownershipusers.rolesfor a user who belongs only to another workspace were stripped and lost. The UPDATE matched no row of Default.memberwith those roles, which is what 1.x callers mean.test_agent_roles_written_for_a_member_of_another_workspace_are_keptwith_for_update).users.roles, which now holds platform roles only, in its message and audit entry.RBACMiddleware.roles_forreturns the platform roles plus the agent roles in the agent's workspace. Both the ADK callback and the LangGraph hook use it.test_a_refusal_names_the_agent_roles_of_the_agent_s_workspacewidget, and refused to save the profile of a system caller, whose roles are agent roles.adminorpending, and roles the user already has may stay.test_the_users_page_adds_admin_or_pending_onlyget_workspace_tokens_windows).test_a_workspace_s_token_windows/dashboard/api/usage/logs, open to members since 3h, had no bounds.limit=0divided by zero.limit1–1000,page≥ 1,hours1–8784.test_the_usage_logs_page_size_is_bounded_sessionand_utc_nowinplatform_workspace_routes.py.member_routesandinvitation_routes.api_rolesraised when there was no database session.test_api_roles_without_a_database_sessionEach of these tests fails when its fix is reverted (mutation check, 8 mutations).
Not taken
api_roles) is fixed.Behaviour changes worth noting
adminmakes the user a member of Default, even if an owner had set them as owner on Members. A platform administrator restores the ownership on Members.user_rolesfield changes value.Tests and docs
test_client_contractis unchanged.users-and-roles.md(what removingadmindoes) anddatabase-and-migrations.md(the listener's two new cases).gen_docs driftlists other guides for the touched files. They describe nothing these fixes change: thepat_authguides,agent-runtime,langgraph-runtime,agents,rate-limits,usage-and-audit,alerts,template-formatandworkspaces.