Repository navigation
Show a paired Mac's Bot's last message, photo and unread dot - #907
sambitcreate wants to merge 1 commit into
Conversation
Host feed Bot rows (Remote revision 66, provisional) carry a one-line preview and always come from the Bot list's cached summary, so every row has its last reply time. A new peer binary operation reads a Bot's photo avatar. The Bots sidebar shows the preview under the name, the photo, and a dot for a reply this Mac hasn't shown yet; the remote chat title shows the photo too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018VA6REg8PpdXdPfTkkCKZJ
There was a problem hiding this comment.
Important
The unread watermark can be wrong under ordinary clock skew and can advance before a reply is displayed; both should be fixed before merge.
Reviewed changes I reviewed the complete initial diff for the remote Bot row preview, photo, and unread-state feature.
- Host projection and revision 66 — Host-feed Bot rows now carry cached summary previews and reply times under a strict
HostFeedBotcontract. - Remote avatar transport — A bounded binary peer operation reads the listed PNG avatar revision for sidebar rows and chat titles.
- Desktop row presentation — Remote rows follow local priority ordering for Needs you, running, stopped, and preview states with matching accessibility copy.
- Unread persistence — A new renderer-local record tracks per-host Bot reply watermarks and drives the shared unread dot.
- Cross-client contracts and documentation — Shared fixtures, native revision checks, API guidance, plans, memory, and focused behavioral tests were updated.
@v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏
|
|
||
| /** A reply newer than the newest one its chat showed here, or than the record's start when it never showed one. */ | ||
| export function isRemoteBotUnread(seen: RemoteBotSeen, key: string, lastReplyAt: number | undefined): boolean { | ||
| return lastReplyAt !== undefined && lastReplyAt > (seen.seenReplyAt[key] ?? seen.since); |
There was a problem hiding this comment.
The fallback compares a timestamp from the paired host with since, which is initialized from this Mac's Date.now(). With ordinary clock skew, an ahead host marks every existing reply unread on first use, while a behind host can suppress all new dots until its clock catches up; establish the first-seen baseline in that host's clock domain instead.
Technical details
# Keep unread baselines in the host clock domain
## Affected sites
- `renderer/lib/remote-bot-seen.ts:28-29` — a fresh record seeds `since` from this Mac's clock.
- `renderer/lib/remote-bot-seen.ts:60-61` — a paired host's reply timestamp is compared against that local value.
## Required outcome
- Never compare a paired host's `lastReplyAt` with this Mac's wall clock.
- Existing replies must start read, while later reply timestamps from that same host can become unread.
- Cover both an ahead host and a behind host with independent behavioral assertions.
## Suggested approach
- Establish an initial per-host or per-Bot watermark from an observed host timestamp, or carry an authoritative host-clock baseline through the feed.| // The open Bot's newest reply is on screen, so it is not unread when the person leaves. | ||
| const open = selected ? groups.flatMap(({ host, bots }) => bots.filter((bot) => `${host.id}/${bot.id}` === selected))[0] : undefined; | ||
| React.useEffect(() => { | ||
| if (selected && open?.lastReplyAt !== undefined) markRemoteBotSeen(selected, open.lastReplyAt); |
There was a problem hiding this comment.
This records the feed's newest reply as seen as soon as route selection changes, but useRemoteBotSession starts an independent async read and may still have view === null, an older snapshot, or a failed read. The dot can therefore disappear for a reply the chat never rendered; advance seen state from the newest reply actually present in admitted session entries, and remove the equivalent feed-only write in RemoteBotChatView.
Technical details
# Do not mark a feed reply seen before the session displays it
## Affected sites
- `renderer/components/remote-bots-section.tsx:70-75` — selecting a route advances seen state directly from the host-feed row.
- `renderer/main/remote-bot-chat-view.tsx:142-148` — mounting the chat independently advances the same watermark before `useRemoteBotSession` has loaded.
- `renderer/lib/hosts/use-remote-bot-session.ts:20-35` — the follower is created in an effect and asynchronously reads/subscribes, so its displayed view is not synchronized with the feed effect.
## Required outcome
- Advance the watermark only to the newest finished reply actually admitted to the rendered remote session snapshot.
- A failed/slow read, an older session snapshot, or leaving while a reply is still streaming must not claim that reply as seen.
## Suggested approach
- Derive the shown reply time from `live.view?.snapshot.entries` after the session view exists, mirroring the local Bot chat's `botLastReplyAt(snapshot.entries)` invariant.
Requested by sbt · project thread
Stacked on #895. Merge #895 first; GitHub then retargets this PR to
main.Problem
After #895, a paired Mac's Bot rows still differ from this Mac's own Bot rows:
Change
PR 2 of the fix plan.
Remote protocol, revision 66 (provisional; re-claim the next free number at merge).
HostFeedBotschema forsnapshot.botsandbot.upsert: the Bot summary withoutissueCount, plus the revision-52needsYou,failedandlastReplyAt, plus an optionalpreview(one line, at most 140 characters, no control or format characters).parseAidenRemoteHostFeedBotchecks these rows in the fixture parser. The fixture gains abot.upsertwith a preview.Host.
BotLiveProjection.summary, the cached summary the Bot list already uses.inboxSignalsis removed.lastReplyAtand a preview, not just Bots with an open feed. The plan,.memory/inbox-sidebar.mdand the API doc record the change.Desktop client.
botAvatar→GET /bots/{botId}/avatar/{assetRevision}.useRemoteBotPhotoreads a listed PNG photo once per revision, checks its type and size against the row, and shows it in the row and the remote chat title.BotAvatartakes aphotoUrl.renderer/lib/remote-bot-seen.ts) of the newest reply each remote Bot's chat showed here. It compares only host times with each other. Replies from before the record began are not unread. Opening the chat clears the dot. The dot component is shared with local rows (BotUnreadDot).Docs:
docs/aiden-remote-api-v1.md(new "Bot row previews, revision 66" section),docs/aiden-on-the-go-remote-access.md(paired-computer Bots),docs/plans/inbox-sidebar-plan.md,.memory/bot-chat-activity.mdand.memory/inbox-sidebar.md.Screenshots
Bots sidebar with the Studio paired. Scout has a photo and is running. Jester has a reply this Mac hasn't shown. Ledger's reply was already seen. Chief of Staff waits on an approval, so Needs you shows instead of its preview.
Scope
A feature (PR 2 of 5). Still to come: plan, access-request and memory cards in remote Bot chats plus load older (PR 3), Needs you on phones (PR 4), and the same Bot signals from the headless server (PR 5). The headless server's host feed doesn't send previews yet; the desktop shows those rows as before.
Verification
npm run type-check: clean. eslint on the touched files: clean.test:bots,test:peer-hosts(184),test:remote-chat,test:bot-runtime(624): all pass.test:aiden-remoteminusaiden-remote-service.test.ts(which needs IPv6, missing in the cloud container): 1217 pass, 0 fail.issueCount, false flags) and the AjvHostFeedBotschema.ChatSidebarshows a paired Mac's Bot's last message and photo, and a new reply shows a dot until its chat opens.botAvatarroute and binary result.AI disclosure
Written with Claude Code.
Checklist
Generated by Claude Code