Skip to content

feat(mobile): agents' messages read as letters, not envelopes - #843

Merged
Jacksondr5 merged 3 commits into
j5/mainfrom
j5code/mobile-timeline-delegate
Nov 1, 2026
Merged

Jacksondr5 merged 3 commits into
j5/mainfrom
j5code/mobile-timeline-delegate

Conversation

@Jacksondr5

@Jacksondr5 Jacksondr5 commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Problem

The native app drew J5's agent messages in upstream's rows: raw envelopes and reply-tool footers, spawn briefs as <j5_spawn_context> XML, platform notices and Inbox replies as the reader's own words, and every non-local sender as "Agent". Closes #699.

What changed

Mobile now calls the shared classifier (packages/client-runtime/src/j5/userMessagePresentation.ts) through FORK.md's two reserved seams, which land as case 97:

  • Timeline delegate (ThreadFeed.tsx). A letter from an agent, automation, outside agent, peer or spawner folds on the left under an identity line. The line names the sender from the identity read, falling back to the sender thread's title and then "Agent", and shows at most one tag or badge (Automation, Outside agent, Expects reply, Replied). A spawn brief reads "⟨spawner⟩ · brief" and previews the spawner's own first line. The folded preview and the opened body are the letter only. Open thread reaches the identity read's thread, on this server or a peer, and a brief's spawner thread. An Inbox reply is the reader's own ("You · via Inbox") only when the reader sent it; anyone else's sits on the left under their name. Copy never includes the envelope.
  • Notices match today's web look. A silence is one muted line. A delivery notice J5 can't parse yet, and any Crew notice (not restyled; Crews are deferred), shows as a labelled raw card on the left instead of a "you" bubble.
  • Queue-row formatter (ThreadQueueControl.tsx). A queued delivery in "Up next" reads From <sender>: <first line>.

