Commit 2505e16
7
feat(delegation): continuable sub-agent sessions with user entry point
Replace the v1 one-shot delegation lifecycle (child torn down at first
terminal state, broker.rs "v1 one-shot" comment) with continuable
sessions shared between the parent LLM and the user.
Backend:
- Session/Turn/Operation three-layer split inside the broker; the
completed cache now only caches result text (evicting it can no
longer change domain behavior)
- continue_with_session / close_session MCP tools (wire-compatible
with upstream PR xintaofei#375; close is release semantics, session_released
with session_closed accepted as a historical alias)
- Keep-alive with kept_alive_cap (global + per-parent FIFO) on top of
idle-sweep reclamation; resume via external_id with triple binding
checks (agent_type/folder/uniqueness) and pre-side-effect
resume_unavailable instead of silent session/new downgrade
- Startup rebuild protocol (rebuilding retryable state, per-row
failure isolation, ledger not reused across restarts)
- Continuation registered cancellable before the follow-up prompt is
sent (closes the register-window cancel race), close-vs-continue
serialization hardened at the settle_session choke point
- update_external_id resume-safe/skip-delegate guards at all four
call sites so a degraded session/new can never overwrite the resume
credential of a delegate row
- session-scoped delegation_session_update event (task_id, turn_id,
turn_version, origin); no duplicate completion against an
already-terminal parent_tool_use_id
User entry point (not present in upstream PR xintaofei#375):
- continue/close/availability HTTP + Tauri commands keyed by
conversation id, continuation_id idempotency ledger across all
three entries (MCP arm included, listener never mints ids)
- Sub-agent dialog composer gated by five-state continuation
availability; errors surfaced with stable codes
- Sidebar discoverability: Sub badge, sub-session filter toggle
(default off), delegate rows excluded from the root list by DB
markers only (immune to worktree indentation)
- Multi-turn timeline: prefix cut anchored to the in-flight user turn
so earlier completed turns stay visible while a new turn streams
Verification: rust --lib 1805 passed / clippy -D warnings clean /
frontend vitest 2835 passed / tsc clean. Independent read-only review
(heterogeneous model) returned 0 critical; both important findings
(close-vs-continue compound-failure leak, unguarded external_id call
sites) fixed with red-green tests in this change.
Spec: docs/specs/delegation-continue-session/{requirements,design,tasks}.md
(3-round codex cross-review converged; introspection archived)1 parent 33ead19 commit 2505e16
62 files changed
Lines changed: 10589 additions & 947 deletions
File tree
- docs/specs
- delegation-continue-session
- src-tauri/src
- acp
- delegation
- bin
- chat_channel
- commands
- db/service
- web
- handlers
- src
- components
- conversations
- layout
- message
- i18n/messages
- lib
- adapters
- stores
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
0 commit comments