Skip to content

fix(j5): a shared conversation's lines stay off search, forks, recall and titles - #731

Merged
Jacksondr5 merged 4 commits into
j5/mainfrom
fix/shared-lines-off-upstream-surfaces
Oct 27, 2026
Merged

Jacksondr5 merged 4 commits into
j5/mainfrom
fix/shared-lines-off-upstream-surfaces

Conversation

@Jacksondr5

@Jacksondr5 Jacksondr5 commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

Problem

In a shared conversation, J5 stores each person's message with the platform's text in front: the author line ([Message from Priya (collaborator)]) and, on some messages, the <j5_shared_conversation> note. The agent needs them. J5's own timeline takes them off, but upstream's screens that read the stored text showed them: search snippets (and a word only in the note found the thread), forks, up-arrow recall, and the generated title (a first message of "hi" produced "Shared Conversation Greeting"). Closes #612.

What changed

The lines stay stored and reach the agent exactly as before (Jackson's 2026-10-26 decision on #612). Each surface takes off exactly the prefix J5 recorded for that message (j5_a2a_message_author.stored_prefix); a message with no record, or whose text doesn't begin with it, is shown as stored. One strip, typedText, now lives in packages/contracts/src/j5/sharedConversation.ts for the server and web.

Surface Change
Sidebar and palette message search After upstream's own match, one condition checks the person's words against the query, reading J5's author record only for rows that already matched, and the ≤50 returned snippets are stripped; a word only in the note no longer finds the thread. On a server with no shared conversations a once-per-query check skips the per-row work (j5/sharing/typedMessageText.ts)
Fork from this response A fork reads its source's messages; J5's thread authors now cover the messages a fork shows, through forks of forks, so the existing timeline strip handles them: inherited messages show under their real author, with the note as a notice. A source message's author is passed on only when the stored text the fork shows begins with its line, so a fork never tells a reader more than the text already does; a reader who may not know the writer gets only what strips the lines (shown as "Someone without a name"), and a slash command shows as a plain message. Copy message and rewind in the fork get the typed words. No upstream edit
Up-arrow recall Recall uses the timeline's own decision for each message, so it offers the typed words, and leaves out a message whose author hasn't loaded yet rather than its raw text (sharedPromptHistoryMessages)
Generated title The title generator alone is given a J5 layer that reads the thread's messages without the platform's text, for the first title and Regenerate (j5/sharing/titleSource.ts)

Search cost (synthetic SQLite, 100k messages, median of 41 runs): with no shared conversations, a broad query ("the") is 271 ms upstream and 280 ms here (+3%); with 10% of threads shared it is 272 ms vs 327 ms (+20%), from reading the author record for each matching row. Selective queries are unchanged.

Left as they are:

UI changes

Before is j5/main 882256d091, after is 5423f1d47c, on the same data, 1280×800, light theme. People: the Owner; Priya, a Collaborator on the thread; Dana, a Collaborator on the project; Vera and Wren, Viewers of a fork only.

Before After
Owner, sidebar search: Priya's message (the one carrying the note)
Owner, sidebar search: Dana's message
Owner, sidebar search for "conflict", a word only in the note
Owner, palette search: Priya's message
Owner, a fork of the shared thread
Owner, a fork of that fork
Owner, Copy message in the fork, pasted into the composer
Vera, Viewer of the fork only: Priya, whom she can't know, shows as "Someone without a name"
Owner, up-arrow in the shared thread
Priya, up-arrow recalls the Owner's message
Title of a thread whose first message is Dana's "hi"
The same thread after Regenerate title

After only: Wren, Viewer of a fork only, sees a source Collaborator's slash command as a plain message with no name.

Live testing

Pass, by a Sonnet 5.5 tester, on two live-test servers built from j5/main and 5423f1d47c with the same scenario. Agent turns on Claude Haiku 5.5.

  • Search, fork, recall and title: each fixed as the images show. Searching the author-line text ("collaborator)]") also finds nothing.
  • The agent is unchanged: the stored text still begins with the note and [Message from Dana (collaborator)], and the agent's replies name who wrote.
  • Threads with no author record search, fork and recall exactly as on j5/main.

Not exercised:

  • Up-arrow pressed before a thread's authors have loaded, or while a sent message is still pending. Both were tried, but the tester couldn't catch the window. The logic is covered by tests in sharedTimeline.logic.test.ts.
  • Regenerate title on a non-shared thread. Every new thread on the test home was shared.
  • The two server-only commits after the live test (154b504709, 0885aab49f). Together they narrow what a fork tells its reader about a source message: an author record is passed on only when the stored text the fork shows begins with that record's line. A source slash command in a fork therefore shows as a plain message with no name, for every signed-in reader, as Wren's capture shows. A refused edit no longer names its would-be editor. Regression tests in SharedConversation.test.ts cover both.
  • Codex turns, and mobile. Mobile is out of scope (Share links: sharing on mobile #609).

Review: GPT-6-Astra, three rounds.

  • Round 1 found three problems, all fixed: a fork naming the hidden author of a slash command; up-arrow recalling the lines before the authors load; and broad search ~35% slower on a server with no shared conversations.
  • Round 2 found that a fork could name a hidden editor, fixed in 154b504709. It measured search independently, at +3% and +19%, and accepted that cost.
  • Round 3 found that an edit upstream refuses still left a record naming the editor, which a fork passed on. Fixed in 0885aab49f by the stored-text rule. The underlying ordering predates this PR and is filed as A refused edit to a queued message in a shared conversation still records "edited by" #738.
  • Round 4: nothing blocking.

Upstream impact

FORK.md case 86: apps/server/src/orchestration-v2/ThreadSearch.ts (the join and the typed-text match), apps/server/src/orchestration-v2/runtimeLayer.ts (the title generator's message source), apps/web/src/components/chat/ChatComposer.tsx (recall). What upstream's product does is unchanged except that these screens show what the person typed.

Checklist

  • One concern: the description has no "also"
  • Tests cover the changed behavior (typedMessageText.test.ts, titleSource.test.ts, a fork case in SharedConversation.test.ts)
  • UI changes: before/after screenshots above (no motion or interaction sequence to record)
  • 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 beyond showing the typed text
  • Surfaces: search (sidebar and palette), fork, recall, title; web and desktop; mobile out of scope (Share links: sharing on mobile #609); the agent's input unchanged
  • Docs: no definition changes; the shared conversations definition already says the lines are the platform's and the person's words follow

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

🤖 Generated with Claude Code

… and titles

In a shared conversation the server stores each person's message with the
platform's note and author line in front, for the agent. Upstream surfaces that
read the stored text showed them: the search snippet (and a word only in the
note matched), a fork's inherited messages, up-arrow recall, and the text the
title model was given (#612).

Each surface now takes off exactly the message's recorded stored_prefix, as
J5's timeline already does. The agent still receives the stored text.

- Search: ThreadSearch's query left-joins j5_a2a_message_author and matches and
  snippets the typed text (J5-owned SQL fragments).
- Title: a J5 decorator of ThreadManagementService.getThreadRecords, provided to
  the title generator alone.
- Fork: listThreadAuthors also returns the author records of the messages a
  fork inherits, so the existing client strip covers the fork. No upstream edit.
- Recall: ChatComposer passes the thread's messages through a J5 helper on the
  key press.

typedText moves to contracts so server and web share it. FORK.md case 86.

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

vercel Bot commented Oct 27, 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 Oct 27, 2026 1:20am UTC

Request Review

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:L 100-499 effective changed lines (test files excluded in mixed PRs). labels Oct 27, 2026
… costs nothing unshared

Round 2 on #731 (review findings):

- A fork's inherited author records are told only as far as its reader
  could know them: in full when participantVisible lets them know the
  writer, otherwise only the prefix to strip, and not at all for a
  record with no prefix (a slash command).
- Up-arrow recall offers each person's message as the timeline last
  showed it, and nothing while the timeline still holds it back for its
  author, so no platform line reaches a draft.
- Search asks once per query whether any message carries a prefix; a
  server with none does no per-message work, and the snippet is
  stripped only on the rows returned.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…it shows begins with its lines

An edit's author record is written before upstream takes the edit, so a
refused edit left a record naming an editor the stored text does not.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Jacksondr5
Jacksondr5 marked this pull request as ready for review October 27, 2026 01:46
@Jacksondr5
Jacksondr5 merged commit 3d4e82a into j5/main Oct 27, 2026
37 of 39 checks passed
@Jacksondr5
Jacksondr5 deleted the fix/shared-lines-off-upstream-surfaces branch October 27, 2026 01:46
Jacksondr5 added a commit that referenced this pull request Nov 23, 2026

This branch was successfully deployed

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

Labels

size:L 100-499 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.

Shared conversations: upstream surfaces that show a stored message's text show the platform's lines

1 participant