Skip to content

fix(mobile): a narrowed person's Chats lists the spawned thread they can reach - #1144

Closed
Jacksondr5 wants to merge 1 commit into
j5/mainfrom
j5code/fix-1081-orphan-spawned-thread
Closed

Jacksondr5 wants to merge 1 commit into
j5/mainfrom
j5code/fix-1081-orphan-spawned-thread

Conversation

@Jacksondr5

@Jacksondr5 Jacksondr5 commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

Problem

A thread-only Viewer whose only thread is a spawned agent could see "No threads yet" on Chats. Spawned threads stay out of Chats because they're reached through their spawner (register D22), but this person can't see the spawner. Closes #1081.

What changed

The capture in #1081 came from re-pairing an Owner phone as a Viewer at 7d2f1bc. Then, the spawned-children answers read under the Owner's credential outlived the re-pair. #1111 made that memory per credential, which fixed the re-pair path.

One path was left: the same credential narrowed by a level change, live or before a cold start. A server that reaches less than the whole server refuses this person the spawned-children read (listSpawnedChildren is server-scope in AccessGate.ts). So the answers it gave while they were wider are never replaced, and a thread marked spawned then stays hidden.

crewListedThreads (apps/mobile/src/j5/connection/memory.logic.ts) now lists every thread on a narrow server, whatever the memory says. Its doc comment already said a narrower person's threads show. On a narrow server, Chats lists every thread, whether the credential is fresh or was narrowed (Captain's ruling). So "members stay out unless pinned" holds only where the server answers the spawned-children read, which means server-wide people. A narrow person with a fresh credential already saw members at the top level. A narrowed credential now does too, including a project Viewer whose spawner stays visible. Letting the server answer narrow people by reach is a follow-up the Captain is filing.

Seen, not fixed: on a cold start of a narrowed credential, the stale memory applies until the access read says narrow, so "No threads yet" can flash briefly. D22 in docs/j5/product/upstream.md ("appears in the expander under the agent that spawned it") has never held for someone who can't see the spawner.

Web: web has the same gap in an open tab, but its fix belongs in web's own J5 file (useAgentSpawnedThreadKeys), not shared code, so it's filed as #1143.

UI changes

Evidence pending from the tester: the thread-only Viewer's Chats screen, light and dark, full screens, before and after, on Android and iOS.

Live testing

Pending.

Council review

Delegate Round 1
Claude Opus pending
GPT Sol pending

Checklist

  • One concern: the description has no "also"
  • Tests cover the changed behavior (backend changes ship with focused tests)
  • UI changes: before/after screenshots above, and a video for motion or interaction (pending from the tester)
  • Live testing: the section above says what ran live and what did not (pending)
  • Upstream-owned files: each one is recorded in FORK.md (case text and file-table row) in this PR (none edited)
  • Upstream product: any change to what upstream's product does has a human decision linked above and a register entry in docs/j5/product/upstream.md (none)
  • Surfaces: entry points, clients, providers, contracts, reverse states, connection modes (see AGENTS.md): mobile Chats and the sidebar share the hook; web filed as Web: a person narrowed to a spawned thread while connected doesn't see it in the sidebar #1143
  • Docs: definitions under docs/j5/product/ and user docs rewritten where this changes them (no change needed)

Built by Claude Opus 5.5 in Claude Code (J5 Code Crew builder seat).

🤖 Generated with Claude Code

…can reach

A server that reaches less than the whole server refuses this person the
spawned-children read, so what it said while the credential was wider is
stale and can hide their only thread. Chats now ignores those answers on a
narrow server.

Fixes #1081

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vercel

vercel Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
j5-code Ready Ready Preview Nov 21, 2026 9:23pm UTC

Request Review

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:M 30-99 effective changed lines (test files excluded in mixed PRs). labels Nov 21, 2026
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The mobile thread-listing logic now treats narrow servers separately from other servers. It lists their threads regardless of remembered spawned-thread answers and does not consider those threads waiting for an answer.

Changes: Mobile narrow-server thread listing

Layer / File(s) Summary
Derive and apply narrow-server thread rules
apps/mobile/src/j5/connection/memory.ts, apps/mobile/src/j5/connection/memory.logic.ts, apps/mobile/src/j5/crew/spawnedChildren.ts, apps/mobile/src/j5/connection/memory.logic.test.ts
narrowServersAtom derives narrow-server IDs from the catalog. The listing hooks pass those IDs to the helpers, which include narrow-server threads without applying remembered spawned-thread classifications or answer-expectation checks. Tests cover this behavior and update existing helper calls.
Estimated code review effort: 2 (Simple) ~10 minutes

Possibly related PRs

  • Jacksondr5/j5code#1111: Both PRs change how remembered spawned-children answers affect mobile thread visibility.
