straight-sundown-84319
09/14/2025, 1:16 PMchilly-france-44439
09/14/2025, 1:31 PMevent.metrics help here?chilly-france-44439
09/14/2025, 1:31 PMstraight-sundown-84319
09/14/2025, 1:41 PMevent.metrics seems to be exactly what I needstraight-sundown-84319
09/14/2025, 1:41 PMstraight-sundown-84319
09/14/2025, 1:43 PMtitle = conversation.generate_title()chilly-france-44439
09/14/2025, 1:46 PMchilly-france-44439
09/14/2025, 2:03 PMchilly-france-44439
09/14/2025, 2:03 PMstraight-sundown-84319
09/14/2025, 2:05 PMstraight-sundown-84319
09/14/2025, 2:08 PMchilly-france-44439
09/14/2025, 2:11 PMchilly-france-44439
09/14/2025, 2:11 PMchilly-france-44439
09/14/2025, 2:12 PMchilly-france-44439
09/14/2025, 2:13 PMstraight-sundown-84319
09/14/2025, 2:14 PMstraight-sundown-84319
09/14/2025, 2:16 PMstraight-sundown-84319
09/14/2025, 2:16 PMchilly-france-44439
09/14/2025, 2:17 PMchilly-france-44439
09/14/2025, 2:18 PMwooden-umbrella-84098
09/14/2025, 2:25 PMwooden-umbrella-84098
09/14/2025, 2:25 PMchilly-france-44439
09/14/2025, 2:25 PMwooden-umbrella-84098
09/14/2025, 2:26 PMchilly-france-44439
09/14/2025, 2:26 PMwooden-umbrella-84098
09/14/2025, 2:27 PMwooden-umbrella-84098
09/14/2025, 2:27 PMstraight-sundown-84319
09/14/2025, 2:27 PMwooden-umbrella-84098
09/14/2025, 2:27 PMchilly-france-44439
09/14/2025, 2:27 PMchilly-france-44439
09/14/2025, 2:28 PMcalm-artist-7206
09/14/2025, 2:35 PMevent.metrics is a bit strange, I guess we imported it from V0, but maybe itâs worth thinking to move it per conversation, rather than per event? Reason is I think of tokens more as dynamic data, data that can change at next conversation restore, for various reasons (llm switch, but also regular condensation) and then the sum per conversation may not match whatever we saved per event. Unless those per event metrics are dynamic too?chilly-france-44439
09/14/2025, 2:39 PMthis is basically ais a bit strange, I guess we imported it from V0, but maybe itâs worth thinking to move it per conversation, rather than per event?event.metrics
snapshot that only includes the cumulative tokens consuption up until this point - it is kinda handy for CLI/GUI to visualize real-time cost thocalm-artist-7206
09/14/2025, 2:40 PMcalm-artist-7206
09/14/2025, 2:40 PMstraight-sundown-84319
09/14/2025, 2:42 PMthis doesn't sound entirely right "a user id which will be a default in OSS"
Explanation
At the moment we have a lot of code to accommodate that the user_id may be None in OSS. Instead we will have a constant like:
OSS_USER_ID = UUID('00000000-0000-0000-0000-000000000001')
Internally we will treat all installations as a multi user system (if we add a permissions model with superadmin, the OSS user becomes a superadmin). When the initial install / startup is done in a single user mode, we set up this user in the persistence layer.
This means we don't have special cases in our authorization code - we effectively have one path rather than twostraight-sundown-84319
09/14/2025, 2:48 PMstraight-sundown-84319
09/14/2025, 2:51 PMcalm-artist-7206
09/14/2025, 2:52 PMuser_id to write most code against: instead decide on a abstraction that the various clients (local, remote) implement for the user context, and use that, e.g. UserContext or RequestContext.
Thatâs particularly interesting when what this per-user does is storage isolation, because the weird thing today is that the V0 code is full of if user_id which serves only that purpose. But we could avoid to write code against a primitive string, because then we need to litter it everywhere there is storage involved.
https://github.com/All-Hands-AI/OpenHands/issues/10850straight-sundown-84319
09/14/2025, 2:56 PMcalm-artist-7206
09/14/2025, 3:04 PMcalm-artist-7206
09/14/2025, 3:48 PMI think It will make it easier moving forward to handle situations like allowing multiple users to participate in the same conversation or allowing a conversation to be shared in read only mode.Thatâs just the point: if code depends on an auth primitive (
user_id) and we want to add an org_id, Iâm not sure how weâd do that, without it creeping in multiple places, in actual business logic. Idk, we donât really want to write code like if user_id and org_id, do we? đ
Instead I simply suggest that routes depend on a few abstractions, which both OH and the Saas can implement, and which encapsulate the auth-y thing like user_id, e.g. âcontext object from which we can retrieve locations you can accessâchilly-france-44439
09/15/2025, 12:58 PMwooden-umbrella-84098
09/15/2025, 1:01 PMwooden-umbrella-84098
09/15/2025, 1:02 PMchilly-france-44439
09/15/2025, 1:02 PM