feat: replace file-based IPC with Unix sockets#667
Closed
echthesia wants to merge 3 commits intoqwibitai:mainfrom
Closed
feat: replace file-based IPC with Unix sockets#667echthesia wants to merge 3 commits intoqwibitai:mainfrom
echthesia wants to merge 3 commits intoqwibitai:mainfrom
Conversation
Replace polling-based file IPC between host and container agents with
NDJSON over Unix sockets for near-instant message delivery.
Host creates a per-group socket at data/ipc/{group}/nc.sock before
container spawn. Container MCP server and agent-runner connect as
clients. Messages flow as newline-delimited JSON. Snapshot files
(current_tasks.json, available_groups.json) remain as files.
- Add src/ipc-socket.ts with NdjsonParser and IpcSocketServer
- Remove startIpcWatcher() and IPC_POLL_INTERVAL
- Update group-queue to send via socket instead of file writes
- Update container-runner with socket lifecycle (create/destroy)
- Rewrite container agent-runner with IpcClient (socket-based input)
- Rewrite container MCP server to use socket instead of writeIpcFile()
- Remove stale IPC subdirs from Dockerfiles
- Update docs (SPEC.md, debug skill, main group CLAUDE.md)
- Add NdjsonParser unit tests and socket integration tests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Update Apple Container and Gmail skill modify files for socket IPC (remove IPC subdirs, simplify mkdirSync) - Convert X-integration agent.ts from writeIpcFile to sendIpcMessage - Update Telegram swarm SKILL.md references to socket-based IPC - Update Gmail index.ts.intent.md to reference IpcClient - Bump core_version to 1.3.0 in affected skill manifests - Bump package.json to 1.3.0 - Add [BREAKING] CHANGELOG entry with migration instructions - Remove unused private socket field from IpcClient - Remove sandbox special-casing from socket tests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Instead of letting invalid JSON warnings leak to test output, mock logger.warn and assert the correct lines are logged. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Author
|
Closed due to macOS not supporting bind mounts of UNIX sockets |
This was referenced Mar 3, 2026
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
data/ipc/{group}/nc.sockbefore container spawn; container MCP server and agent-runner connect as clientscurrent_tasks.json,available_groups.json) remain as files — they're pre-start state, not ongoing IPCChanges
Core
src/ipc-socket.ts:NdjsonParserclass andIpcSocketServerwith per-group socket lifecyclesrc/ipc.ts: RemovedstartIpcWatcher()and polling loop; keptIpcDepsinterface andprocessTaskIpc()src/config.ts: RemovedIPC_POLL_INTERVALsrc/group-queue.ts:sendMessage()andcloseStdin()now use socket instead of file writessrc/container-runner.ts: Socket create before spawn, destroy on close; simplified IPC dir to singlemkdirSyncsrc/index.ts: WiredcreateIpcSocketServer()before scheduler loop, added shutdown handlerContainer
container/agent-runner/src/index.ts: NewIpcClientclass replaces file polling with socket event handling;connectIpcSocket()with retry backoffcontainer/agent-runner/src/ipc-mcp-stdio.ts:sendIpcMessage()over lazy socket connection replaceswriteIpcFile()container/Dockerfile: Removed stalemessages/,tasks/,input/subdirsSkills
writeIpcFile()tosendIpcMessage()in agent.tsOther
[BREAKING]CHANGELOG entryTest plan
npm run typecheck— clean compilenpm test— 299 passing (12 new), no regressions./container/build.sh— rebuild container imageschedule_task,pause_task,cancel_task)🤖 Generated with Claude Code