feat(acp): honour _meta.freshSession — !rotate opens a new channel conversation; repin buzz-acp to fountain.3 - #788
Merged
Conversation
…nversation; repin buzz-acp to fountain.3 The channel-bound resume (#774) hands the harness the same conversation on every session/new, which made buzz-acp's !rotate a no-op behind Fountain: the harness dropped its session, asked again with the same _meta.channelId, and got the old conversation back (observed on the hosted Fountain Maintainer). The harness now marks that one session/new with _meta.freshSession: true. fountain acp forwards it as fresh: true on POST /api/conversations; the server unbinds the current conversation from the channel (channel_id cleared — it keeps running) and opens a new one as the binding. Unbinding rather than 'newest wins' keeps the outcome independent of inserted_at's one-second precision. buzz-acp.source -> jhgaylor/buzz@f98c2a7f (fountain-pin), release buzz-acp-v0.5.14-fountain.3: adds the freshSession signal and ignores owner control commands created before the process started, which ends the !shutdown restart loop (exit -> supervisor restart -> backlog replay -> exit, x5) seen on prod. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Jake Gaylor <jhgaylor@gmail.com>
…(warnings-as-errors) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Jake Gaylor <jhgaylor@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two prod findings after #787 (
!rotate/!shutdownnow reach the harness from Desktop):!rotatedid nothing. The harness rotated (log:!rotate received — invalidated idle channel session(s) invalidated=1), then the next turn'ssession/newcarried the same_meta.channelId, and the channel-bound resume (buzz: a hosted harness loses every channel's conversation and sandbox on each deploy (buzz-acp session/new after restart) #774) handed the same conversation back. Rotation and channel-binding cancelled out.!shutdownrestart-looped.Fountain.Buzz.Harnessrestarts on any exit (status=0included); the fresh process replayed the same!shutdownfrom its 5s subscription backlog and exited again — 5 cycles per command, ending online:Change
Rotate → new conversation (pairs with block/buzz#6103, which sends
_meta.freshSession: trueon the onesession/newafter!rotate):fountain acp(cli/internal/acp/session.go,cmd/acp.go): reads_meta.freshSession, forwards it asfresh: trueonPOST /api/conversations— only alongside a channel key.Conversations.start_or_resume_conversation/2): withfresh, the currently-bound conversation is unbound (channel_idcleared; it keeps running and the sandbox reaper retires it as usual) and a new one is opened as the binding. Unbinding rather than "newest wins" keeps the outcome independent ofinserted_at's one-second precision — the first cut relied on ordering and a same-second rotate resumed the old one in the test.freshonConversationCreateRequest.Shutdown loop (block/buzz#6104): the harness now ignores owner control commands created before its process started, so a replayed
!shutdownno longer re-fires. This PR does not changeHarness's restart-on-any-exit policy — that's a separate I5 question (should an owner!shutdownkeep the identity down until re-enabled?) worth its own decision; with #6104 the loop is gone either way.Pin:
buzz-acp.source→jhgaylor/buzz@f98c2a7f(fountain-pin= #6088 + #6101 + #6103 + #6104), releasebuzz-acp-v0.5.14-fountain.3, Dockerfile default ARG, CHANGELOG. #776's repin condition now includes #6103 and #6104.Test plan
TestNewSessionForwardsFreshSessionAfterARotate,TestCreateConversationSendsFreshWithTheChannelKey(new);go test ./internal/acp/ ./internal/cmd/green; gofmt/vet clean"fresh: true opens a new conversation despite the binding, and it takes over"(new) — 69/69 inconversation_controller_test.exs;mix format --check-formatted;credo --strictclean on the changed modulePublish buzz-acp→buzz-acp-v0.5.14-fountain.3(both arches) → CI →build→ Flux@Fountain Maintainer !rotate, then a mention → new conversation;!shutdown→ single clean exit in pod logs🤖 Generated with Claude Code