Repository navigation
app: a conversation's id is its folder's name; finish the wrap-up after the app's pipes close - #1973
Merged
Merged
Conversation
Since transcripts moved into <id>/.cell/transcript.jsonl, appAgentID took the transcript's parent folder and named every new conversation ".cell". factory.job_chats then asked for ".cell" and found nothing (ids starting with "." are refused), and once any agent was created, ".cell" resolved to that agent for every caller. appAgentID now uses session.DirOf, the session folder in both layouts; a legacy flat folder answers exactly as before. Tests (cells on): the id rule in both layouts, two agents.create calls get distinct folder-name ids that each find their own conversation, and factory.job_chats on a cell Talk answers the Talk folder's id. All three fail on the old code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An app may quit without waiting for its engine, and a crash cannot wait. The engine then keeps stopping its processes and writing its conversations down after both pipes to the app have closed, and Go ends a program that writes to a broken stdout or stderr unless SIGPIPE is ignored. codeaf app now ignores SIGPIPE, so those writes fail and the bounded wrap-up finishes. Test: a child that ignores broken pipes writes on after its parent closed both pipes and still finishes; without the ignore it dies by SIGPIPE. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…verywhere
From an independent review of this PR:
- signal.Ignore(SIGPIPE) is inherited across exec, so every shell, tool
and server the engine starts lost SIGPIPE (`producer | head` never
ended). surviveBrokenPipes now uses signal.Notify: the engine's own
writes to a closed pipe still fail with EPIPE, and its children keep
the default.
- The test waits for the parent to close its ends, writes until both
writes fail with EPIPE, and checks that a child shell still ends
`yes | head -1` with 141.
- Media listing, attachment staging, deliverables, lazy wake-ups and
recorded attachments still took the transcript's parent (".cell") as
the session folder; they use session.DirOf / appAgentID now. The create
test checks a cell conversation's media scope is its own folder.
- One change entry, named and numbered for this PR.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
Fixes new conversations all getting the id
.cell, and lets an app engine finish its leaving wrap-up after its app has gone..cellids<id>/.cell/transcript.jsonl(Wormhole: your codeaf follows you between computers (on by default) #1888),appAgentIDtook the transcript's parent folder, so every new conversation was named.cellfactory.job_chatsasked for.celland found nothing; once any agent was created,.cellresolved to that agent for every callerappAgentIDnow usessession.DirOf: the session folder in both layouts; legacy folders answer as before.cell)SIGPIPE
codeaf appnow asks for SIGPIPE withsignal.Notify(notIgnore, which children would inherit), so its own writes fail with EPIPE and the bounded wrap-up finishes, while shells and tools it starts keep SIGPIPETests
agents.createcalls get distinct folder-name ids that each find their own conversation;factory.job_chatson a cell Talk answers the Talk folder's id (all three fail on the old code)yes | head -1with 141 (fails with no guard, and withsignal.Ignore)go test ./...compared with a clean575a39018: no new failuresReview
.cellcall sites, stronger test, one numbered change entry)How to test
go test ./cmd/codeaf -run 'TestAppAgentID|TestAppCreateGivesEachCell|TestAJobsChatsNameTheCellTalksFolder|TestAnEngineWritesOnAfterItsAppsPipesClose'.cell.🤖 Generated with Claude Code