Shared logic now lives in one place: presentParticipantIdentity, the queued-delivery formatter, the identity-read mapping, and the sender-thread and author-name rules move from apps/web/src/j5/a2a into packages/client-runtime/src/j5/participantIdentity.ts. Web imports them from there, with no change in behaviour (web's A2A tests pass unchanged).

Not in this PR: authors in shared threads, answered-by and search authors (#832, next on the same seam). The grey notice and prompt redesign is #698.

UI changes

Android 16 emulator, 1080×2400 in the light theme, the same isolated home and data on both sides. Before is base 31447c91c6. After is head 15490da86e for the first two rows and a9127e53ce (the same UI) for the rest.

State Before After
Folded spawn brief and agent letters: before, the brief reads "Agent <j5_spawn_context>" and letters preview [Cross-agent … on the right; after, each sits on the left under the sender's name, with "· brief" and "Expects reply" Folded spawn brief and agent letters, before Folded spawn brief and agent letters, after
Expanded agent question: the letter alone with Open thread, instead of the envelope and reply footer Expanded agent question, before Expanded agent question, after
Expanded spawn brief: the spawner's words with Open thread, instead of the identity block Expanded spawn brief, before Expanded spawn brief, after
Owner's Inbox answer: "You · via Inbox" and the answer, instead of the [Message from …] wrapper Owner's Inbox answer, before Owner's Inbox answer, after
Replied agent letter: the "Replied" badge and the letter Replied agent letter, before Replied agent letter, after
Interrupted exchange notice: one muted line on the left, instead of a "you" bubble Interrupted exchange notice, before Interrupted exchange notice, after
Automation letter and an unrecognized delivery: the Automation tag, and a labelled raw card on the left Automation letter and an unrecognized delivery, before Automation letter and an unrecognized delivery, after
Expanded automation letter: the letter without its envelope Expanded automation letter, before Expanded automation letter, after

Notes:

  • The silence line names the counterpart by participant id, because the server's notice does. Web shows the same text today; the notice redesign is A2A timeline: notices and platform prompts on web (design groups 4 and 5) #698.
  • The "Interrupted" markers in the seeded thread come from the seed, not from this change.
  • iOS isn't captured: the Captain deferred it to Checkpoint 1 because the Mac host was overloaded. No video was captured, since the change has no motion.

Live testing

The crew's tester ran Android 16 on an isolated test server with real Claude Haiku 5.5 and GPT Luna agents: pass for the flows exercised. The full run was at a9127e53ce. At the head, 15490da86e, the tester spot-checked the changed area (the identity line's split and the timeline-state module move), and the focused tests passed. Report: project artifact test-reports/j5code-mobile-wave1a-tester/15490da86e.md.

Exercised:

  • A real spawn brief, plain letter, ask and closed reply.
  • Open thread to the peer and to the spawner.
  • The owner's Inbox answer.
  • A real interruption notice, stopped from the native app.
  • The seeded automation letter and the unrecognized delivery.

Not exercised live:

  • The queued-delivery row in Up next: both authorized models (Haiku on Claude, Luna on Codex) take a delivery into the running turn, so none waited in Up next. Web's case-24 tests and the shared formatter cover it.
  • The clipboard's exact contents after Copy: Android 16's agent-device can't read the clipboard. The panel verified the copy guard in code.
  • Another person's Inbox answer, an outside agent, a Crew notice card, and a peer on a second server.
  • iOS: deferred to Checkpoint 1.

Upstream impact

  • apps/mobile/src/features/threads/ThreadFeed.tsx: case 97 (Timeline delegate).
  • apps/mobile/src/features/threads/ThreadQueueControl.tsx: case 97 (Queue-row formatter).
  • apps/mobile/src/lib/filePreview.test.ts: case 97 (it mocks j5/a2a/timelineState.ts beside upstream's state).

All three are listed in apps/mobile/src/j5/upstreamSeams.test.ts. Upstream's product is unchanged: these rows are J5's own messages, under register D38.

Checklist

  • One concern: the description has no "also"
  • Tests cover the changed behavior (timelinePresentation.test.ts, participantIdentity.test.ts, the seam rows)
  • UI changes: before/after screenshots above (Android; iOS deferred to Checkpoint 1, and the gaps are named above)
  • Live testing: the section above says what ran live and what did not
  • Upstream-owned files: each one is recorded in FORK.md (case text and file-table row) in this PR
  • Upstream product: no change to what upstream's product does
  • Surfaces: mobile is the client; web keeps its behaviour through the lifted helpers. Every provider gets the same messages. Peer threads open through the identity read's environment. No contract changes.
  • Docs: thread-a2a-rendering.md already says mobile takes the same treatments; nothing to rewrite

Claude Opus 5.5 in J5 Code (Claude Code harness).

🤖 Generated with Claude Code

@vercel

vercel Bot commented Nov 1, 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 1, 2026 1:18am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 16 billable files and costs up to $4.00.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 4 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available. Your 52 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between da0458f and 9bf629e.

Files selected for processing: 16
  • FORK.md
  • apps/mobile/src/features/threads/ThreadFeed.tsx
  • apps/mobile/src/features/threads/ThreadQueueControl.tsx
  • apps/mobile/src/j5/a2a/participantIdentities.ts
  • apps/mobile/src/j5/a2a/queuedDelivery.ts
  • apps/mobile/src/j5/a2a/timeline.tsx
  • apps/mobile/src/j5/a2a/timelinePresentation.test.ts
  • apps/mobile/src/j5/a2a/timelinePresentation.ts
  • apps/mobile/src/j5/a2a/timelineState.ts
  • apps/mobile/src/j5/upstreamSeams.test.ts
  • apps/mobile/src/lib/filePreview.test.ts
  • apps/web/src/j5/a2a/ParticipantIdentitiesClient.ts
  • apps/web/src/j5/a2a/ThreadA2ARenderer.tsx
  • packages/client-runtime/src/j5/archiveFlow.ts
  • packages/client-runtime/src/j5/participantIdentity.test.ts
  • packages/client-runtime/src/j5/participantIdentity.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XL 500-999 effective changed lines (test files excluded in mixed PRs). labels Nov 1, 2026

@Jacksondr5 Jacksondr5 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Combined review: reviewer-opus and reviewer-sol (Claude Opus 5.5 and GPT Sol 6.1), head 441833aef5

Both of us reviewed the PR independently and checked each finding against the source. One finding blocks merge; we found nothing else.

Blocking

  1. Copy drops the context payload for every ordinary sent message (ThreadFeed.tsx:1756, inline below). Details in the inline comment.

Checked and fine

  • The notice split matches web's renderThreadA2ADelivery. A silence is one line. A system delivery that no parser reads becomes a "Raw A2A delivery" card. A Crew notice stays a raw card, as the brief asks. Upstream's restart-continuation, pr-watch and platform notices go to upstream's row, as they do on web.
  • j5SenderThreadRef and j5MessageAuthorName were lifted from web verbatim. Web's ThreadA2ARenderer and SpawnBrief tests pass unchanged, and archiveFlowClient keeps its behaviour on an empty list and on a failure.
  • useParticipantIdentities keys its result on the environment and the sorted ids. It waits for connected and drops a stale answer. The React Compiler is on in mobile, so the new j5Timeline in extraData doesn't rebuild visible rows on every render.
  • The fold header with label: "" plus the author line above it is the same as upstream's label for an agent message J5 didn't unwrap: the sender thread's title, else "Agent".
  • The queue-row formatter covers the only place a queued run's text shows (ThreadQueueSheet).
  • FORK.md case 97, the seam-table update, the file-index rows and both upstreamSeams.test.ts rows are present.
  • Tests: the mobile timeline and seam tests (28), the shared participant-identity and user-message tests (42), and the matching web tests (17) all pass locally.

Not yet done (merge gates, not code findings)

  • Before and after captures (Android, and iOS since this changes what you see) and the tester's live run are still pending. The checklist correctly leaves both unticked.

@@ -1725,7 +1753,7 @@ function renderFeedEntry(
<UserMessageCopyButton
text={presentation.text}
onCopy={
message.context && presentation.attribution !== "guest"
message.context && presentation.attribution !== "guest" && !presentation.j5

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking: Copy drops the context payload for ordinary user messages. resolveJ5UserMessagePresentation returns a non-null j5 for every ordinary user message: presentJ5UserMessage ends with { group: "person", unwrapped: false } (userMessagePresentation.ts:538). So !presentation.j5 is false for every message the person sends. Copying a sent message that carries terminal, file or thread context then writes plain text instead of writeComposerContextClipboard, and pasting it into the composer loses the records. Sol reproduced this from client-runtime: for an ordinary user message, the old guard is true, the new guard is false, and the corrected guard is true.

Only a letter J5 took out of an envelope should skip the structured copy, since message.text is then the envelope:

message.context && presentation.attribution !== "guest" && !presentation.j5?.unwrapped

Web draws the same line with literalContext (j5?.unwrapped).

@Jacksondr5 Jacksondr5 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Combined review: reviewer-opus and reviewer-sol, head a9127e53ce

The blocking copy-guard finding is fixed. ThreadFeed.tsx:1756–1758 now tests !presentation.j5?.unwrapped, so an ordinary sent message copies its context records again, and a letter J5 took out of an envelope still copies as plain text. Nothing else changed since 441833aef5.

The panel has no open code findings. Still needed before merge: the before/after captures (Android and iOS), the tester's live run, and green J5 CI.

@Jacksondr5 Jacksondr5 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Combined review: reviewer-opus and reviewer-sol, head 15490da86e

We both checked the CI fix (15490da86e) against a9127e53ce and found nothing new.

  • useJ5Timeline moves unchanged into j5/a2a/timelineState.ts. That keeps connection/runtime, and so expo-crypto, out of timeline.tsx's imports. filePreview.test.ts mocks it beside upstream's state mocks.
  • That test file is upstream's, so this edit is recorded in case 97 and in a seam row, as it should be.
  • ParticipantAuthorLine mounts the sender-thread lookup only for a participant's row, so a person's rows add no hook and the hooks stay unconditional. The other-person branch passes senderThreadTitle: undefined, which matches the old behaviour: the lookup only ever answered for participants.

The panel has no open code findings. Before merge it still needs the before/after captures (Android and iOS), the tester's verdict and green J5 CI.

Jacksondr5 and others added 3 commits October 31, 2026 21:16
Mobile drew J5 deliveries in upstream's rows: raw envelopes and reply
footers, spawn briefs as XML, platform notices and Inbox replies as the
reader's own words, and every sender as "Agent". Mobile now calls the
shared classifier through FORK.md's reserved Timeline delegate and
Queue-row formatter (case 97): letters fold on the left under an
identity line named by the identity read, spawn briefs read
"<spawner> · brief", Open thread reaches spawners and peers, silence
notices are one muted line, unread notices and Crew notices keep a
labelled raw card, and queued deliveries read "From <sender>: <line>".
The identity helpers move from web into client-runtime so both clients
share them.

Refs #699

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Only a letter J5 took out of an envelope copies as plain text; the
classifier reads every ordinary message as the person's, so the guard
tests unwrapped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
filePreview.test.ts renders ThreadFeed with every state module mocked;
the new identity and access hook reached the connection runtime and
failed on the expo mock. The hook moves to timelineState.ts, which the
test mocks beside upstream's state, and the author line's thread lookup
mounts only for a participant's row.

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

@Jacksondr5 Jacksondr5 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Combined review: reviewer-opus and reviewer-sol, head 9bf629e (rebase onto da0458f)

We both checked the rebase onto trunk, which now has #845 and the shared client-runtime/j5/archiveFlow.ts. Neither of us found anything.

  • The shared identity read. Trunk's readParticipantIdentities now maps its response through the shared participantIdentitiesFromResponse, the same mapping as trunk's loop. A failure still gives empty maps.
  • Mobile. useParticipantIdentities now calls that shared read. The keying and the dropping of a stale answer are unchanged. A failed read now stores empty maps under the current key instead of leaving the old result, and both show no names.
  • Unchanged from 15490da86e. participantIdentity.ts and web's ThreadA2ARenderer.tsx are byte-identical to the reviewed head.

The panel has no open code findings. Before merge it still needs the before/after captures, the tester's verdict and green J5 CI.

@Jacksondr5
Jacksondr5 merged commit c0d994b into j5/main Nov 1, 2026
32 checks passed
@Jacksondr5
Jacksondr5 deleted the j5code/mobile-timeline-delegate branch November 1, 2026 01:34
Jacksondr5 added a commit that referenced this pull request Nov 1, 2026
Jacksondr5 added a commit that referenced this pull request Nov 1, 2026
* feat(mobile): read artifacts, and open artifacts/… links in chat

Mobile had no way to read the plans, specs and handoffs agents write, and an
`artifacts/…` link in chat opened as a workspace file that isn't there.

Two thread-scoped J5 screens land through the reserved Route registration
seam: the project's artifact list and a read-only viewer (Markdown, text,
images; HTML as source; no delete). The reserved Link resolver seam sends
`artifacts/…` links to the viewer. Web's artifact path, preview-kind and HTTP
read move to client-runtime so both clients share them.

Closes #833

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

* docs(j5): artifacts on mobile

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

* fix(mobile): artifact links open as artifacts everywhere, and a new artifact never shows the old body

A viewer reused for another artifact kept showing the previous body until the
new read landed; only a refresh of the same artifact keeps its body now, and
links push the viewer instead of reusing it. Long-pressing an artifact link
offers Open artifact and Copy path, not workspace-file actions that find
nothing, and links inside a Markdown artifact open as artifacts, as on web.

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

* chore(j5): artifacts are FORK case 98 after #843 took 97

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

This branch was successfully deployed

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

Labels

size:XL 500-999 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.

A2A timeline on mobile: the five groups through the shared classifier

1 participant