fix: list Claude background tasks from the snapshot instead of guessing (#2177)

* fix: list Claude background tasks from the snapshot instead of guessing

The status panel only had a count from `background_tasks_changed` and
reconstructed commands by regex-matching Bash results in loaded chat
history, so tasks whose start message was unloaded, auto-backgrounded
("moved to the background (ID: …)"), or non-Bash showed
"N running · exact command unavailable".

The hub now keeps the snapshot's tasks (id, type, description) on the
session alongside the count. The web panel lists them directly, using
the exact task ID to look up the Bash command when loaded and the
snapshot description otherwise.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(web): only attribute a Bash command from its background launch result

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(native): accept backgroundTasks in strict session patch decoders

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
SSU-WEI HUANG
2026-10-28 12:12:41 +08:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 40070a56db
commit fe2fbb881d
24 changed files with 160 additions and 195 deletions
@@ -130,6 +130,8 @@ extension SessionPatch: Codable {
case copilotAgentMode
case backgroundTaskCount
case scratchlistUpdatedAt
// Web-only status-panel list; accepted so the patch is not refetched.
case backgroundTasks
}
public init(from decoder: Decoder) throws {