Skip to content

feat(agents): add community-scoped sessions - #3567

Draft
johnmatthewtennant wants to merge 62 commits into
mainfrom
jtennant/zack/community-agent-scope
Draft

johnmatthewtennant wants to merge 62 commits into
mainfrom
jtennant/zack/community-agent-scope

Conversation

@johnmatthewtennant

@johnmatthewtennant johnmatthewtennant commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Why

Thread and channel sessions cannot carry an agent's context across conversations in the same community.

What

Adds One session per community for Claude Code, Codex, Goose and Pi. Channels, threads, DMs, Solo chats, huddles and unaddressed wakes share one queued lifetime per agent membership. Each request retains its own reply destination and access checks. Other communities and existing thread/channel sessions keep separate identities.

Session controls act on the shared lifetime from any conversation. A spoken request overlapping restoration of the room’s instructions is interrupted; the voice seat closes with rejoin and retry guidance. Restoration follows each harness's existing capabilities; Goose does not gain process-restart resume.

Validation

Settings save/reload journeys pass in Chromium and WebKit, including narrow layout and enlarged text. Real Codex with a simulated relay verifies cross-channel recall, reply routing, restart, Solo recall, community isolation and wake-first Usage attribution. Native voice-seat checks verify policy replacement before speech and after intervening typed work, and rejection of speech during policy restoration, with media stubbed. Native Pi verifies durable shared context with a fixture model. Real Claude background work verifies that its originating source retains ownership until the assistant's continuation finishes.

Remaining work

Fresh correctness review and CI are pending on the updated head. The full review workflow is blocked by unavailable GitHub authorization on its workstation (HTTP 511). Live huddle audio, the complete app-to-relay journey and human testing remain unverified; this PR stays draft.

Screenshots

Codex agent settings with community scope selected (synthetic agents).

Community session setting

johnmatthewtennant and others added 30 commits November 14, 2026 23:37
Share one queued native session across an agent membership while retaining each request destination and existing thread/channel keys.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Check the initial stored reply and retain the failing recall response in assertions.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
The native model correctly declined to repeat a token described as private across channels. Use a synthetic marker intended for community-wide recall.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Discover shared transcripts independently of their original source channel and read both full and incremental history from the shared workspace.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Release expired wake callers without dropping ordering barriers, cancel queued work on Interrupt, stop expired Goose execution and reserve Codex queue positions before startup completes. Keep Solo policy lookups channel-level and explicitly replace source-specific owner instructions across shared turns.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Keep navigation persistence failures from preventing native delivery. Reuse the existing cancellation wrapper so queued wake callers can settle without releasing their ordering barrier.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Withdraw prior-source Canvas instructions and folders, reset Codex owner policy, settle cancelled Codex wake callers, index wake-first Claude sessions and publish Pi wake activity to mounted observers. Retain unread Canvas only within the same source.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Keep the mounted session observer regression on the successful empty-list path rather than triggering session discovery error recovery.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Recognize community usage without a first-prompt channel and derive Pi community origins from the first prompt instead of mutable navigation metadata.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Withdraw the previous Solo Canvas when plugin harness sessions change sources and require an explicit channel for top-level posts with thread-bound tools.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Leave preceding community work running when a waiting request is stopped. Keep session-wide cancellation unchanged, and identify Goose community wakes in their first prompt.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Keep a newer shared transcript from replacing the separate channel or thread session when community scope is disabled.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Withdraw prior Canvas and owner policy before opening voice and restore the room policy after typed work. Preserve successful spoken completion through seat closure without treating the absence of send as a failure.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Keep speculative preparation side-effect-free so cancelling a queued source cannot discard the active Solo chat Canvas.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Frame unaddressed community turns with membership identity without inventing a posting channel. Ignore retained conversation folders when remote admission uses community scope.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Hold source ownership across task-completion notifications until their native continuation drains. Release idle waiters on exit, and do not offer a shared native title as a later Solo chat name.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Keep background notifications attached to a running turn so its idle transition releases shared ownership.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Keep shared wake ownership and its abort handler after final publication until ACP finishes its native work.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Finish asynchronous prompt reads before checking whether to update retained Canvas state. Keep cancelled source changes from replacing the active project and folders.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Interrupt an overlapping native spoken turn and close its seat with retry guidance until completed typed work releases the shared source policy. Preserve consecutive spoken handoffs.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Replace the forbidden non-null assertion reported by CI with a fixture setup check.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Leave the retained source untouched when a wake expires during asynchronous preparation. Await the isolation fixture completions before teardown.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Invalidate pending community requests without changing request-scoped Stop semantics.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Retain source ownership through process exit when a refused interrupt requires forced shutdown.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Register standalone community requests in the existing waiting inventory and clean them up on cancellation or completion.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Invalidate the selected pending request and acknowledge its stop without interrupting the active conversation.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Return from Stop immediately before native submission begins, preserving the acknowledgement barrier for an in-flight submission.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
johnmatthewtennant and others added 30 commits November 15, 2026 03:46
Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Keep addressed requests ahead of later wakes while admission is pending, including deferred handoffs after compaction. Release rejected admission without native submission.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Keep a wake ahead of later addressed work while compaction holds admission. Reserve its lane position immediately and wait for the existing controls handoff before execution.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Serialize shared remote forwarding through session controls before admission and execution selection. Wakes now wait for New-session cleanup, and held admission keeps later work in order.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Clear a remaining Starting view when the final queued job exits without a native turn. Preserve terminal failure and interruption states.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Carry the community marker through Claude and Codex inventories so a navigation source cannot block folder admission for a separate legacy conversation.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Include the retirement barrier in both community lane initializers so Stop and session Interrupt still find returning work before native execution begins.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Use session controls to reserve authorized work before preparing context. Preserve deferred handover lifetimes, cancel queued work on Interrupt and retirement, and keep Stop bound to its selected request.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Replay an early Stop when its downstream handler registers. Check cancellation before Pi submissions and retries and before deferred remote target handoffs.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Keep community target handoffs in the reserved callback until admission and connection setup finish. The outer admission helper already releases deferred callers without releasing their queue position.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Reserve voice startup through the shared admission boundary before preparing or resuming its native thread. Wait for compaction and cleanup before opening the seat.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Keep the post-connection cancellation check for reserved community work and active handoffs. Deferred legacy work retains its accepted target lifetime after the handover deadline.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Use the request cancellation flag after acceptance and register Stop before waiting for submission. Keep the source-preparation signal check so early community cancellation remains effective.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Select session keys from the delivery settings instead of mutable runtime entries, including work deferred behind community admission.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Return an unsuccessful outcome when an ordered wake callback is skipped after cancellation, preserving successful outcomes for executed work.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Track an explicit admission result through retained work for both inline preparation and queued admission. Preserve unsuccessful outcomes when callbacks are skipped or aborted, and await all retained work in the Pi fixture.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Use delivery settings consistently for standalone admission and execution in Claude, Goose and Pi, independent of subsequent settings synchronization.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Derive default MCP routing from the admitted source independently of the shared session key. Keep direct messages and Solo chats at channel level.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Use the admitted delivery scope before replacing a shared runtime handle, preserving the active turn publication owner while later community work waits or is stopped.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
End the complete project prefix before ordinary turn context so transcript parsing and local Usage retain structured session attribution.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Report interrupted community work that never submitted as unsuccessful when its actual retained completion settles. Preserve active publication ownership and silent Stop behavior.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Retain the active community publication handle and wait for its policy lifetime before admitting native thread or channel work.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Wait for independent sessions during shared handover without including them in the community cancellation chain.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Wait for active community work before assigning a thread or channel standalone publisher, including wakes that produce no prompt. Keep the wait abortable without cancelling the community lifetime.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>
Register independent wake completion before execution so later community work waits before taking publication ownership. Preserve independent cancellation and native Stop outcomes.

Co-authored-by: Zack <04f47b290b155b3b8b782b11501cdb15f1e21e82dfceefd01ff0ed405459d927@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz>

This branch has not been deployed

No deployments
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.

1 participant