fix(settings): stop a member's settings save writing to the whole org - #254
Merged
Conversation
6 tasks
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
jlav
marked this pull request as ready for review
August 26, 2026 14:45
tofarr
approved these changes
Aug 26, 2026
|
🚀 Released in 1.56.0. |
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.
HUMAN:
AGENT:
Why
One member switching their agent to codex broke new conversations for everyone else in the org. Every member without codex credentials got a 400 on every attempt:
This blocked all 17 members of the beta staging instance.
POST /api/v1/settingsis the per-user settings save and any member can call it. It was writing the acting member's agent settings toorg.agent_settingsand to every other member'sagent_settings_diff, so a personal harness choice became the org-wide default.The same thing happened through a second column. Where an org keeps its LLM connection in a profile rather than in
agent_settings, that profile is the only record of the org's model and base url, and a member's save was overwriting it with SDK defaults. I hit this on a second instance after fixing the first path.Approach
store()writes the acting member'sorg_memberrow and nothing else. The managed litellm key is genuinely org-wide, so that one field still fans out to every member.Org-wide defaults get their own way in:
POST /orgs/{id}/apptakes anagent_settings_diff, gated onEDIT_ORG_SETTINGS.A member's save also no longer touches org-owned columns, and
sync_active_profile_from_settings()skips a non-OpenHands agent, whosellmblock is an unused placeholder rather than a real connection.Issue Number
OHE-3138 - https://linear.app/all-hands-ai/issue/OHE-3138
How to Test
With two accounts in one org:
/settings/agentand save.POST /orgs/{id}/appwith anagent_settings_diffshould 403. As admin or owner it should apply toorg.agent_settings.Video/Screenshots
Type
Notes
This is the minimum needed to stop one member reconfiguring the org. #241 carries the same two commits plus two follow-on fixes, which I split out so this one can go in on its own:
Rows already written by this bug aren't repaired here. That needs a separate cleanup.
I left
MEMBER_PRIVATE_AGENT_KEYSalone on purpose. Adding the acp keys there looks like the one-line fix, but that set also gets stripped from the member's own row, so it'd silently discard everyone's harness choice. Onlymcp_configsurvives it, via its own column.Enterprise server image for this PR: