Files
Kagura bde8f2b0eb fix: write session ended_at/end_reason when bridge run terminates (#2004)
* fix: write session ended_at/end_reason when bridge run terminates (#1998)

When an agent run completes (normally or with error), the session's
ended_at and end_reason fields were never written to the database.
This caused the UI to permanently show 'thinking' for completed sessions.

Add updateSession calls at three run termination points:
- handleBridgeRun catch block (early error, empty queue)
- resumeBridgeRun catch block (stream error, empty queue)
- applyBridgeChunkAsync normal completion (no queued runs)

Each call is wrapped in try-catch to prevent masking the original
error or producing unhandled rejections.

Closes #1998

* fix: reopen bridge sessions when runs restart

---------

Co-authored-by: ekko <fqsy1416@gmail.com>
2026-07-09 12:41:28 +08:00
..
2026-07-08 09:47:45 +08:00