Skip to content

End last-human agent Huddles and preserve mobile transcript access - #9375

Merged
brow merged 5 commits into
mainfrom
terp/huddle-last-human-20261111
Nov 12, 2026
Merged

brow merged 5 commits into
mainfrom
terp/huddle-last-human-20261111

Conversation

@klopez4212

@klopez4212 klopez4212 commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

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 in 7a592f19d. Required push checks pass on the merged head.

  • Mobile formatting, analysis, and full suite passed (4,705 tests, 71 skipped; supplementary suites: 4 and 27).
  • DM hangup journey covers sole-human ending, preservation of another owner device, and preservation of membership when another human remains. Existing rejoin/lifecycle regressions remain in the full suite.
  • View journey reads the original transcript and opens a server-only reply-thread summary without joining audio.
  • Mutation checks: restoring the DM cleanup exemption fails the last-human journey; removing thread summaries fails View navigation. Restored production code passes.
  • Independent review completed; follow-up review of the three blocking fixes found no remaining blockers.
  • Follow-up regressions cover live-call Open after an ended event, reactive history membership revocation, stalled count/end requests during community transition, and background teardown of a later call while retired cleanup is unresolved.

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.

klopez4212 and others added 2 commits November 11, 2026 14:22
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]>
@klopez4212 klopez4212 changed the title Fix remote Huddle endings and add mobile transcript View Add View for ended mobile Huddle transcripts Nov 11, 2026
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]>
@klopez4212 klopez4212 changed the title Add View for ended mobile Huddle transcripts End last-human agent Huddles and preserve mobile transcript access Nov 11, 2026
@klopez4212
klopez4212 marked this pull request as ready for review November 11, 2026 23:44
@klopez4212
klopez4212 requested a review from a team as a code owner November 11, 2026 23:44
@klopez4212
klopez4212 deployed to codex-review November 11, 2026 23:45 — with GitHub Actions Active
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T18:14:20.147637Z 7a592f1 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +411 to +415
onPressed: viewHistory
? () => Navigator.of(context).push(
MaterialPageRoute<void>(
builder: (_) =>
_HuddleHistoryPage(channelId: ephemeralChannelId),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@github-actions github-actions Bot added the codex-security-review-current The posted Codex security review matches its recorded range. label Nov 11, 2026
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

🔐 Codex Security Review

Status: review required for the current range.

The current range is 193fda22f5f7350427e564f40d28881c2997f364...7a592f19dcd23c5138809f02401d731031b21efd.
A new review must complete for this exact range. When manual authorization
is required, a user with write access must comment exactly
@buzz-security-review 7a592f19dcd23c5138809f02401d731031b21efd to authorize a new review.
Any previous review applies only to its recorded range.

@kazemek21 kazemek21 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[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 brow left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 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.

  1. 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.
  2. 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".
  3. 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

klopez4212 added a commit to block/buzz-app that referenced this pull request Nov 12, 2026
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>
klopez4212 and others added 2 commits November 12, 2026 10:03
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
Signed-off-by: kenny lopez <[email protected]>
@github-actions github-actions Bot removed the codex-security-review-current The posted Codex security review matches its recorded range. label Nov 12, 2026
@brow
brow merged commit 5f81803 into main Nov 12, 2026
51 of 52 checks passed
@brow
brow deleted the terp/huddle-last-human-20261111 branch November 12, 2026 18:45
ravarora2 added a commit that referenced this pull request Nov 12, 2026
…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]>

This branch was successfully deployed

No deployments
codex-review — 7a592f19 Deployed Nov 12, 2026 by klopez4212 via Run Codex Security Review #14626
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants