Skip to content

fix(j5): agent message senders keep their names after a reload - #656

Merged
Jacksondr5 merged 1 commit into
j5/mainfrom
j5/fix-unnamed-participant
Oct 19, 2026
Merged

Jacksondr5 merged 1 commit into
j5/mainfrom
j5/fix-unnamed-participant

Conversation

@Jacksondr5

@Jacksondr5 Jacksondr5 commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Problem

Agent-to-agent message cards showed the sender as "Unnamed participant" after a page load (#635), in threads on a secondary environment (#419), and in the threads #652 found. In every case the names came back only when the participant set changed, for example by switching threads.

Closes #635
Closes #419
Closes #652

What changed

  • Web. useParticipantIdentities ran its one identity read once per set of ids. On a page load, or for a secondary environment, that read went out before the environment had connected. It failed, the client turned the failure into an empty map, and nothing ran it again. The hook now waits until the environment is connected and runs the read again on each reconnect. That also covers a server restart. It uses the connection state the sidebar already reads, so there's no timer.
  • Server. readParticipantIdentities decoded the whole id list, so one id that wasn't a participant id failed the read for every id in it. It now drops such an id, which then reads as unknown, and resolves the rest.

#652's cause. #652 suspected a bad id. I checked the retained test home from the #466 run. Every sender id in thread 9ee45107… decodes, and the server's identity query names all four senders. On a copy of that database the thread showed "Unnamed participant" after a reload and the right names after an in-app thread switch. With this fix it shows the right names after every reload. So #652 is the reload race from #635. The server change still covers #652's "one unresolvable id" criterion.

useScopedParticipantLabels (the Inbox) doesn't have this gap. It reads only the environments marked connected, and that list is part of its key, so a reconnect runs the read again.

UI changes

Each pair shows the same card after a page reload, before and after this change.

Before After
Incoming message after a page reload Incoming message after a page reload, before Incoming message after a page reload, after
Incoming Exchange after a page reload Incoming Exchange after a page reload, before Incoming Exchange after a page reload, after
Incoming message on Remote, viewed from Local's origin, after a page reload Incoming message on Remote after a page reload, before Incoming message on Remote after a page reload, after

Reloading the receiving thread, before:

base-reload.mp4

After:

head-reload.mp4

Live testing

PASS at 9aaeda8f1e against base 3a55dfe5b1. Report: test-reports/j5-fix-unnamed-participant.md. All live turns used Claude Haiku 5.5, and the messages went through j5_send_message.

Not exercised live: the server's handling of an invalid id (a unit test covers it); desktop, mobile, relay, tunnel and second-machine connections; a Codex turn, since nothing here touches the turn path, adapters or the messaging tools. Nothing needs testing by hand.

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
  • 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. 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. Not applicable.
  • Surfaces: every timeline card, the queued-message row and the Crew proposal card read through this hook. Web only: mobile doesn't use this read. The Inbox is unchanged (see above). Connection modes: local and secondary environments.
  • Docs: definitions under docs/j5/product/ and user docs rewritten where this changes them. No change needed.

Claude Opus 5.5 in Claude Code, run from J5 Code.

🤖 Generated with Claude Code

The participant identity read ran once per set of ids. On a page load, or for
a thread on a secondary environment, it ran before the environment connected,
failed, and never ran again, so every card read "Unnamed participant". It now
waits for the environment to connect and runs again on each reconnect.

The server also drops an id that is not a participant id instead of failing
the whole read, so one bad id can't blank the names beside it.

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

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

Request Review

@Jacksondr5
Jacksondr5 marked this pull request as ready for review October 19, 2026 01:17
@github-actions github-actions Bot added size:S 10-29 effective changed lines (test files excluded in mixed PRs). vouch:trusted Author is trusted by repo permissions or the VOUCHED list. labels Oct 19, 2026
Jacksondr5 added a commit that referenced this pull request Oct 19, 2026
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 48d52af5-5006-42df-af82-77223abc8935
📥 Commits

Reviewing files that changed from the base of the PR and between 3a55dfe and 9aaeda8.

📒 Files selected for processing: 3
  • apps/server/src/j5/a2a/clientReadRpc.test.ts
  • apps/server/src/j5/a2a/clientReadRpc.ts
  • apps/web/src/j5/a2a/ParticipantIdentitiesClient.ts

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

📝 Walkthrough

The server now filters invalid participant IDs from identity requests instead of rejecting the request. The web client waits for an environment connection before reading identities and reruns the read when connection state changes.

Changes: Participant identity reads

Layer / File(s) Summary
Filter invalid IDs in identity requests
apps/server/src/j5/a2a/clientReadRpc.ts, apps/server/src/j5/a2a/clientReadRpc.test.ts
The server filters invalid IDs before calling the identity service. The test checks that a request with an invalid ID succeeds and sends only the valid ID to the service.
Run identity reads when connected
apps/web/src/j5/a2a/ParticipantIdentitiesClient.ts
The hook skips reads while the environment is disconnected and reruns them when connection state changes. The hook documentation describes this behavior.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 9aaed

Malformed IDs no longer prevent valid identity results, and reads wait for the requested environment to connect. No material merge-blocking issue is established; the PR appears mergeable with normal checks.

Pre-merge checks: Passed 4
Check name Status Explanation
Linked Issues check Passed The PR satisfies the coding objectives for [#635] and [#419]. useParticipantIdentities now waits for useConnectedEnvironmentIds and reruns when connection state changes, including reconnects. This…
Out of Scope Changes check Passed The changes stay within the linked issue scope. The server change and its focused test implement [#652]. The web hook change implements the connection-read behavior required by [#635] and [#419]. No u…
Title check Passed The title clearly identifies the primary user-facing fix: agent message sender names persist after a reload.
Description check Passed The description covers the problem, implementation, UI evidence, live testing, scope, linked issues, and checklist. The omitted Upstream impact section is valid because the changes are limited to J5-o…
Full details: Linked Issues check

Explanation

The PR satisfies the coding objectives for [#635] and [#419]. useParticipantIdentities now waits for useConnectedEnvironmentIds and reruns when connection state changes, including reconnects. This supports page loads, direct thread navigation, secondary environments, and server restarts without a timer. The existing hook serves the timeline and queued-message surfaces. The PR also satisfies [#652]. readParticipantIdentities filters invalid participant IDs and resolves the remaining IDs. clientReadRpc.test.ts verifies that an invalid empty ID is dropped and that the valid ID reaches the service and returns its entry.

Full details: Out of Scope Changes check

Explanation

The changes stay within the linked issue scope. The server change and its focused test implement [#652]. The web hook change implements the connection-read behavior required by [#635] and [#419]. No unrelated product behavior, files, or administrative changes appear in the reviewed diff.

Full details: Description check

Explanation

The description covers the problem, implementation, UI evidence, live testing, scope, linked issues, and checklist. The omitted Upstream impact section is valid because the changes are limited to J5-owned paths.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

Jacksondr5 added a commit that referenced this pull request Oct 19, 2026
@Jacksondr5
Jacksondr5 merged commit 3b2bde9 into j5/main Oct 19, 2026
41 checks passed
@Jacksondr5
Jacksondr5 deleted the j5/fix-unnamed-participant branch October 19, 2026 01:42
Jacksondr5 added a commit that referenced this pull request Nov 23, 2026
Jacksondr5 added a commit that referenced this pull request Nov 23, 2026

This branch was successfully deployed

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

Labels

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

Projects

None yet

1 participant