Skip to content

fix(threads): keep finished subagents reachable - #332

Merged
nixuuu merged 1 commit into
devfrom
fix/finished-subagents-reachable
Nov 7, 2026
Merged

nixuuu merged 1 commit into
devfrom
fix/finished-subagents-reachable

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Finished subagents disappear from thread details when the default display setting is off. After the sidebar stopped listing subagents, this left no route to their history or composer.

Web (including desktop) and mobile now keep them under an expandable “N finished” group. It starts collapsed and remembers its state on the device. Each row opens the thread and shows its provider, title, outcome and relative activity time. The mobile composer chip opens the same list in a sheet. Keeping finished subagents in the main list remains available in Settings.

Owner follow-ups already work for completed, failed and interrupted subagents: the gateway preserves the child's worker and provider session. No gateway permission or lifecycle changes are needed. Explicitly archived threads remain readable and require Unarchive before a follow-up, preserving the existing archive behavior that stops work and schedules. The parent-origin link is unchanged.

Related: #322

Verification

  • Passed: bun install, bun run gen:check, bun run typecheck, bun run lint, bun run format:check, web build, mobile typecheck and bunx expo lint.
  • All PR CI checks are green on the final head, including static checks, all four test shards, typecheck and builds. Local full bun run check:tmp passed before rebase (1676 pass, 161 skip, 0 fail). After rebase: 1675 pass, 161 skip, 1 timeout in the existing CODEX routine and wakeup use the harness and preserve visibility test (5 s limit); that entire file then passed in isolation (11/11). Focused follow-up and Full access coverage passes after rebase (7/7). Every run cleaned its test temp directory. Scratch data stays under the worktree; GIT_CEILING_DIRECTORIES prevents temporary project fixtures from inheriting the enclosing worktree's remote.
  • Added gateway/worker integration coverage for full history and owner follow-ups after completed, failed and interrupted turns, child provider-session routing, and rejection of another owner's read/message attempts. No web UI tests added.
  • Real-browser checks used an isolated gateway, Postgres, scripted worker and web server. Subagents were spawned through gateway agent-bus calls. Checked 0/1/5 finished, short/typical/long titles, setting on/off, remembered expansion, light/dark and desktop/narrow/phone widths. Opened a finished thread, read its history and parent origin, and sent a follow-up from its composer. This verifies gateway routing and UI behavior with the scripted worker; it does not exercise live provider inference. Motion reuses the existing disclosure/expand tokens and reduced-motion handling.
  • Android and iOS checks were attempted through T3 devices and our Metro server. Both installed development clients fail to load current JS with Cannot find native module 'CanopyPinnedFetch'; native UI remains unverified. No native builds or temporary AVDs were created. Owned tabs, device panels, servers, tunnel and containers were cleaned up.

Componentize pass

Applied design, componentize and transitions-dev guidance using existing kit components. Web shares SubagentList and LineageRow; mobile shares SubagentLineage and its row between thread details and SubagentSheet. State classification and the existing compact age formatter live in the shared domain package. Native rows use now / 5m / 3h, avoiding Hermes's unsupported Intl.RelativeTimeFormat; web keeps its existing relative-time formatter. The final pass removed repeated list markup and kept provider/navigation icons in fixed slots with truncating titles.

Copy audit (§8)

Before → after Reason
“Show finished subagents” → “Keep finished subagents in the list” The setting controls placement; finished threads remain reachable with either value.
“Include completed, failed and interrupted subagents in thread details.” → “When off, completed, failed and interrupted subagents stay in a separate expandable group.” One 13-word sentence explains the off state without repeating the title.
Plain finished count → expandable “N finished”, with “Completed”, “Failed” or “Interrupted” per row Makes access and outcomes visible in words, with correct counts and sentence case.

Audited all ten items: concise active English and glossary terms; action labels unchanged; no new errors or empty-state copy; no duplicated explanatory facts, optional-gap messages or “soul” text; no meaning conveyed by color/icon alone. Short, typical and long titles were checked at desktop and phone widths in the browser. Native copy/layout checks share the device limitation above.

Keep completed, failed and interrupted subagents accessible from parent details and the mobile subagent sheet. Verify owner follow-ups retain the child worker and provider session.

Related: #322
@nixuuu
nixuuu force-pushed the fix/finished-subagents-reachable branch from 4c3f185 to 241918e Compare November 7, 2026 10:14
@nixuuu
nixuuu merged commit 2eb7684 into dev Nov 7, 2026
11 checks passed
@nixuuu
nixuuu deleted the fix/finished-subagents-reachable branch November 7, 2026 10:29
nixuuu added a commit that referenced this pull request Nov 7, 2026
Replaces the overflowing mobile subagent chips with one compact summary
row above the composer. Needs-input counts remain highlighted while
typing. Expanding shows state, title, provider/model and the first
plain-text line of the last message; finished subagents remain reachable
in their disclosure group, and rows open their threads.

The list uses a bounded overlay accordion (up to 240 dp, with internal
scrolling) instead of a sheet. It keeps the keyboard and composer focus
available and needs no additional sheet header or dismissal step. A
permanent 44 dp summary slot keeps the composer measurement and feed
reserve unchanged when agents start, finish or expand. Mention
suggestions retain their existing overlay slot and temporarily take
precedence. Expansion is collapsed by default and saved per device.

Also restores start/end timestamps for provider/recovery-origin turns in
the mobile snapshot reducer, including disk-cache replay. This fixes
missing elapsed time in the work header; older data without timestamps
says “Working” instead of “Working for” without a duration. Timers use
tabular digits.

Fixes: #231
Related: #332

## Verification

- Gates passed: `bun install`, `bun run gen:check`, `bun run typecheck`,
`bun run lint`, `bun run format:check`, web build, mobile typecheck and
`bunx expo lint`. Expo Doctor: 20/20; iOS and Android bundle exports
passed. Full `bun run check:tmp`: 1,755 passed, 161 skipped, 0 failed;
no test temp entries left. Test temporary data stayed inside the
worktree, with `GIT_CEILING_DIRECTORIES` to prevent nested test folders
inheriting the checkout's Git repository.
- Built an arm64 Android debug client on Linux with private SDK/Gradle,
no daemon, two workers, in-process Kotlin and a 2 GiB Java heap. No
EAS/store build or Mac build.
- T3 manual checks on Android 16: Medium Phone and a temporary copy of
the busy Canopy Fold profile; light/dark, keyboard open/closed, long
titles, one/many subagents, finished disclosure, row navigation, typing
mode, saved expansion after app restart, and system animations disabled.
Isolated gateway, scripted worker and Postgres provided two working +
one waiting + two finished subagents. A live provider-origin turn
displayed its elapsed time alongside “Wait threads…”.
- Dynamic 0 → 1 → finished on Fold kept the composer field at y=1697 and
the feed work header at y=1236. Compared the existing web panel in T3
preview at desktop and phone widths, light/dark. No UI tests added. iOS
UI remains unverified: installed clients could not load this JS (the
development launcher rejected Metro through ATS); no Mac rebuild
attempted.

## Componentize and motion pass

Completed before commit using the `design`, `componentize` and
`transitions-dev` skills. Composer and thread details share
`SubagentLineage`, `SubagentLineageRow` and `SubagentGroup`; web/mobile
share grouping and status presentation in `@canopy/domain/subagents`.
Native components accept `style`, use existing type/color tokens, and
keep spacing at the call site. Existing `pop`, `Expand` and chevron
motion tokens are reused; panel/group expansion is immediate with
reduced motion.

## Copy audit (§8)

- Individual truncated chips → “Subagents · N running · N finished” plus
“N needs/need input”: one scannable line, explicit counts and
singular/plural agreement; attention has a text cue as well as color.
- Sparse lineage rows → existing web labels “Working”, “Waiting for an
answer”, “Completed”, “Failed”, “Interrupted”, “N finished” and
“Previous subagents”, with provider/model and message context. Existing
“Working on it…” / “No message yet” cover missing previews. No new
glossary terms.
- “Working for” with no duration → “Working” only when no timestamp
exists; timed work keeps “Working for 2m 0s”. No invented elapsed time.
- Checked sentence case, punctuation, concise labels, accessible
disclosure state and short/long titles. Disclosure labels name their
contents, consistent with web. No new error, confirmation, empty-state
action, humor or repeated explanatory text.
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