Skip to content

fix(web): threads waiting on their own agents list under Working, even when pinned - #89

Merged
nullStack65 merged 2 commits into
release/native-0.1.10from
fix/native-0.1.10-waiting-on-agents-is-working
Nov 18, 2026
Merged

nullStack65 merged 2 commits into
release/native-0.1.10from
fix/native-0.1.10-waiting-on-agents-is-working

Conversation

@nullStack65

@nullStack65 nullStack65 commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Kameron, 2026-11-18 at about 22:20 UTC: "its showing waiting in the done area instead of under working".

Cause

The thread he saw, R720's "Dis Dat fork…", waits on a delegated Sonnet child and is pinned. The sidebar sorted every pinned thread into Pinned before checking whether it was working, and the Working tracker skipped pinned threads entirely. So a pinned parent waiting on its own agents sat at the top of the list among finished threads, reading "Waiting". Unpinned threads in the same state were already listed under Working.

Fix

  1. A pinned thread that is working counts as Working. That includes a thread waiting on its own background task or child agent. It lists under Working while that work runs and returns to Pinned when it finishes. It also gets the same 2-second exit grace as other Working threads, so it doesn't flicker out between a run and its continuation. Pinning or unpinning a thread mid-grace still ends the grace.

  2. Done, snoozed and settled threads keep their groups. A pinned thread that's finished stays in Pinned.

  3. A thread waiting on a person reads "Needs you" instead of "Approval" or "Input". That covers a pending approval or question on the thread or one of its subagents. The icon and color still tell the two apart, and those threads never count as Working. Waiting on a background task or child keeps its "Waiting" label, now inside Working.

  4. Mobile gets the same rule and labels (`threadListV2.ts`, `thread-list-v2-items.tsx`), so both clients agree.

This is the fork's default whenever the Working shelf is on, which it is by default. With project folders on, there is no Working shelf, so nothing changes there.

Not in this PR

Lead's request also asked for "routed to a human as action" to read "Needs you". I didn't key on the inbox's attentionKind: "action". Every thread a founder starts is routed to them as action by default, so all of Kameron's own finished threads would say "Needs you". The founder-inbox routing work on this branch is adding an explicit open-request signal (pendingHumanRequest / decisionRequest). Keying "Needs you" on that, once it lands, is a small follow-up.

Review round

One independent bot review (Claude Sonnet 5.5 via T3 delegation) at `36f86ddefd`: no blocking findings.

  • (2) Fixed: mobile had the same bug and the old labels. Fixed in `d1b01cc33e`, with a test for a pinned thread waiting on a child agent.
  • (1) Kept, a judgment call for Kameron: a pinned thread that's only running also lists under Working, not just one that's waiting. The Working shelf starts collapsed, and the thread's number-key jump slot moves with it. Moving only waiting threads would bounce a parent between Pinned and Working every time a child returns and it resumes, so the rule is "anything working is in Working". Reversing it is a one-line change in `resolveSidebarShelf` and the mobile partition. This changes the upstream mobile test that pinned the old behavior.
  • (3) and (4), noted: an optimistic pin reorder can release early, and a working pinned thread can't be reordered or unpinned by drag until it finishes.
  • (5), noted: the guest "Request" label and the longer header pill ("Pending Approval", "Awaiting Input") are unchanged; the pill already names the person's task.
  • (6), noted: the optimistic-drop helper and `resolveSidebarShelf` both decide Working.

Before and after (dev server, demo data)

Before, on release/native-0.1.10: the pinned "Nightly dependency audit" is waiting on its own work (a watched PR with checks pending), yet sits in the top list beside Done threads. The approval thread reads "Approval".

Before

After: it lists under Working (still showing its pin) and goes back to Pinned when done. The finished pinned thread stays at the top, and the approval thread reads Needs you.

After

The waiting state in the capture comes from an SQLite fixture in the dev server's own isolated state: a watched PR with checks pending, which parks a thread exactly like a pending child agent does. That fixture only produces the visual state; the tests cover the behavior.

