Repository navigation
feat(agent-profiles): enforce org-scope constraints on scope=org saves (OHE-3752) - #1010
Merged
hieptl merged 4 commits intoOct 27, 2026
Conversation
…nd launch lookup (OHE-3746)
Each org member gets a personal AgentProfiles collection in a new
org_member.agent_profiles column (migration 198), the same envelope as
org.agent_profiles.
- Name-keyed /api/agent-profiles endpoints take scope=personal|org; the
default stays org, so existing callers are unchanged. Personal writes
need only membership and lock the member row. GET /{name} and
/{name}/materialize without a scope try the org collection first and
fall back to the member's own.
- GET / returns both collections, each summary tagged with its scope;
/{id}/activate accepts an id from either and locks the owning row. A
personal name already owned by the org collection is refused (409).
- Conversation start resolves the active id in the personal collection
first, then the org's.
- Renaming an org LLM profile cascades into members' personal profiles;
deleting one is refused while members' personal profiles reference it.
…s (OHE-3752) An organization Agent Profile launches for every member, so a scope=org save must stand on organization-scoped configuration alone: the OpenHands agent kind only, no MCP server references (null stays accepted for the legacy seeded default, an explicit list must be empty), and secret_refs drawn from the organization's shared secrets. Violations return 422. The name-collision guard is now two-sided: an org save of a new name, or an org rename, returns 409 when any member already uses the name in their personal collection, so every member's merged list stays duplicate-free. Validation and the secret-name lookup run before the row lock.
Contributor
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||
hieptl
marked this pull request as ready for review
October 26, 2026 15:55
2 of 6 tasks
…onstraints-on-scopeorg-agent Pick up main's renumbering of the member agent profiles migration to 199. The previous merge predates it, so this branch carried two revision 198 files and every Python test job failed at alembic upgrade head.
hieptl
deleted the
hiep/ohe-3752-org-agent-profiles-org-scope-constraints-on-scopeorg-agent
branch
October 27, 2026 12:39
hieptl
added a commit
that referenced
this pull request
Oct 27, 2026
…storage-api-and Resolves the conflicts with the merged Agent Profiles work (#753, #754, #755, #763, #1007, #1010, #1011) by keeping both sides: both feature flags and their nav-hiding rules, both LLM-profile delete guards and rename cascades in org_profiles, and the Model Router launch hydration after main's SDK-based Agent Profile resolution in saas_settings_store. The user-menu test keeps the isSettingsPageHidden filter, which covers main's hard-coded agent-page set as well as the Model Router page. Semantic follow-ups: re-add the resolve_profile_llm import main dropped from saas_settings_store (the router hydration still uses it), and renumber the Model Router migration from 199 to 201 chaining off main's 200 (main now holds 199 and 200), and move the alembic head pinned by main's agent-profile upgrade test from 200 to 201 accordingly.
Contributor
|
🚀 Released in 1.81.0. |
2 of 6 tasks
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.
Summary
Org-scope constraints for
POST /api/agent-profiles/{name}?scope=org, plus the org half of the name-collision guard (OHE-3752, part of OHE-3088).An organization Agent Profile launches for every member, so it has to stand on organization-scoped configuration alone:
mcp_server_refsis a non-empty list.null(the legacy seededdefault) and[]are accepted.secret_refsnames a secret that is not org-shared; the detail lists the names that are not shared.Validation and the secret-name lookup now run before the collection row is locked.
Notes
secret_refsagainst the org-shared secrets is the companion OHE-3753 PR.Validation
pre-commit(ruff, ruff format, mypy) onserver/routes/agent_profiles.py: passed.pytest tests/unit/test_agent_profiles.py tests/unit/test_org_profiles.py tests/unit/test_saas_settings_store.py tests/unit/app_server/test_live_status_app_conversation_service.py: 438 passed.Linear: OHE-3752
Enterprise server image for this PR: