🤖 fix: hide archived task_list entries by default#3614
Conversation
|
@codex review |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
This comment has been minimized.
This comment has been minimized.
|
@codex review The previous Codex summary found no code issues but did not emit the approval signal expected by the repo readiness script. Please perform a final review and either leave actionable comments or approve with the standard no-major-issues signal. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c7c8fa5c4b
ℹ️ 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".
|
@codex review Addressed the archived background bash task finding and added targeted test coverage. Please take another look. |
|
Codex Review: Didn't find any major issues. Delightful! 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". |
Summary
Hide archived, non-actionable child workspace work from the agent-facing
task_listoutput by default, while preserving active work visibility and adding an explicitincludeArchived: trueescape hatch.Background
Archived child workspaces can leave stale completed/interrupted task records visible to agents. This change makes the normal discovery path focus on actionable work while still allowing archived history/debug inspection on demand.
Implementation
includeArchivedto thetask_listinput schema using.nullish()for strict-provider compatibility.Validation
bun test src/node/services/tools/task_list.test.tsmake typecheckMUX_ESLINT_CONCURRENCY=1 make static-checkbun test src/node/services/tools/task_list.test.tsandMUX_ESLINT_CONCURRENCY=1 make static-checkbun test src/node/services/tools/task_list.test.ts,make typecheck, andMUX_ESLINT_CONCURRENCY=1 make static-checkcreateTaskListToolsmoke harness confirming default hiding andincludeArchived: truerestoration.Risks
Moderate-low: this changes agent-facing task discovery semantics, but only for archived, non-actionable child workspace work. Active/actionable tasks remain visible, service-level descendant discovery remains broad, and
includeArchived: truepreserves the debug/history escape hatch.📋 Implementation Plan
Implementation Plan: Hide archived child workspaces from
task_listby default1. Goal and product semantics
Implement the behavior that when a workspace-created child workspace is archived, it stops appearing in the parent workspace's
task_listtool results by default.Recommended default semantics:
tasktool is archived and its surfaced task/turn is no longer actionable, omit it from normaltask_listoutput.queued,starting,running,awaiting_report,pending, or otherwise active/billable/resumable, keep it visible even when its workspace or ancestor workspace is archived.includeArchived: truetotask_listso agents/debug flows can intentionally inspect archived non-actionable work.Non-goals
TaskServicedescendant discovery defaults in a way that could break transcript/report lookup for archived descendants.2. Verified repository evidence
Read-only Explore agents verified the following code paths and constraints:
src/node/services/tools/task_list.ts/createTaskListToolaggregates four sources: descendant agent-task workspaces viataskService.listDescendantAgentTasks, workspace turn tasks viataskService.listWorkspaceTurnTasks, workflow runs viaworkflowService.listRuns({ workspaceId }), and background processes viabackgroundProcessManager.list().src/common/utils/tools/toolDefinitions.ts/TaskListToolArgsSchemadefines thetask_listinput schema. New optional tool parameters must use.nullish()rather than.optional()for strict provider compatibility.src/common/schemas/project.ts/WorkspaceConfigSchemastores archive state asarchivedAtandunarchivedAttimestamps, plusparentWorkspaceIdfor child workspace relationships.src/common/utils/archive.ts/isWorkspaceArchived(archivedAt, unarchivedAt)is the canonical archived-state helper.src/node/services/taskService.ts/listDescendantAgentTaskstraverses child agent-task workspaces byparentWorkspaceId;taskIdinDescendantAgentTaskInfois the child workspace ID.src/node/services/taskService.ts/listWorkspaceTurnTasksreturnsWorkspaceTurnTaskHandleRecord;workspaceIdon each turn is the child/target workspace where the turn executes.workflowService.listRuns({ workspaceId })are root-workspace scoped and do not carry a child workspace archive context, so they should not be archived-filtered.task_listtool rather than changingTaskService.listDescendantAgentTasksglobally.3. Recommended approach and alternatives
Recommended approach: tool-layer archived filtering with an explicit
includeArchivedflagNet product LoC estimate: +50 to +85 lines.
Add an
includeArchivedargument to thetask_listtool schema, default it tofalseincreateTaskListTool, and filter only thetask_listpresentation layer for archived, non-actionable child workspace entries. Keep service discovery broad by default so backend/report-loading paths remain intact.Why this is preferred:
task_listresult changes.includeArchived: truewithout adding a new UI or route.Alternative A: add
includeArchivedfiltering directly toTaskService.listDescendantAgentTasksNet product LoC estimate: +55 to +95 lines.
This would centralize filtering in service methods. It is less attractive because
TaskServiceis used by internal retrieval flows that may need archived descendants. It can still work if every internal caller is audited and defaults toincludeArchived: true, but the implementation is easier to get subtly wrong.Alternative B: change archive behavior to terminate/interrupt hidden work
Net product LoC estimate: +100 to +180 lines.
This would make archive a stronger lifecycle operation. It is over-scoped for the current ask and risks surprising users by conflating a visibility action with execution control.
4. Implementation phases
Phase 1 — Add the tool argument and document the behavior in the schema
Files:
src/common/utils/tools/toolDefinitions.tsChanges:
Extend
TaskListToolArgsSchemawith:If the tool description text near the schema explains default status behavior, update it to mention that archived non-actionable child workspace tasks are hidden by default and can be included with
includeArchived: true.Acceptance criteria:
null,false, andtruevalues forincludeArchived.statusesbehavior is unchanged..optional()-only field is introduced.Quality gate:
task_listtool tests added in later phases.Phase 2 — Add local archived-in-scope lookup helpers for
task_listFiles:
src/node/services/tools/task_list.tssrc/node/services/taskUtils.tsonly if an existing archive/ancestor helper is already shared thereChanges:
task_list.tsrather than a new publicTaskServiceAPI unless another caller demonstrably needs the helper.task_listexecution, then build a cheap lookup closure or map for archive checks. Do not reload config once per task/turn record.falsewhen a workspace ID cannot be found. Missing metadata should not hide potentially active work.src/common/utils/archive.tshelper for timestamp comparison.hasArchivedAncestorhelper is suitable and accessible without broad service API changes, reuse it; otherwise implement the local lookup from the loaded config's parent/child workspace metadata.Defensive-programming expectation:
Acceptance criteria:
Quality gate:
src/node/services/tools/task_list.test.tsfinal-output assertions. Addsrc/node/services/taskService.test.tsonly if implementation ends up adding a publicTaskServicehelper despite the preferred local-helper approach.Phase 3 — Filter
task_listchild-workspace sources onlyFiles:
src/node/services/tools/task_list.tsChanges:
In
createTaskListTool, compute:Filter descendant agent tasks after
taskService.listDescendantAgentTasks(...)returns and before formatting the final task list:task.taskId.queued,starting,running, andawaiting_report.includeArchivedisfalse;Filter workspace turn tasks after
taskService.listWorkspaceTurnTasks(...)returns and before formatting the final task list:turn.workspaceId.queued,starting, andrunning.includeArchivedisfalse;Do not filter workflow runs in this change.
Do not filter active background processes in this change. If existing code can list terminal background processes for archived child workspaces, leave them unchanged unless a focused read shows the product already treats them as child-workspace task records. This keeps the implementation scoped to the user-visible workspace task behavior.
Implementation notes:
task_listshould still ask for descendants normally, then hide archived non-actionable records at presentation time.hasArchivedAncestorhelper is not safely reusable without broad service API changes.Acceptance criteria:
task_listomits archived or ancestor-archived non-actionable descendant agent tasks.task_listomits archived or ancestor-archived non-actionable workspace turn tasks.task_liststill returns archived active/actionable descendant agent tasks and workspace turns.task_list({ includeArchived: true })disables archive filtering and returns archived/ancestor-archived non-actionable descendant agent tasks and workspace turns when their requested statuses match.statusesfiltering still works exactly as before except for the archive visibility rule.Quality gate:
task_listtests immediately after this phase before expanding validation.Phase 4 — Tests
Files:
src/node/services/tools/task_list.test.tssrc/node/services/taskService.test.tsonly if adding a publicTaskServicehelperAdd or update tests for:
Tool argument behavior
includeArchivedbehaves asfalsein final output.includeArchived: trueexposes archived non-actionable entries when their statuses are requested.includeArchived: nullbehaves asfalse.includeArchived: truedisables both direct-archive and ancestor-archive filtering while preserving normalstatusesfiltering.Descendant agent-task filtering
reportedis hidden by default whenreportedis requested.interruptedis hidden by default wheninterruptedis requested.runningis still returned.Workspace turn filtering
includeArchived: truerestores archived/ancestor-archived non-actionable turn visibility.Regression coverage
includeArchived.Testing cautions:
5. Validation and quality gates
Run validation in increasing scope:
Targeted unit tests:
The second command is required only if
taskService.tsgets a public helper or otherwise changes.Typecheck:
Lint/static validation:
Use the low-concurrency setting to avoid known local ESLint worker OOMs in constrained workspaces.
If static-check is too broad or blocked by an unrelated repo issue, record the exact failure and run the narrowest replacement set: targeted tests,
make typecheck, andMUX_ESLINT_CONCURRENCY=1 make lint.6. Dogfooding plan
Dogfood in an isolated Mux dev-server sandbox before claiming the behavior works. This section incorporates the
dev-server-sandbox,agent-browser, anddogfoodskills.Setup
Start a sandboxed dev server with its own temporary
MUX_ROOTso it does not conflict with other workspaces or the normal<MUX_ROOT>/server.lock:Options to use when appropriate:
Note: the sandbox may seed
providers.jsoncandconfig.jsonfrom$MUX_ROOT,~/.mux-dev, or~/.mux; it intentionally does not copysecrets.json.Before using browser automation, load the installed
agent-browserruntime guidance so commands match the local CLI version. Use the directagent-browserbinary, nevernpx agent-browser:Initialize dogfood output:
If that template path is unavailable in the executor's environment, create the same report shape manually and keep writing findings incrementally. Read the dogfood issue taxonomy at the start of the dogfood session.
Open the sandboxed app with
agent-browserusing a named session, then wait for network idle. Get<SANDBOX_URL>from themake dev-server-sandboxoutput:Create or select a disposable parent workspace.
From the parent workspace, create at least two child workspaces/tasks with the
tasktool:Start a repro video before archiving so the evidence captures the archive + default task-list + include-archived flow:
Archive the completed child workspace through the normal UI flow.
If practical, also archive the active child workspace to confirm active work still appears.
Functional checks
Continue the repro video started before archiving, and in the parent workspace trigger
task_listwith default arguments.Trigger
task_listwithincludeArchived: trueand non-actionable statuses requested, such asreported/interruptedfor agent tasks or completed/failed turn statuses.Confirm workflow runs are unaffected.
Confirm no active/billable process disappears from
task_listmerely because its workspace was archived.Stop the repro video:
During the run, use
snapshot -ifor interactive element discovery, plainsnapshotfor reading output text, and periodically check browser errors/console:Evidence to collect for review
task_listoutput showing the archived completed child omitted.includeArchived: trueoutput showing the archived completed child included.Dogfood wrap-up
Validate only through browser-observed behavior during dogfooding; do not inspect source code as part of the dogfood evidence pass.
Update the dogfood report summary counts/findings before closing the session.
Close the browser session:
7. Rollout and review notes
TaskServicedefaults or pruning traversal.8. Final acceptance checklist
TaskListToolArgsSchemaincludesincludeArchived: z.boolean().nullish().task_listhides archived or ancestor-archived non-actionable descendant agent tasks.task_listhides archived or ancestor-archived non-actionable workspace turn tasks.includeArchived: truedisables archive filtering while preserving normalstatusesfiltering.9. Advisor review status
Approved by advisor after review loop. Advisor requested and the plan incorporated: explicit archived-ancestor semantics without pruning traversal, positive actionable-status predicates,
includeArchived: truedisabling archive filtering while preserving normal status filtering, local/private archive lookup with config loaded once per tool execution, and final-output-oriented tests. After the requesteddev-server-sandbox,agent-browser, anddogfoodskill reads, the advisor re-approved the updated dogfooding plan with minor polish; the plan now starts recording before archive, uses directagent-browser, derives<SANDBOX_URL>from sandbox output, avoids source inspection during dogfooding, and includes dogfood report wrap-up plus session close.10. PR, CI, review, and merge-queue execution plan
Current verified state
workspace-admg.git status --short --branch:workspace-admg...origin/main [behind 1].src/node/services/tools/task_list.tssrc/node/services/tools/task_list.test.tssrc/common/utils/tools/toolDefinitions.tsdocs/hooks/tools.mdxsrc/node/services/agentSkills/builtInSkillContent.generated.tssrc/node/services/tools/task_list.ts+167/-2,src/common/utils/tools/toolDefinitions.ts+7/-0; approximate net product LoC: +172.src/node/services/tools/task_list.test.ts+287/-2.docs/hooks/tools.mdx+6/-5,src/node/services/agentSkills/builtInSkillContent.generated.ts+6/-5.bun test src/node/services/tools/task_list.test.tsmake typecheckmake fmtMUX_ESLINT_CONCURRENCY=1 make static-checkdogfood-output/task-list-archive/screenshots/initial.pngdogfood-output/task-list-archive/screenshots/task-list-default-and-include-archived.pngdogfood-output/task-list-archive/videos/archive-task-list-flow.webmdogfood-output/task-list-archive/report.mdPlan-mode boundary
This section is the executable handoff for the next Exec-mode pass. Do not commit, rebase, push, open PRs, or merge while still in Plan Mode.
Phase A — Pre-commit hygiene
Re-check branch and diff:
Decide whether to commit dogfood artifacts:
dogfood-output/**; they are evidence artifacts, not repo source, and they are currently untracked/ignored.git status --short --untracked-files=allshows dogfood files as tracked candidates, exclude them from the commit unless the user explicitly asks to version dogfood artifacts.Stage only intended files:
Commit locally:
git commit -m "🤖 fix: hide archived task_list entries by default"Phase B — Rebase on
origin/mainFetch and rebase:
If conflicts occur, resolve surgically in the touched files, rerun targeted validation, then continue:
bun test src/node/services/tools/task_list.test.ts git rebase --continueAfter a clean rebase, rerun validation:
run_and_report task_list_tests bun test src/node/services/tools/task_list.test.ts run_and_report static_check env MUX_ESLINT_CONCURRENCY=1 make static-checkPhase C — Push and create PR
Push the rebased branch:
Check attribution environment before creating the PR, per the
pull-requestsskill:Build the PR body with
mktemp, using--body-file. Include the implementation plan verbatim in a collapsed section per repository/user PR instructions. Suggested PR title:Suggested PR body skeleton:
Create the PR:
Phase D — PR checks and review loop
Request Codex review if PR creation does not trigger it automatically:
Run the repo helper and keep iterating until ready:
If checks fail:
wait_pr_ready.sh.If Codex leaves comments:
./scripts/resolve_pr_comment.sh <thread_id>;@codex reviewagain;./scripts/wait_pr_ready.sh <pr_number>.Also check non-Codex reviewer/bot comments, including
coder-agents-reviewif present. Do not silently resolve bot review threads.Phase E — Merge queue
Once all of these are true:
origin/main;then enqueue via merge queue:
Do not pass
--delete-branchwith merge queue enabled.If GitHub evicts the PR from the merge queue, re-check CI/reviews/head SHA and re-enqueue only if still green.
Generated with
mux• Model:openai:gpt-5.5• Thinking:xhigh• Cost:3387294{COSTS_USD}