Tests

  • threadInbox.test.ts: a pinned thread gets the Working exit grace. This fails on release/native-0.1.10 and passes with the fix.
  • Sidebar.logic.test.ts: a pinned or unpinned thread waiting on its own work lists under Working; finished pinned threads stay Pinned; settled and snoozed threads stay put; a pinned thread waiting on an approval is not Working.
  • vp test run on those two plus Sidebar.browser.test.tsx, entities.test.ts and threadShell.test.ts: 5 files, 152 tests passed.
  • Mobile: `threadListV2.test.ts` and `useThreadListV2.test.tsx`, 2 files, 70 tests passed. The mobile typecheck is clean. Not checked on a device or simulator.
  • Typecheck of client-runtime and web is clean; format and lint pass.

Opus 5.5 via Claude Code in T3 Code.

🤖 Generated with Claude Code

…n when pinned

A pinned thread waiting on its own background task or child agent stayed in
Pinned at the top of the list among finished threads, reading "Waiting", instead
of moving to Working. The partition sent every pinned thread to Pinned before
asking whether it was working.

A working pinned thread now lists under Working and returns to Pinned when it
finishes; it gets the same exit grace as any other Working thread. Done,
snoozed and settled threads keep their groups. A thread waiting on a person
(a pending approval or question) reads "Needs you" instead of "Approval" or
"Input".

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

Copy link
Copy Markdown
Owner Author

Independent bot review (Claude Sonnet 5.5 via T3 delegation), head 36f86dd

No blockers. The fix does what Kameron's report asks on web. I traced the paths below and ran Sidebar.logic.test.ts and threadInbox.test.ts (2 files, 111 tests pass). There are two should-fix items, one a design call for Kameron and one a gap on mobile. The rest are nits.

Findings

  1. should-fix (design call to confirm): a pinned thread that is merely running also leaves Pinned, and the Working shelf is collapsed by default. Sidebar.tsx:679-693 (shelf default false at Sidebar.tsx:475, rows hidden by routeThreadOnly at Sidebar.tsx:536).

    • Scenario: you pin a thread to keep it at the top and start a turn in it. It drops out of Pinned into a collapsed Working shelf, so only a count remains.
    • The keyboard jump order is built from orderedThreads (Sidebar.tsx:559-566), which lists visibleWorkingThreads, so it loses that slot. Every other pinned thread's jump number shifts each time a pinned thread starts or stops running.
    • Request 1 only asked for threads waiting on their own agents. Running pinned threads move too, because isThreadWorking is true for both. The tests only cover the waiting case.
    • Fix: either say in the PR that running pinned threads move too, and get Kameron's OK, or keep running pinned threads in Pinned and move only threads waiting on a child or task. For the narrower option, test runtime.status === "idle" or blockedOnThreadWait.
  2. should-fix: mobile still has the bug. apps/mobile/src/features/threads/threadListV2.ts:798 checks pinnedAt != null before the working check at line 800. A pinned parent waiting on a child still lists under Pinned and reads "Waiting" there. The "Approval" and "Input" row labels are unchanged at apps/mobile/src/features/threads/thread-list-v2-items.tsx:106,112.

    • AGENTS.md says to hit every surface. The PR text only says folder mode is unchanged, and doesn't mention mobile.
    • Fix: apply the same pinned-and-working rule and the "Needs you" label on mobile, or list mobile under "Not in this PR" with a follow-up.
  3. nit: optimistic pin-reorder can release early. Sidebar.tsx:797-815, isOptimisticDropReleased.

    • destinationKeys for a pinned drop is pinnedKeys, which now changes as pinned threads move between Pinned and Working. A pinned thread that starts or finishes work during the drop window makes membershipChanged true.
    • The optimistic order then releases before the new order keys land, so the list can briefly snap back and then re-sort. Active already behaved this way. It is short-lived and does not corrupt order.
    • Related: pinned drags build their order from visible rows only. A pinned thread hidden in Working whose pinOrderKey falls between two neighbours has no defined position relative to the moved row when it returns to Pinned. Harmless, but note it.
  4. nit: pin and unpin on a Working thread give no visible move. A working thread dragged from the Working shelf only drags as chat context. planSidebarThreadDrop returns none for working (Sidebar.logic.ts:411) and isContextDrag covers it (Sidebar.tsx:1759).

    • A pinned working thread can't be reordered or unpinned by drag. Pinning one from the menu doesn't move it, so it can look like the click did nothing. This is acceptable, but worth a line in the PR.
  5. nit: label coverage.

    • Guest "Request" status (SidebarThreadRow.tsx:~816) is also waiting on a human but still reads "Request". Add it to "Needs you" or say it was left out on purpose.
    • The web status pill still says "Pending Approval" and "Awaiting Input" (Sidebar.logic.ts:1217).
    • The row text no longer separates approval from input. Only the icon and colour do, so confirm the icons carry an accessible name.
  6. nit (anti-overengineering): two places decide Working. partitionSidebarThreads keeps the old inbox() helper for optimistic drops and adds resolveSidebarShelf for canonical threads (Sidebar.tsx:644-648, 679-693). The helper is small and pure, so I wouldn't block on it. If it gets touched again, route both branches through resolveSidebarShelf. No new service, setting or state was added, which is right.

