Skip to content

fix(web): settled remote delegated tasks stay hidden after their pare… - #42252

Open
finnn789 wants to merge 2 commits into
pingdotgg:mainfrom
finnn789:fix/remote-delegated-settled-stay-hidden
Open

finnn789 wants to merge 2 commits into
pingdotgg:mainfrom
finnn789:fix/remote-delegated-settled-stay-hidden

Conversation

@finnn789

@finnn789 finnn789 commented Nov 24, 2026 •

Copy link
Copy Markdown

Problem

When a parent thread on environment A is archived, deleted, or reset, every completed remote delegatedFrom child on linked environment B shows up as a standalone top-level thread in B's sidebar. Old delegated sub-tasks flood the list.

Expected: completed delegated tasks stay grouped under their parent (hidden from the top level) even after the parent is archived, deleted, or gone.

Reproduction: link environments A and B, run several delegate_task calls from a parent on A targeting B, let them finish, then archive or delete the parent (or reset A's statev2.sqlite). B's sidebar lists every finished child.

Change

delegatedUnderParentAtom in packages/client-runtime/src/state/threadShell.ts only hid a delegated child while its parent was in the catalog and unarchived. Otherwise it listed the child on its own, whether or not the child had finished.

Now a settled child (!isChildRunLive) stays hidden regardless of its parent's state. A running or waiting child is still listed on its own when its parent is archived or gone, so unfinished work is never hidden. The logic lives in packages/client-runtime, which web and mobile share (including the command palette), so no per-client change is needed.

This narrows an existing rule. Before, a delegated task whose parent the client could not list always kept its own row, "so its work is never out of reach". That now applies only to live tasks. The comments on isShownUnderParent and resolveListedAncestorThreadRef are updated to match.

Scope

Bug fix for #42226. Related earlier fixes (#34870, #42197) covered trimmed snapshots and unsettled children, not this archive/delete/reset case.

The issue's second option, cascade-archiving remote children on the server, is not part of this PR. It changes the server and wire contract, and would not cover a deleted or reset parent.

Verification

  • Extended the existing "lists a task a linked environment runs for a listed thread under that thread" test in threadShell.test.ts: after the parent is archived, a settled task stays hidden; it also stays hidden once the parent is removed.
  • Against HEAD without the fix, the new assertion fails (the settled task is listed). With the fix, threadShell.test.ts passes.
  • vp run check:changed: format, lint, knip, typecheck and tests pass.
  • Not checked: a manual pass in the web or mobile client. No screenshots, since the change is in state logic.

Open question for maintainers: a settled child whose parent is archived or gone now has no row in the sidebar, command palette, or archived list (the child itself is not archived on its machine). It is reachable only by direct link. Do you want a way back to those tasks, for example through the archived list? Happy to follow up separately.

Fixes #42226

Claude Sonnet 5.5 via Claude Code

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 24, 2026
@juliusmarminge juliusmarminge added takeover:in-progress A takeover lead is working on this PR takeover:blocked Takeover blocked; reason in the PR body and removed takeover:in-progress A takeover lead is working on this PR labels Nov 24, 2026
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The delegated task selector now keeps settled delegated tasks hidden when their parent is archived or unavailable. Live tasks with an unlisted parent remain in thread lists. The test covers an archived parent and a cleared parent snapshot.

Changes: Delegated task navigation

Layer / File(s) Summary
Parent state filtering and test coverage
packages/client-runtime/src/state/threadShell.ts, packages/client-runtime/src/state/threadShell.test.ts
Settled delegated tasks are treated as under their parent even when the parent is unavailable or archived. Live tasks remain grouped under the parent only when its environment is enabled and its thread exists and is not archived. The test checks navigation with an archived parent and after its snapshot is cleared.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: juliusmarminge

Merge Risk: Minimal · up to b7b3d

This stops completed delegated tasks from reappearing as top-level threads after their parent is archived or removed, while unfinished tasks stay visible. The change is small and covered by an extended test, so merge risk is minimal. Settled child tasks in that situation are now reachable only by direct link, which the PR describes as intentional.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the fix and the affected behavior: settled remote delegated tasks stay hidden after their parent is archived, deleted, or gone. It matches the main change in threadShell.ts and its tes…
Description check Passed The description follows the template. It has Problem, Change, Scope, and Verification sections, and it links issue #42226. It explains the root cause, the narrowed rule, and the tests run. It also nam…
Linked Issues check Passed [#42226] Requires completed remote delegatedFrom children on linked environment B to stay out of the top-level sidebar when parent A is archived, deleted, or gone. Evidence at head b7b3d97:

1. resolv…
Out of Scope Changes check Passed The PR, per its description and summary, changes only packages/client-runtime/src/state/threadShell.ts (visibility rule and comments) and threadShell.test.ts (regression assertions). Both serve the #4…
Full details: Title check

Explanation

The title names the fix and the affected behavior: settled remote delegated tasks stay hidden after their parent is archived, deleted, or gone. It matches the main change in threadShell.ts and its test. The text is cut off at the end ('pare…'), which reduces clarity but does not make the title off-topic.

Full details: Description check

Explanation

The description follows the template. It has Problem, Change, Scope, and Verification sections, and it links issue #42226. It explains the root cause, the narrowed rule, and the tests run. It also names the open question about reachability. The template's screenshot requirement does not apply because the change is in state logic, and the author says so. The author notes that manual web and mobile checks were not run.

Full details: Linked Issues check

Explanation

[#42226] Requires completed remote delegatedFrom children on linked environment B to stay out of the top-level sidebar when parent A is archived, deleted, or gone. Evidence at head b7b3d97:

  1. resolveListedAncestorThreadRef in packages/client-runtime/src/state/threadShell.ts returns the child's own ref when its delegatedFrom parent is missing or archived. A settled child therefore resolves to a ref that matches no row. A live child keeps its own row. This matches the described rule.
  2. isShownUnderParent hides a delegated child whose key is in delegatedUnderParent. The updated comments describe the settled-hidden and live-listed rule.
  3. The PR description and the AI summary agree that delegatedUnderParentAtom now hides a child when !isChildRunLive, whatever the parent state.
  4. The test change extends the existing threadShell.test.ts case to assert that a settled task stays hidden after its parent is archived and after the parent is removed.

Limits: the diff tools failed (changed blobs missing from checkout). The delegatedUnderParentAtom body and the test file were not read directly; the file read was truncated before that atom. The verdict relies on the visible resolver code, the PR description, and the summary. The change since the previous reviewed head (93d98fc) could not be diffed, so it was not separately verified. Reachability of settled children is an open maintainer question. The issue does not require it.

Full details: Out of Scope Changes check

Explanation

The PR, per its description and summary, changes only packages/client-runtime/src/state/threadShell.ts (visibility rule and comments) and threadShell.test.ts (regression assertions). Both serve the #42226 objective. The visible resolver code in threadShell.ts matches that objective. No unrelated change is reported. Limits: the diff tools failed, so the full file list and changed hunks were not read directly. The verdict relies on the PR description and the summary. Changes since the previous reviewed head (93d98fc) could not be diffed.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 93d98fc and b7b3d97.

Files selected for processing: 1

  • packages/client-runtime/src/state/threadShell.ts
Files skipped from review as they are similar to previous changes: 1

  • packages/client-runtime/src/state/threadShell.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). takeover:blocked Takeover blocked; reason in the PR body vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Archiving, deleting, or resetting a parent thread floods the linked machine's sidebar with old completed remote delegated tasks

2 participants