Repository navigation
Commit 2063409
committed
fix(server): keep agent linkage and settle stopped sessions at startup
Two gaps in background-agent settlement. The fold copied only the newest
row's payload onto the synthesized terminal row, so when later lifecycle
rows carried just a task id and a status the settled row lost agentKind and
its workflow grouping — and once the start row aged out of the client's
activity window, that row was the only one left and the agent disappeared
from the panel. Startup also skipped threads whose session was already
stopped, so a process that died between marking a session stopped and
settling its children left those rows running on every later boot.
Linkage is now merged across every row for a task, newest non-empty value
winning, and covers the full set ingestion stamps minus per-row state.
Startup settles any thread it does not own regardless of session status,
reading every candidate thread's task history in one batched, chunked query
instead of a query per thread.
Implemented by Claude Opus 5 via Claude Code.1 parent df0fd6c commit 2063409
6 files changed
Lines changed: 353 additions & 109 deletions
File tree
- apps/server/src
- orchestration
- Layers
- persistence
- Layers
- Services
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3785 | 3785 | | |
3786 | 3786 | | |
3787 | 3787 | | |
| 3788 | + | |
3788 | 3789 | | |
3789 | 3790 | | |
| 3791 | + | |
3790 | 3792 | | |
3791 | 3793 | | |
3792 | 3794 | | |
| |||
3823 | 3825 | | |
3824 | 3826 | | |
3825 | 3827 | | |
| 3828 | + | |
| 3829 | + | |
| 3830 | + | |
| 3831 | + | |
| 3832 | + | |
| 3833 | + | |
| 3834 | + | |
| 3835 | + | |
| 3836 | + | |
| 3837 | + | |
| 3838 | + | |
| 3839 | + | |
| 3840 | + | |
| 3841 | + | |
| 3842 | + | |
| 3843 | + | |
| 3844 | + | |
| 3845 | + | |
| 3846 | + | |
| 3847 | + | |
| 3848 | + | |
| 3849 | + | |
| 3850 | + | |
| 3851 | + | |
| 3852 | + | |
| 3853 | + | |
| 3854 | + | |
| 3855 | + | |
| 3856 | + | |
| 3857 | + | |
| 3858 | + | |
| 3859 | + | |
| 3860 | + | |
| 3861 | + | |
| 3862 | + | |
| 3863 | + | |
| 3864 | + | |
| 3865 | + | |
| 3866 | + | |
| 3867 | + | |
| 3868 | + | |
| 3869 | + | |
| 3870 | + | |
| 3871 | + | |
| 3872 | + | |
| 3873 | + | |
| 3874 | + | |
| 3875 | + | |
| 3876 | + | |
| 3877 | + | |
| 3878 | + | |
| 3879 | + | |
3826 | 3880 | | |
3827 | 3881 | | |
3828 | 3882 | | |
| |||
0 commit comments