mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-15 02:16:08 +00:00
Give a scheduled run's trace to the user who scheduled it
On a shared agent the run's Logs row belongs to the scheduling user, not the agent owner, so the trace is stored under that user.
This commit is contained in:
1 parent
9f7f0b2f1e
commit
699906a015
3 files changed
+19
-2
No files matched your search
@@ -277,8 +277,10 @@ def execute_scheduled_run_body(run_id: str, celery_task_id: Optional[str]) -> Di
|
||||
endpoint="schedule",
|
||||
conversation_id=schedule.get("origin_conversation_id"),
|
||||
chat_history=chat_history,
|
||||
# Links the run's execution trace to its Logs row.
|
||||
# Links the run's execution trace to its Logs row, which belongs
|
||||
# to the user who scheduled it (not always the agent's owner).
|
||||
request_id=str(run_id),
|
||||
trace_user_id=run.get("user_id") or schedule.get("user_id"),
|
||||
)
|
||||
except SoftTimeLimitExceeded:
|
||||
timed_out = True
|
||||
|
||||
Reference in new issue
Block a user