Checked and fine

  • Working-thread check. isThreadWorking returns true for a thread waiting on a delegated child.
    • shellRuntime (models.ts:230) parks the runtime at idle when backgroundWorkHoldsCompletion is true and the thread is not failed. The !threadRuntimeIsActive && status !== "idle" guard lets idle through.
    • running with blockedOnThreadWait is active, so it is Working, and the row status stays "Waiting" (Sidebar.logic.ts:962). I found no path that leaves a waiting-on-own-child thread out of Working.
    • Pending approval, input, or a subagent request makes it not Working and reads "Needs you".
    • A finished thread (completed) is not Working. A plan-ready thread is not Working.
  • Drag and drop.
    • draggableThreadKeys and activeReorderableThreadKeys come from all visible threads, so they are unaffected.
    • resolveSidebarDropTarget stops building pinnedOrder at working-header, and it returns null for a working slot, so a Working pinned thread can't enter the pinned order.
    • planSidebarThreadDrop returns none for a working source.
    • pinnedKeysById is built from all threads. Pinned order keys are not corrupted.
  • Grace.
    • Pin or unpin mid-grace: pinnedAt is part of the placement string, so moved is true and the deadline is null. The thread leaves Working at once.
    • A run that ended over 60 seconds ago gets no grace (endedLongAgo), as for unpinned threads.
    • Archived, deleted, settled and snoozed threads are still excluded.
    • A pinned thread now flips Working to Pinned after 2 seconds, which is the intended behaviour.
  • Folder mode. workingShelfEnabled is false when folderGroups !== null, so nothing changes there.
  • Sweep actions compare sectionByThreadKey, which now says working for these rows, so they sweep with other Working rows.
  • Tests. The new tracker test is a real regression test. The resolveSidebarShelf test covers the helper and the logic, but no test drives partitionSidebarThreads itself, which is acceptable.

…even when pinned

Mobile had the same order as web: every pinned thread went to Pinned before
the Working check, so a pinned parent waiting on its child sat in the top
list. A working thread now lists under Working pinned or not, and a thread
waiting on a person reads "Needs you", matching the web sidebar.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nullStack65
nullStack65 merged commit 8ddb5d9 into release/native-0.1.10 Nov 18, 2026
2 checks passed
@nullStack65

Copy link
Copy Markdown
Owner Author

Fleet build artifacts from release/native-0.1.10 at 8ddb5d91a8 (this PR's merge). That's 2349389883 plus #84, #86, #89, #90 and #91. Built on ASUS with the same recipe as before. Nothing is installed; installs belong to the fleet cutover owner.

Artifact Path on ASUS sha256 Checks
Linux x64 headless server (t3 serve, ASUS and R720) ~/.local/share/closura/t3-release-staging/closura-fleet-server-0.1.10-8ddb5d91/t3-0.1.10-linux-x64.tar.gz d3d99580209dc8b11ff4051315f8b8ffbccb836d6876062ff9853281410ca4e6 smoke-cli-archive.ts --expect-version 0.1.10 passes. Max GLIBC 2.34. Linked environments is on by default. manifest.json sits beside it.
Linux x64 desktop AppImage (laptop) ~/.local/share/closura/t3-release-staging/closura-fleet-desktop-0.1.10-8ddb5d91/T3-Code-0.1.10-x86_64.AppImage 345fd7c04398e006b94dced9d9417dd25bc2122d83f9a8f2b7b9ebe97a344230 No app-update.yml, and the bundled server reports 0.1.10. The committed qualify script, which includes #86, gives failed_gates: [].
Linux x64 desktop .deb same folder, T3-Code-0.1.10-amd64.deb d9936aac7aabc02061bb9577f38017049e83f78da6e4868e0b5cb5f7b9d6d02a Same build.

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