feat(delegation): continue_with_session and hide sub-sessions by default - #375
Open
hkx1997 wants to merge 3 commits into
Open
feat(delegation): continue_with_session and hide sub-sessions by default#375hkx1997 wants to merge 3 commits into
hkx1997 wants to merge 3 commits into
Conversation
hkx1997
force-pushed
the
feat/delegation-continue-session-clean
branch
from
July 23, 2026 15:58
0edfcd6 to
6108844
Compare
…efault Add continue_with_session/close_session MCP tools so parent agents can resume a failed or completed child without cold re-delegation. Keep completed/failed children alive for resume, re-spawn via external_id when needed, and fix the sub-agent dialog timeline to preserve multi-turn history during continue. Sidebar: filter out delegation children from root lists (parent_id/kind/delegation_call_id), add a funnel toggle for showing sub-session trees (default off), and label sub-session rows when expanded.
hkx1997
force-pushed
the
feat/delegation-continue-session-clean
branch
from
July 25, 2026 15:25
820196d to
4d6e409
Compare
7iook
pushed a commit
to 7iook/codeg
that referenced
this pull request
Jul 26, 2026
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Multi-agent continue_with_session / close_session, plus sidebar treatment of delegated sub-sessions — no file-path context-menu changes.
Backend (codeg-mcp + broker)
continue_with_session,close_sessionexternal_idwhen the child process is gonetask_idfor status/cancel after continueSidebar
parent_id/kind=delegate/delegation_call_id)depth, so worktree indent is not mislabeled)N subhint when trees are hiddenSub-agent dialog
Test plan
pnpm exec vitest run src/lib/conversation-sidebar.test.ts src/lib/adapters/tool-kind-classifier.test.ts src/contexts/conversation-runtime-context.test.tsx(94 passed)cargo check --manifest-path src-tauri/Cargo.toml --features test-utils --lib