Merge Risk: Minimal · up to e6095

This change makes mobile Chats list every thread on a server where the person has narrow access, so a thread-only Viewer sees the spawned thread they can open. Wider servers keep their existing filtering. No concrete merge-blocking risk was found. Screenshots and live testing are still pending.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the fix and the area: a narrowed person's Chats now lists the spawned thread they can reach. This matches the main change, which makes crewListedThreads list every thread on a narrow s…
Linked Issues check Passed Directly linked issue #1081 requires that a spawned thread whose parent the person cannot see is listed for them on mobile Chats. At the reviewed head, crewListedThreads (apps/mobile/src/j5/connecti…
Out of Scope Changes check Passed The changed code is limited to the spawned-thread list path in mobile: crewListedThreads and crewListWaiting gain a narrow parameter, narrowServersAtom is added in memory.ts, and useAnswers,…
Description check Passed The description follows the required template's main sections: Problem, What changed, UI changes, Live testing, Upstream impact, and Checklist. The Problem and What changed sections are detailed and t…
Full details: Title check

Explanation

The title names the fix and the area: a narrowed person's Chats now lists the spawned thread they can reach. This matches the main change, which makes crewListedThreads list every thread on a narrow server regardless of remembered answers. The title is specific and scoped to mobile.

Full details: Linked Issues check

Explanation

Directly linked issue #1081 requires that a spawned thread whose parent the person cannot see is listed for them on mobile Chats. At the reviewed head, crewListedThreads (apps/mobile/src/j5/connection/memory.logic.ts) takes a narrow set and returns true for any thread whose environment is narrow, before consulting remembered spawned answers. narrowServersAtom (memory.ts) is built from j5Sharing.isNarrow(id), and useAnswers in spawnedChildren.ts passes it into both crewListedThreads and crewListWaiting. A thread-only Viewer reaches less than the whole server, so its spawned thread is listed, and stale answers from a wider credential no longer hide it. Pinned and archived handling is unchanged. The spawned-children read is also skipped for narrow servers (threadReadConnectionsAtom), which matches the refusal the PR describes. The PR states that a test covers the narrow-server case; I did not read the test file and did not verify the AccessGate refusal claim directly. The 'New thread' button is explicitly excluded by the issue and by the PR, so it is not assessed. Live testing and UI screenshots are pending, but they are non-coding evidence.

Full details: Out of Scope Changes check

Explanation

The changed code is limited to the spawned-thread list path in mobile: crewListedThreads and crewListWaiting gain a narrow parameter, narrowServersAtom is added in memory.ts, and useAnswers, useCrewListedThreads, and useCrewListWaiting in spawnedChildren.ts pass the set through. The related test updates in memory.logic.test.ts support the changed signatures and the new narrow-server behavior. Each change connects directly to #1081. The web fix is deferred to #1143 and is not in this diff. No unrelated changes were identified in the summary.

Full details: Description check

Explanation

The description follows the required template's main sections: Problem, What changed, UI changes, Live testing, Upstream impact, and Checklist. The Problem and What changed sections are detailed and tie the change to issue #1081, the affected code path in memory.logic.ts, and the web follow-up #1143. The Upstream impact section is missing. The template says to delete it only when the PR touches only J5-owned paths. The changed files are under apps/mobile/src/j5, which is J5-owned, so omitting the section is acceptable, but the author should confirm this. Pending items are clearly marked: UI evidence, live testing, and the council review table, which is not in the template. The description does not name the test that covers the new behavior. The sentence in the checklist about tests is checked without a named test or command.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • 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 4778ae9 and e60950f.

Files selected for processing: 4

  • apps/mobile/src/j5/connection/memory.logic.test.ts
  • apps/mobile/src/j5/connection/memory.logic.ts
  • apps/mobile/src/j5/connection/memory.ts
  • apps/mobile/src/j5/crew/spawnedChildren.ts

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 3 reviews per hour.

@Jacksondr5

Copy link
Copy Markdown
Owner Author

Closing unmerged, per the Captain. Lowering a person's access revokes their sessions for renewal (apps/server/src/j5/sharing/Access.ts, People and access AC17), so the phone renews with a new bearer token. #1111's mobile memory is keyed on that token, so it starts empty, like a fresh pairing. The "same credential, narrowed" path this PR handles can't happen. The tester confirmed on base 4778ae9 that a narrowed thread-only Viewer's Chats lists the spawned thread, live and after a cold launch (see #1081).

This branch was successfully deployed

1 active deployment
Preview — e60950fa Deployed Nov 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 effective changed lines (test files excluded in mixed PRs). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mobile: a thread-only Viewer whose thread is a spawned agent sees "No threads yet"

1 participant