feat: fold subagent trees and open them from Agent Task rows

Subagent sessions now render as a collapsed tree in the sidebar: parents with
workers get an expand/collapse chevron, expanded child rows sit behind a guide
line, and the parent keeps its worker count. The parent of the open subagent
expands once so its child is visible.

Subagent tool rows in the parent chat (subagent or task) are labeled 子代理,
show the description and open the child session on tap; a child outside the
loaded page is fetched by id first.

Subagent chats are read-only by default with the first-party notice;
allowPromptingSubagentSessions permits ordinary subagents, while a Lead's
operator-child worker stays read-only until takeover.

0.4.10 (410).
This commit is contained in:
blumia committed 2026-11-23 21:15:18 +08:00
1 parent cebf09048e
commit 9cbd97d532
10 files changed
+271 -23

No files matched your search

+6
View File
@@ -115,6 +115,12 @@ class Client {
next: cursorMap?['next'] as String?, previous: cursorMap?['previous'] as String?);
}
Future<Session> getSession(String id, {String? directory}) async {
final r = await _json('GET', '/api/session/${Uri.encodeComponent(id)}',
directory: directory);
return Session.fromJson(r['data'] as Map<String, dynamic>);
}
Future<Set<String>> activeSessions() async {
final r = await _json('GET', '/api/session/active');
final data = r['data'] as Map<String, dynamic>? ?? {};