Skip to content

🤖 fix: preserve subagent retention setting on partial saves#3245

Merged
coadler merged 1 commit intomainfrom
subagents-xfes
May 7, 2026
Merged

🤖 fix: preserve subagent retention setting on partial saves#3245
coadler merged 1 commit intomainfrom
subagents-xfes

Conversation

@coadler
Copy link
Copy Markdown
Collaborator

@coadler coadler commented May 6, 2026

Summary

Preserves optional task settings across partial config.saveConfig calls so enabling “Preserve subagents until the workspace gets archived” no longer gets silently reset by unrelated settings saves.

Background

The task cleanup path already respects preserveSubagentsUntilArchive when the setting remains true. The bug was that the API schema allows clients to save only the required numeric task limits, and the router normalized that partial payload as a full task-settings replacement. Missing optional flags therefore defaulted back to false, allowing completed subagents to be cleaned up before archive.

Implementation

  • Merge incoming task settings over the current normalized task settings before saving.
  • Add a router regression test that seeds both optional task flags to true, performs a schema-minimum task-settings save, and verifies the optional flags stay true while numeric limits still update.

Validation

  • Confirmed the new regression test failed before the fix, then passed after merging current task settings before normalization.
  • bun test src/node/orpc/router.test.ts
  • bun test src/node/services/taskService.test.ts -t "preserve subagents until archive"
  • make typecheck
  • make lint
  • make fmt-check
  • make static-check

Risks

Low. The change is scoped to config.saveConfig task settings persistence and only preserves existing optional values when a client omits them. Explicit task-setting changes still win.


Generated with mux • Model: openai:gpt-5.5 • Thinking: xhigh • Cost: $0.00

@coadler
Copy link
Copy Markdown
Collaborator Author

coadler commented May 6, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

ℹ️ 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
Copy link
Copy Markdown
Collaborator Author

coadler commented May 6, 2026

@codex review

Partial config saves can omit newer optional task flags while still satisfying the API schema. Merge incoming task settings over existing normalized settings so preserveSubagentsUntilArchive remains sticky across unrelated saves.

---

_Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `$0.00`_

<!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=0.00 -->
@coadler
Copy link
Copy Markdown
Collaborator Author

coadler commented May 6, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

ℹ️ 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 May 7, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 7, 2026
@coadler coadler added this pull request to the merge queue May 7, 2026
Merged via the queue into main with commit 8112b52 May 7, 2026
24 checks passed
@coadler coadler deleted the subagents-xfes branch May 7, 2026 16:25
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