🤖 feat: simplify persistent sub-agent lifecycle - #3825
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
@codex review Please review the persistent sub-agent lifecycle, parent-scoped cleanup, and chat decoration experience. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 140059526d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
1400595 to
56c3bba
Compare
|
Addressed the Codex P1 downgrade concern: config load now migrates both missing and legacy |
|
@codex review Please re-review the downgrade-safe persistence migration and the complete updated diff. |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
d082dc4 to
fab594e
Compare
|
@codex review Please review the one-time retention migration marker, restored opt-out compatibility, workspace-turn ownership check, and complete updated diff at the latest commit. |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
fab594e to
ec23165
Compare
|
@codex review Please review the final parent-facing lifecycle contract in the system prompt, task/list/terminate/lifecycle tool descriptions, and deep-review skill alongside the implementation. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ec231657e3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Addressed the sticky lifecycle mismatch: parent/system/tool/schema guidance now states that an unarchived sticky child blocks ancestor archive and must receive its own archive/remove action first. This matches the existing |
|
@codex review Please re-review the corrected sticky lifecycle contract and complete latest diff. |
ec23165 to
dd5c583
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dd5c583375
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Addressed the descendant-orphaning P1: |
dd5c583 to
a8726bc
Compare
|
@codex review Please re-review descendant-safe lifecycle removal and the complete latest diff. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a8726bcd55
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Addressed both latest lifecycle findings:
Added direct-force, retention-opt-out, service lifecycle, and sequential batch regressions. Focused tests, typecheck, and |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f13778824b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Run direct workspace removal under the task-tree lifecycle lock while preserving the already-locked sub-agent removal path. --- _Generated with `mux` • Model: `openai:gpt-5.6-sol` • Thinking: `xhigh` • Cost: `$706.94`_ <!-- mux-attribution: model=openai:gpt-5.6-sol thinking=xhigh costs=706.94 -->
Count reawakened children only through their continuation handles and use each active child workspace current model, thinking, and reasoning settings for guidance. --- _Generated with `mux` • Model: `openai:gpt-5.6-sol` • Thinking: `xhigh` • Cost: `$706.94`_ <!-- mux-attribution: model=openai:gpt-5.6-sol thinking=xhigh costs=706.94 -->
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9e90bb926a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
mux/src/node/services/taskService.ts
Lines 5386 to 5390 in d0377ce
When one terminal handle belongs to a session whose attention store is unwritable, enqueueTerminalAttention() rejects, and initialize() awaits this recovery method without any surrounding containment, so that single damaged session prevents the application from starting. Fresh evidence beyond the earlier reconciliation finding is that the later terminal-attention recovery pass remains unguarded; isolate failures per record or catch and log the recovery pass.
AGENTS.md reference: AGENTS.md:L107-L112
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Preserve the original queued assignment through first continuation acceptance and ignore malformed handle timestamps during startup reconciliation. --- _Generated with `mux` • Model: `openai:gpt-5.6-sol` • Thinking: `xhigh` • Cost: `$706.94`_ <!-- mux-attribution: model=openai:gpt-5.6-sol thinking=xhigh costs=706.94 -->
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 54364efee0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Ignore parseable but non-ISO handle timestamps so corrupted records cannot outrank active continuation state during startup recovery. --- _Generated with `mux` • Model: `openai:gpt-5.6-sol` • Thinking: `xhigh` • Cost: `$706.94`_ <!-- mux-attribution: model=openai:gpt-5.6-sol thinking=xhigh costs=706.94 -->
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Centralize active workspace-turn status checks, remove lifecycle tool casts, and share task-tree lock coordination without changing public behavior.
Add task_retitle, event-driven stale-child cleanup guidance, finalization-aware stopping policy, friendly role naming, and hide inactive child workspaces from the left sidebar in favor of the transcript decoration. --- _Generated with `mux` • Model: `openai:gpt-5.6-sol` • Thinking: `xhigh` • Cost: `$824.74`_ <!-- mux-attribution: model=openai:gpt-5.6-sol thinking=xhigh costs=824.74 -->
|
@codex review Added persistent-child retitling, friendly role-name steering, event-driven inactive-child cleanup guidance, finalization-aware stop policy, and automatic removal of inactive sub-agent rows from the left sidebar. Also integrated a validated lifecycle simplification. Comprehensive targeted suites and |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f27b6f5eb7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Keep nested active children visible through inactive persistent parents, scope friendly role naming to sub-agents, and update integration and Storybook contracts for the transcript-canonical inactive hierarchy. --- _Generated with `mux` • Model: `openai:gpt-5.6-sol` • Thinking: `xhigh` • Cost: `$919.75`_ <!-- mux-attribution: model=openai:gpt-5.6-sol thinking=xhigh costs=919.75 -->
|
@codex review Addressed active nested descendants through inactive parents and scoped friendly role-title guidance in c186a72. Updated the stale UI integration and Storybook contracts for transcript-canonical inactive children. Targeted unit/UI tests, the affected Integration suite, a rebuilt Storybook interaction run, and |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c186a72d93
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Carry the nearest visible parent into final sidebar connector layout, remove the tautological prompt-copy test, and stabilize the updated integration contract. --- _Generated with `mux` • Model: `openai:gpt-5.6-sol` • Thinking: `xhigh` • Cost: `$919.75`_ <!-- mux-attribution: model=openai:gpt-5.6-sol thinking=xhigh costs=919.75 -->
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2516301148
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| parentId: | ||
| baseRowMeta.visibleParentWorkspaceId ?? | ||
| workspace.parentWorkspaceId, |
There was a problem hiding this comment.
Propagate visible ancestry to grouped rows
When an active workflow/best-of grandchild is promoted through an inactive parent, this effective-parent propagation applies only to ordinary workspace nodes; the grouped-row branch above still assigns group.parentWorkspaceId, which is the hidden original parent. computeRowMetaForVisibleNodes() therefore cannot place the synthetic group header in the visible ancestor's sibling run, leaving its connector detached and preventing active-through state from reaching preceding visible siblings. Fresh evidence after 2516301 is that the new visibleParentWorkspaceId is consumed only after the group branch has already continued; use the anchor's effective parent for group headers as well.
Useful? React with 👍 / 👎.
| parentId: | ||
| baseRowMeta.visibleParentWorkspaceId ?? | ||
| workspace.parentWorkspaceId, | ||
| depth: baseRowMeta.depth, | ||
| isRunning: isRunningOrStartingTaskStatus(workspace.taskStatus), |
There was a problem hiding this comment.
Use continuation status for final connector activity
When a previously reported child is reawakened, its taskStatus intentionally remains reported while taskExecutionStatus becomes starting or running. Although computeAgentRowRenderMeta() recognizes that continuation as running, this final node reconstruction records isRunning: false and then recomputes the connector metadata, so the active child's shared trunk—and any trunk through preceding siblings—renders inactive. Derive this flag from the execution status/live-active helper as well as the original task status.
Useful? React with 👍 / 👎.
Render durable role titles before explicit variant scope labels and steer parents to keep role names relevant without repurposing grouped candidate workspaces. --- _Generated with `mux` • Model: `openai:gpt-5.6-sol` • Thinking: `xhigh` • Cost: `$991.94`_ <!-- mux-attribution: model=openai:gpt-5.6-sol thinking=xhigh costs=991.94 -->
|
@codex review Clarified the single-visible-variant presentation in afd02af: the durable role title now renders first in primary text, the retained lane metadata is explicitly labeled |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: afd02af52a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| workspace.taskExecutionStatus === "starting" || | ||
| workspace.taskExecutionStatus === "running" || |
There was a problem hiding this comment.
Count active continuations before completed group members
When a reported variant/best-of child is reawakened, it retains its completed report while taskExecutionStatus becomes starting or running; this helper correctly treats it as active, but computeSidebarTaskGroups() checks hasCompletedAgentReport(member) first and immediately continues. If multiple grouped children are reawakened, or one runs alongside another visible member, the group therefore reports them as completed, undercounts or zeroes runningCount, and renders inactive group status/connectors despite live work. Prioritize the continuation/delegated-activity state before completed-report aggregation.
Useful? React with 👍 / 👎.
Summary
Makes sub-agents durable, reusable child workspaces with one consistent public lifecycle:
A report or
task_stopmakes a child inactive without deleting its workspace.task_send_messagesteers active work or reawakens an inactive child under the same stable task ID and workspace context.task_retitleupdates its short, friendly reusable role name.task_removeis the only irreversible cleanup operation.The left sidebar now shows sub-agents only while they are active; the chat transcript's sub-agent decoration is the canonical persistent hierarchy and remains available for inactive children.
Background
The previous task API mixed execution state with workspace retention:
task_terminatedestructively removed active sub-agents;task_workspace_lifecycleexposed archive/unarchive/worktree concepts;stickyandpreserveSubagentsUntilArchivecreated multiple retention classes;The new contract treats every user-owned sub-agent as a persistent specialist with a stable public identity and a parent-managed lifecycle.
Implementation
Uniform child identity and continuation recovery
wst_*continuation handles private.Public task operations
task_stop— cancels active work non-destructively and leaves unfinished children interrupted. Parent guidance now distinguishes cancellation from asking useful work to finalize normally.task_send_message— steers queued/running work or reawakens an inactive child in the same workspace, preserving the child's current model/thinking settings.task_retitle— changes a persistent child’s friendly role label, such asReviewerorSimplicity Auditor, without changing stable identity or filesystem paths.task_remove— irreversibly deletes inactive child workspaces, rejects active children, and removes nested children deepest-first.task_list— keeps private continuation handles hidden and adds event-driven housekeeping guidance when it encounters inactive user-owned children.task_workspace_lifecycleandtask_terminatefrom the advertised/executable toolset while retaining compatibility renderers for historical transcripts.Lifecycle, cleanup, and concurrency
Naming and UI
task_retitletranscript card, tool icon, schema/bridge registration, Storybook state, and shared-transcript output preservation.task_listcards render inactive-child cleanup guidance.Retention compatibility and simplification
stickyfrom task inputs, listing, and runtime behavior while retaining inert legacy fields for downgrade compatibility.preserveSubagentsUntilArchivefield canonicalized totruefor older builds but removes it from runtime/UI decisions.Validation
make static-checkmake typecheckRisks
task_removeis intentionally irreversible, though parent transcript/report evidence may remain.Generated with
mux• Model:openai:gpt-5.6-sol• Thinking:xhigh• Cost:$991.94