<@U06PYTVAES1>, <@U07EZMGJFBJ>: Can you guys give ...
# dev-help
f
@calm-artist-7206, @straight-sundown-84319: Can you guys give the Org framework PR a good once over: https://github.com/OpenHands/OpenHands/pull/11265 I've done some basic tests on both OSS and SAAS. There will be significant testing done on staging once this is merged.
šŸ‘€ 1
@straight-sundown-84319, the SAAS feature branch deploy is here: https://org-testing.staging.all-hands.dev/
I apologize for the size. Future PRs for the org work will be MUCH smaller.
c
A thought here, about migrating settings from user to org: https://github.com/OpenHands/OpenHands/pull/11265/files#r2507048944 I suggested that the migration could put them in their own table... rather than tying them to org now. thinky spin It also fits better this older discussion (although that's a bit outdated), about • having all or most settings available in OH • filter out, for Web UI in OH • filter out, and append to them, for Saas • if they're separate, maybe it's easier to also break them down again in LLMSettings, AgentSettings etc https://github.com/OpenHands/OpenHands/issues/10947#issuecomment-3282347974
I'm not sure if now, do we have the db structure that allows a feature like "org overrides user llm setting" ?
f
We would add a flag to the Org for this. I was trying to limit what I put into this PR as it is already massive. I figured we could add the flag in the follow on PR when we started integrating with the frontend changes.
As for separating out the settings. May make sense. Though most of the fields in Org, User, and OrgMember are settings.
This PR is mainly to add the framework and do the migration to that framework. So after this PR, a user will have a personal org and settings will be drawn from that personal org. There should be no noticeable changes from the user perspective.
c
šŸ¤” The thing is, a user account or an org account are different things than application settings. Conceptually, they're different. Now they're tied: they used to be tied to an user account, now org account. I'm also concerned that tying them closely with an account means settings don't fit all that well for OpenHands (the open source project) In the last year+, the OpenHands project was blocked, in the ability of contributors to change "Settings". People have made PRs trying to add some settings, even a bunch of them, and the thing is, the way to do that is rather ugly, error prone, if possible at all, because the data goes to the Saas into a UserSettings object. So it would break the Saas, I think. Because the Saas uses the same routes and utils and GET/POST objects in /settings.
Idk, I would suggest that even if you could somehow mix in the next feature, maybe it shouldn't be tacked on the existing structure (which makes no distinction between accounts and settings), but we could take the opportunity to consider breaking settings out
On this note, the fact that the Saas uses an ORM means that when it has an inappropriate db structure, the db structure gets directly into the main objects, so it shapes how code works with them, how humans work with them, and surely how LLMs work with them...
f
I can look at it. So you want all settings in the OSS code even if they are not applicable, but hide them from the user.
s
I got openhands to do a /roastme style review and aside from noting some print statements it's major concerns were increasing test coverage and mainly the overall complexity of the PR. Scary but necessary I guess
c
Tim, with Sonnet I guess?
nod 1
@flaky-jordan-67349 I'm thinking that just breaking up into Accounts (org table, user table) and Settings (settings table, linked to at least org) would be absolutely great and it would allow us to think about the rest a little more clearly... Then going forward, we could make the "Settings" vary between applications, and even features in the Saas I think, more easily. If that's possible? I guess it would imply a join when retrieving both "org name for org_id" and "llm set for org_id"
f
I think we should try to come up with a coherent way to handle settings changes. Now that we have sqlite in OSS we should move the settings into the DB on the OSS side. Once we do that then we could probably come up with a way to use the DB migrations in OSS as part of the enterprise DB migrations. This would allow changes to OSS settings to be picked up automatically in SAAS. But I think this would be adding too much to this PR. I'd like to propose that we create an issue/ticket to look at the best way to do this. I like the idea of breaking up the settings as there are some things that the user should always be in control of (language, notifications, etc.) and there are things that an org may want to control (llm, budgets, etc).
c
Yes, for the Saas, but for OpenHands there is no org. They're just settings, without an account tied to them. I'll restart the issue with a new proposal. I agree this is not an easy issue... I actually doubt the backend storage matters in this case as much as for conversations, on OH side it's just a json.loads/dump. šŸ¤”
I repeated Tim's experiment with GPT-5. This is its "roasted" review on the PR (unverified 😊) https://gist.github.com/enyst/0edffb02b1963839218ff3dab76d6b87 I find GPT-5 much better than Sonnet in general, though it depends (tm) and it has its fails for sure. Worth a look maybe? I can make it comment on PR file / lines if you find it useful
f
I'll go through it. Thanks!
@straight-sundown-84319, I think this pre-dates this PR:
Copy code
[openhands/app_server/app_conversation/sql_app_conversation_info_service.py, Lines 186–200] Correctness: Count query ignores version filter. count_app_conversation_info doesn't constrain to V1 (while search does via _secure_select). Impact: Counts won't match search results. Fix: Apply the same version filter: where(StoredConversationMetadata.conversation_version == 'V1').
Is there a reason for the 'V1' restriction? Should it be in the count query as well?
s
It should also constrain to V1
šŸ‘ 1
f
OK. I've gone through and fixed all the critical issues in the GPT-5 list. I also fixed most of the "IMPROVEMENT OPPORTUNITIES". Some of those are not part of this PR and will require some more investigation to fix (like rotating encryption keys and LiteLLM get key info param passing). I will rerun my migration tests on Thursday. @straight-sundown-84319, if you have 5 minutes we can go through your comments and my responses. Would love to get this bad boy merged this week if possible.