Skip to content

[tasks] 🤖 feat: support sticky subagents#3744

Merged
coadler merged 3 commits into
mainfrom
feat/sticky-subagent-retention
Jul 21, 2026
Merged

[tasks] 🤖 feat: support sticky subagents#3744
coadler merged 3 commits into
mainfrom
feat/sticky-subagent-retention

Conversation

@coadler

@coadler coadler commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds explicit, user-requested sticky subagents whose child workspaces remain available after reporting instead of being cleaned up automatically.

Background

Subagents are normally transient: once they report and their artifacts are durable, Mux removes their child workspace. Some delegated work needs longer-lived ownership, such as assigning a separate subagent to maintain a PR. That retention must be explicit so ordinary delegation keeps its current cleanup behavior.

Implementation

  • Add an opt-in sticky task argument and instruct agents to use it only when the user explicitly requests persistent subagent ownership.
  • Persist sticky retention on queued and running task workspaces and expose it through task discovery.
  • Exclude sticky tasks from automatic report cleanup, startup recovery cleanup, and workflow-owned cleanup sweeps.
  • Prevent parent archive or removal from orphaning retained descendants while preserving explicit archive, removal, and termination actions on the sticky subagent itself.
  • Remove project workspaces deepest-first during an intentional forced project deletion so sticky descendants are deleted before their parents.
  • Regenerate the tool-input documentation for the new argument.

Risks

This touches task, project, and workspace lifecycle code, so the main risk is retaining or removing the wrong child workspace. The new state is opt-in and absent on existing tasks, preserving current behavior by default. Coverage exercises direct and grouped creation, queued persistence, restart/workflow cleanup, nested lineage reduction, task discovery, parent lifecycle guards, and forced project deletion ordering.


Generated with mux • Model: openai:gpt-5.6-sol • Thinking: max • Cost: $93.96

Add explicit opt-in retention for user-requested sticky subagents.
Persist the setting, skip automatic cleanup, and prevent parent lifecycle
actions from orphaning retained task workspaces.

---

_Generated with `mux` • Model: `openai:gpt-5.6-sol` • Thinking: `max` • Cost: `$56.22`_

<!-- mux-attribution: model=openai:gpt-5.6-sol thinking=max costs=56.22 -->
@coadler

coadler commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@mintlify

mintlify Bot commented Jul 21, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
Mux 🟢 Ready View Preview Jul 21, 2026, 5:41 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 944d8367cf

ℹ️ 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".

Comment thread src/node/services/workspaceService.ts
Order forced project workspace cleanup by task depth so sticky descendants
are removed before their parents and cannot block the intended project-wide
cascade.

---

_Generated with `mux` • Model: `openai:gpt-5.6-sol` • Thinking: `max` • Cost: `$84.40`_

<!-- mux-attribution: model=openai:gpt-5.6-sol thinking=max costs=84.40 -->
@coadler

coadler commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed the project-deletion finding by removing project workspaces deepest-first, with nested sticky-task regression coverage. Please take another look.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9fec73be09

ℹ️ 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".

Comment thread src/common/utils/tools/toolDefinitions.ts Outdated
Treat an explicit false value as equivalent to omitting sticky retention when
launching a persistent full workspace.

---

_Generated with `mux` • Model: `openai:gpt-5.6-sol` • Thinking: `max` • Cost: `$93.96`_

<!-- mux-attribution: model=openai:gpt-5.6-sol thinking=max costs=93.96 -->
@coadler

coadler commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed the workspace sticky: false validation finding and added regression coverage. Please take another look.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: c9feee8c13

ℹ️ 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".

@coadler
coadler added this pull request to the merge queue Jul 21, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 21, 2026
@coadler
coadler added this pull request to the merge queue Jul 21, 2026
Merged via the queue into main with commit 4c1fa27 Jul 21, 2026
21 of 22 checks passed
@coadler
coadler deleted the feat/sticky-subagent-retention branch July 21, 2026 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant