Repository navigation
feat(mobile): a Captain's Crew and spawned agents move into the thread's Agents sheet - #1016
Conversation
…d's Agents sheet Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Pre-merge checks:
|
…lists Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Jacksondr5
left a comment
There was a problem hiding this comment.
Combined panel review (reviewer-opus + reviewer-sol) at 8149b32
Verdict: three small should-fixes. The design is otherwise approved: the Agents sheet and pill with seats and Peer Agents, the Chats chip removed, D22 kept. Still pending: device evidence and J5 CI.
Should-fix 1: the pill can undercount the sheet (raised by reviewer-sol)
j5AgentsPillSegment (packages/client-runtime/src/j5/spawnedChildren.ts) counts turn.subagents only when upstream's segment is non-null. When the provider subagents are from an older, finished turn, upstream hides its pill. With an idle Crew, J5 revives the pill as "3 agents" while ThreadAgentsSheet still lists those 3 seats plus 2 provider rows. The new test encodes that mismatch. Fix: when there are spawned children, count the provider rows the sheet actually shows even if upstream would hide its segment. Leave the children.total === 0 passthrough as it is.
Should-fix 2: an empty Agents sheet with no empty text (found by both reviewers)
useHasJ5Agents returns children.length > 0 from the raw read. The sheet's rows come from selectSpawnedChildRows, which drops archived children and solo agents the client has no thread for. So when only those remain (for example, a Captain whose Crew was archived, whose seats are now archived children), the sheet renders no J5 rows and also suppresses upstream's "No agents in this turn." That's a blank sheet. Base it on the same visible count the pill uses (childCountsAtom's total) or on the selected rows.
Should-fix 3 (perf): upstream's ThreadDetailBody re-renders on every crew or fleet revision (reviewer-opus)
useThreadSpawnedChildren calls useAtomValue(threadReadConnectionsAtom) and useAtomValue(placementRevisionsAtom), and it runs inside useJ5AgentsPillSegment in upstream's ThreadDetailBody. So the whole thread body re-renders whenever any connected server's crew or fleet revision moves, which happens on every Exchange opened or closed, and on any connection-state change. That's the re-render childCountsAtom was built to avoid. Fix: drive the forced read from an imperative subscription (appAtomRegistry.subscribe inside the effect) so it doesn't re-render the body. Nit: re-read only when the open thread's own environment's revision moves.
Checked and fine
- Chats row.
thread-list-v2-items.tsxis back to upstream's file, apart from the persona chip, and the chip and seats under rows are gone. D22's filter (useCrewListedThreads) is unchanged, so members stay off the top level and pinned ones stay listed. - Sheet. Crew blocks show the summary and Stop crew, permission-gated as before. A Peer Agents block follows. Rows use upstream's agent-row look (
SubagentStatusDotand its tone classes) and open through upstream'sopenChildThread. An unknown seat is listed but not opened. - Shared logic.
crewAgentStatusputs "Replaced by" first, seats report how their last run ended, and a solo agent shows "Idle". It's pure and tested, along withj5AgentsPillSegment. - The builder's two questions.
childCountsAtomkeys on the child ids and returns arunning/totalstring, so the body only re-renders when a count changes, apart from should-fix 3. The forced reads from several hooks coalesce in the store's pending set, so they don't duplicate requests. - Records. FORK.md case 115 is rewritten.
ThreadAgentsSheet.tsxgets one mount plus the empty-text condition, andThreadDetailScreen.tsxgets the segment wrap. The ledger rows and seams reaches are updated.
Reviewer-run checks
- client-runtime
spawnedChildren.test.tsandcrewState.test.ts: 18 passed. MobilereactCompilerCoverage.test.tsandupstreamSeams.test.ts: 1149 (reviewer-opus). reviewer-sol: 74 shared and seams tests plus 4 targeted compiler checks. vp run typecheck: mobile and web exit 0- lint: clean on the changed logic;
git diff --check: clean
Reviewed by Claude Opus 5.5 (reviewer-opus) and Sol 6.1 (reviewer-sol) in J5 Code.
…g on other servers' changes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Jacksondr5
left a comment
There was a problem hiding this comment.
Panel delta check (reviewer-opus + reviewer-sol) at e0c3d61
Verdict: all three should-fixes are resolved, with no new findings, and the panel approves the source. Still pending: Android and iOS evidence and J5 CI.
- Pill count. When spawned children revive the pill,
j5AgentsPillSegmentnow counts every subagent the sheet lists (turn.liveCountandturn.subagents.lengthwhenever a turn exists). An older turn's 2 subagents plus 3 idle children read "5 agents", and the test expects that. The no-children passthrough to upstream's segment is unchanged. - Empty sheet. The pill and
useHasJ5AgentsshareuseJ5AgentCounts, whose total comes fromchildCountsAtom, which uses the same rule asselectSpawnedChildRows. Archived-only or unknown-solo-only children no longer suppress upstream's "No agents in this turn." - Re-renders.
useThreadSpawnedChildrenno longer reads the global connections or revisions atoms in render. Its effect subscribes imperatively (appAtomRegistry.subscribe) to the connections atom and torereadOn("crew", "fleet")for the thread's own environment, force-reads that one thread, and disposes both subscriptions when the target changes or the screen unmounts.ThreadDetailBodynow re-renders only when this thread's children or counts change.
Reviewer-run: client-runtime spawnedChildren.test.ts passes (10), mobile reactCompilerCoverage.test.ts and upstreamSeams.test.ts pass (1149), and mobile vp run typecheck exits 0 (reviewer-opus). reviewer-sol ran the focused regression plus 2 compiler checks. Lint and git diff --check are clean.
Reviewed by Claude Opus 5.5 (reviewer-opus) and Sol 6.1 (reviewer-sol) in J5 Code.
Problem
At Checkpoint 4, Jackson found the "› N seats" count on a Captain's row in mobile Chats too small to be useful. Closes #1009.
What changed
The count and the seats under Chats rows are gone.
thread-list-v2-items.tsxis back to upstream's bytes, apart from the persona chip. Members still stay off the top level of Chats, and pinned members stay at the top (register D22, unchanged).The Agents sheet lists the thread's spawned agents. Upstream's in-thread sheet (
ThreadAgentsSheet) now shows them above its provider subagents:Rows follow upstream's agent-row look (status dot, title · status, chevron). Status reads Working, Needs you or Failed, otherwise Not started, Replaced by …, Completed, Interrupted or Idle. Tapping a row opens the member through upstream's own
openChildThread. Upstream's "No agents in this turn." shows only when both lists are empty.The Agents pill counts them. Live = provider subagents working + spawned agents with an active turn; total = both lists. While anything works it reads
live/total, otherwise "N agents". A Captain with an idle Crew keeps the pill between turns, where upstream alone would hide it.Data: the spawned-children read mobile already keeps for D22, now also read for the open thread, on open and whenever a
creworfleetrevision moves. The pill counts come from a per-thread atom that changes only when a count does. The pill counts and row statuses (j5AgentsPillSegment,crewAgentStatus) are pure functions in client-runtime, with tests.UI changes
Android, head
e0c3d61e24against trunkbed54fa2fc; same data and light theme.New states (after only):
Stop crew interrupts the running seat and the button disappears:
stop-crew-e0c3-published.mp4
Live testing
Android: pass at
e0c3d61e24againstbed54fa2fc, run by the Android tester (Sol 6.1) with real Claude Haiku 5.5 turns. Report: project artifacttest-reports/pr-1016/e0c3d61e24.md.Not exercised: dark theme; iOS and iPad (iOS at Checkpoint 5); Stop crew as a Viewer or when denied; Failed and Needs you rows; seats the phone holds no thread for; several environments.
Upstream impact
FORK.md case 115, rewritten for the new shape:
apps/mobile/src/features/threads/ThreadAgentsSheet.tsx: one J5 mount above the subagent rows; the empty text is conditioned on no J5 rows.apps/mobile/src/features/threads/ThreadDetailScreen.tsx: upstream'sresolveSubagentPillSegmentresult is passed throughuseJ5AgentsPillSegment.apps/mobile/src/features/threads/useThreadListV2.tsand its test: unchanged from feat(mobile): a Captain's seats list under its row, with Stop crew #993.apps/mobile/src/features/threads/thread-list-v2-items.tsx: feat(mobile): a Captain's seats list under its row, with Stop crew #993's edits removed; the reserved Thread-row identity seam reads "Not landed" again.The ledger rows and
apps/mobile/src/j5/upstreamSeams.test.tsfollow.floating-working-control.tsxis untouched; its hint "Opens this turn's subagents" stays upstream's (the Captain's call).Checklist
j5AgentsPillSegmentandcrewAgentStatuscases in client-runtime)FORK.md(case text and file-table row) in this PRpersonas.md's mobile Crews sentences change in the wave docs PR (wording sent to the Captain)Built by Claude Opus 5.5 in Claude Code (J5 Code crew seat).
🤖 Generated with Claude Code