feat(run): show externally started Claude sessions in the active-runs list

The Workspace active-runs list only knew about runs this dashboard spawned,
so two `claude` sessions started by hand in terminal tabs showed up nowhere —
the list read "no active runs" while two agents were working.

Poll GET /api/sessions?status=active alongside the run list and merge those
sessions in as live rows, deduped against dashboard runs by session_id and
filtered to local sources with a cwd (a remote-source or cwd-less session
cannot be resumed on this machine).

External rows get no Attach action: the dashboard owns no tmux session for
them, so there is no PTY to bridge. They offer Resume, which reuses the
existing ensure-lane + start-with-resumeSessionId path to spawn a new
tmux-backed `claude --resume` in that folder — a second process on the same
transcript, not a view of the original terminal.
This commit is contained in:
2026-08-18 09:49:03 +07:00
parent 2c29504c75
commit 174c650624
7 changed files with 181 additions and 21 deletions
+3 -1
View File
@@ -116,7 +116,9 @@
"runs": {
"allSessionsLink": "See all Claude Code sessions →",
"attached": "Attached to existing run",
"scopeNote": "Only shows runs you started from this dashboard.",
"externalBadge": "external",
"externalHint": "Started outside the dashboard, so there is no terminal to attach to. Resume opens a new tmux-backed `claude --resume` of this session in its folder.",
"scopeNote": "Runs started from this dashboard, plus Claude Code sessions running outside it.",
"started": "Started {{when}}",
"switcher": "Active runs",
"switcherEmpty": "No active runs",
+3 -1
View File
@@ -115,7 +115,9 @@
"runs": {
"allSessionsLink": "Xem tất cả phiên Claude Code →",
"attached": "Đã gắn vào run đang chạy",
"scopeNote": "Chỉ hiển thị các run bạn khởi chạy từ dashboard này.",
"externalBadge": "ngoài dashboard",
"externalHint": "Phiên này khởi chạy ngoài dashboard nên không có terminal để attach. Resume sẽ mở một `claude --resume` mới trong tmux tại đúng thư mục đó.",
"scopeNote": "Các run khởi chạy từ dashboard này, cùng những phiên Claude Code đang chạy bên ngoài.",
"started": "Bắt đầu lúc {{when}}",
"switcher": "Run đang chạy",
"switcherEmpty": "Không có run đang chạy",