Skip to content

Commit f8514a2

Browse files
committed
fix(agents-api): Fix sessions updated_at precision issue
1 parent 24340ec commit f8514a2

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

Diff for: agents-api/agents_api/models/chat/prepare_chat_context.py

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"session": make_session(
3838
agents=[a["id"] for a in d["agents"]],
3939
users=[u["id"] for u in d["users"]],
40+
updated_at=d["session"].pop("updated_at") / (1000000.0),
4041
**d["session"],
4142
),
4243
"toolsets": [

Diff for: agents-api/agents_api/models/session/get_session.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,14 @@
2727
TypeError: partialclass(HTTPException, status_code=400),
2828
}
2929
)
30-
@wrap_in_class(make_session, one=True)
30+
@wrap_in_class(
31+
make_session,
32+
one=True,
33+
transform=lambda d: {
34+
"updated_at": d.pop("updated_at") / (1000000.0),
35+
**d,
36+
},
37+
)
3138
@cozo_query
3239
@beartype
3340
def get_session(

Diff for: agents-api/agents_api/models/session/prepare_session_data.py

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
one=True,
3333
transform=lambda d: {
3434
"session": make_session(
35+
updated_at=d["session"].pop("updated_at") / (1000000.0),
3536
**d["session"],
3637
agents=[a["id"] for a in d["agents"]],
3738
users=[u["id"] for u in d["users"]],

Diff for: agents-api/agents_api/models/session/update_session.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
one=True,
4646
transform=lambda d: {
4747
"id": d["session_id"],
48-
"updated_at": d.pop("updated_at")[0],
48+
"updated_at": d.pop("updated_at")[0] / (1000000.0),
4949
"jobs": [],
5050
**d,
5151
},

0 commit comments

Comments
 (0)