Repository navigation
End last-human agent Huddles and preserve mobile transcript access - #9375
Conversation
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz> Signed-off-by: kenny lopez <[email protected]>
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz> Signed-off-by: kenny lopez <[email protected]>
Retain direct-message membership while other humans remain so transcript history stays readable. Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz> Signed-off-by: kenny lopez <[email protected]>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0b7bddfbab
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| onPressed: viewHistory | ||
| ? () => Navigator.of(context).push( | ||
| MaterialPageRoute<void>( | ||
| builder: (_) => | ||
| _HuddleHistoryPage(channelId: ephemeralChannelId), |
There was a problem hiding this comment.
Preserve transcript access for channel Huddle participants
When someone leaves a channel Huddle while another human remains, _finishLeaveLifecycle still calls leaveChannel(backingChannelId) because preserveMembership is only enabled for two-person DMs. Every backing channel is private (channel_huddle_actions.dart), and the relay rejects reads without backing-channel membership (handlers/req.rs:305–317). Consequently, once that Huddle ends, the newly enabled View button opens a transcript the former participant cannot load, even though they still belong to the parent channel. Preserve the required read access for these participants as well, or provide an authorized history-read path before offering View.
Useful? React with 👍 / 👎.
🔐 Codex Security Review
|
kazemek21
left a comment
There was a problem hiding this comment.
Kyle reviewed this PR and the Nexus review-tracker notes and approved with these two non-blocking comments.
Posted by Codex (gpt-6.1-sol) on behalf of kylez
| isMember && !isArchived && !ended && !stale && !blockedByOtherHuddle; | ||
|
|
||
| final label = unavailable | ||
| final viewHistory = ended || (stale && !isThisSession); |
There was a problem hiding this comment.
[P2] Preserve Open until the local session has ended
ended makes viewHistory true even while isThisSession remains true. An end event arriving before local audio teardown therefore replaces Open with View and sends the user to history instead of the active call. Could both ended and stale history paths require !isThisSession?
Posted by Codex (gpt-6.1-sol) on behalf of kylez
| events, | ||
| currentPubkey: currentPubkey, | ||
| ).where((message) => !message.isSystem).toList(); | ||
| if (timeline.isEmpty) { |
There was a problem hiding this comment.
[P2] Distinguish unavailable history from a confirmed empty result
When disconnected with no cached messages, channelMessagesProvider returns AsyncData([]). Opening View then reports “No messages in this Huddle” even though the saved transcript has not been fetched. Could this show an offline/loading state until a successful history query establishes that it is empty?
Posted by Codex (gpt-6.1-sol) on behalf of kylez
brow
left a comment
There was a problem hiding this comment.
🤖 Requesting changes. This fixes the stuck Join card in agent DMs, but three things that worked before get worse on 0b7bddf. Mechanisms and suggested fixes are inline.
- Open turns into View during a live call. Rejoin a Huddle while it is being ended and its card says "Huddle ended / View" and opens the transcript while you are still connected. One-line fix.
- View is offered to people who can't read the Huddle. Only members of the private backing channel can load it. Everyone else gets "Couldn't load this Huddle conversation" with a Retry that can never work, where they used to see a disabled "Ended".
- Switching or removing a community now waits on the old relay for every DM Huddle. Up to 8 seconds per relay call when that relay is slow, which VISION_MOBILE rules out.
A question that bears on 3, and on the second-device race the description lists as a non-goal: could the relay end a Huddle once only agents remain? Then the phone would not need to count humans, publish the end and archive on hangup.
Full review: buzz://message?channel=e71f9a2a-ac46-473d-a24e-5e16fd8cb7b1&id=41a614cd50b44754b952df3937b548601b15f678e041809c1296f9d169be62e5
When the creator leaves a Huddle with only agents connected to audio, desktop now publishes the ended state and archives the room. This replaces the leave path's unconditional reliance on relay teardown, which could leave the card offering Join. The existing View action and transcript membership are preserved. The service counts attendance from raw audio admissions, using fresh relay-signed membership to classify bot roles. Departed humans keep transcript membership without counting as present. Connected legacy agents with a member role are recognized from verified kind-30177 records signed by the viewer or room owners, matching the old desktop trust policy. Known additional devices, other connected humans, unknown peers, failed classification reads, failed joins, connection errors, and retired sessions cannot trigger ending. Native signing now validates and permits the existing 48103 event. Concurrent relay archival is confirmed as successful cleanup. This is the desktop client counterpart to [mobile #9375](block/buzz#9375); [relay #9376](block/buzz#9376) remains independent. Only the creator or relay may announce an ending. Membership and audio snapshots cannot atomically exclude a device joining during hangup; non-creators and ambiguous rosters retain relay cleanup. Validation: typecheck and all 63 Huddle service tests pass. Restoring the old ending helper makes the new positive regressions fail. The full Vitest run at this follow-up completed with 21,049 passes and 10 failures across six files outside Huddles; all six files pass isolated reruns with BUZZ_TEST_WORKERS=2 (229 tests). All required pre-push checks pass at 6d201b6 with BUZZ_TEST_WORKERS=4: TypeScript/related tests, design guards, and workspace Clippy. Independent review found no blockers. The native event-shape regression passed during the initial implementation; native code is unchanged in this follow-up. The broader native package run remains limited by terminal fixtures encountering this machine's interactive shell security prompt and a window-state mock SIGSEGV, including serial execution. No browser cases added or removed: service tests exercise join → connected → hangup using the real outbox, including departed humans, legacy agent trust, additional devices, membership, connection and archive-failure boundaries. Existing Huddle card/View tests pass. Packaged desktop tryout remains pending: agent DM hangup, another device staying connected, transcript View, and mobile/desktop interoperability. No deployment or live-device validation claimed. --------- Signed-off-by: klopez4212 <[email protected]> Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz> Signed-off-by: kenny lopez <[email protected]>
…n-20261111 Signed-off-by: kenny lopez <[email protected]>
…small * origin/main: feat(workflow): add owner-only agent mentions for workflow messages (#9227) Adapt iPhone Duo layouts, rail navigation, and native sheets (#8568) End last-human agent Huddles and preserve mobile transcript access (#9375) Signed-off-by: Ravneet Arora <[email protected]>
Summary
Leaving an agent DM Huddle previously skipped client lifecycle cleanup, allowing Join to remain visible while the relay waited for the agent. Apply the existing last-human rule to DMs: release audio first, then publish the ending and archive when the human count is at most one. Preserve the existing additional-device and same-Huddle rejoin guards. Retain DM membership when other humans remain so hanging up does not revoke transcript access.
Offer View only when cached backing-room membership confirms transcript access, opening the original Huddle transcript and reply threads without joining audio. Non-members retain disabled Ended. Preserve Open for an active local session even when an ended event arrives.
For admitted or just-left Huddles, switching/removing a community retires pending remote finalization and waits for local audio teardown. Generation guards prevent retired count/end results from launching follow-up writes or interfering with a later call. Existing in-flight Huddle-start rollback behavior is unchanged.
Client only; remote relay finalization is separate in #9376. Human counts use backing-channel membership; known duplicate owner admissions prevent client cleanup. Concurrent device arrivals are not made atomic by this client-only change, and human-to-human DMs with retained memberships still rely on relay finalization.
Related issue
Split from the combined Huddle repair at the author's request. Searched open Huddle issues/PRs; no exact duplicate found for this mobile behavior.
Testing
Follow-up fixes are in
7f28dc486; merged current main in7a592f19d. Required push checks pass on the merged head.Phone/human validation remains pending. Start an agent DM Huddle and leave from the last human device: its card should stop offering Join. Tap View to read the transcript and replies. Repeat with another device still in the Huddle and verify it stays open. Not deployed.