feat(rpc): multi-session mode for the plain-RPC protocol#312
Merged
Conversation
…calStorage subpath
… for rpc command union
…restore classic pins
This was referenced Jul 23, 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
Adds a multi-session mode to senpi's plain-RPC protocol so one senpi process can host many concurrent
AgentSessions over stdio, each fully isolated. This is the senpi half of omo-desktop-app's single-shared-process cutover (companion PR in code-yeongyu/omo-desktop-app). Classic single-session--mode rpcstays byte-identical.What's new
--multi-sessionflag: no default session is constructed; the process hosts a session registry. Classic mode is unchanged except the additive, side-effect-freeget_protocol_infocommand.open_session/close_session/list_sessions/get_protocol_info, asessionIdrouting envelope on session-scoped commands,sessionIdtagging on session-owned output, and stable machine-matchable error codes (unknown_session,session_closing,session_path_in_use,missing_session_id,multi_session_disabled,invalid_path,open_failed). Two identities: an ephemeral per-epoch routing handle vs the durable JSONL session id.session overlay → immutable builtinsvia a node-only@earendil-works/pi-ai/node/provider-scopesubpath (root/compat stay browser-safe); session-owned MCP service / elicitation / instructions / prompts; session-keyed config-reload handoff. Includes a shared-state audit of the agent core.opening|open|closing|closed) with path reservation, synchronousclosingtransition, and atomic rollback on open failure; immutable per-open launch profile (permissionPreset/model/thinkingLevel/cwd) applied on create, restored on resume.Non-goals
No app-server/ACP changes. No per-connection multi-tenant key isolation (that stays the neo daemon's job). Full rich-event vocabulary preserved — only the additive
sessionIdkey.Verification
vitest --rungreen;npm run checkgreen (incl. neo Go build/vet/tests — neo behavior unchanged, bridge exhaustiveness maintained).Plan:
.omo/plans/senpi-single-rpc-process.md(in the omo-desktop-app repo).🤖 Generated with senpi
Summary by cubic
Adds a multi-session mode for the plain-RPC protocol so one
senpi --mode rpcprocess can host many isolated sessions over a single stdio stream. Classic mode stays byte-identical;get_protocol_infois the only additive command.New Features
--multi-sessionRPC host with no default session; sessions are created on demand.get_protocol_info,open_session,close_session,list_sessions; session-scoped commands are routed bysessionId.unknown_session,session_closing,session_path_in_use,missing_session_id,multi_session_disabled,invalid_path,open_failed).@earendil-works/pi-ai/node/provider-scope(ALS-backed overlay) with handler binding for EventEmitter callbacks.cwd,permissionPreset,model,thinkingLevel), with path reservation and atomic rollback on open failure.sessionId.Migration
senpi --mode rpc --multi-session.get_protocol_info. Then useopen_session/close_session/list_sessions. IncludesessionIdon all session-scoped commands; events includesessionId.--mode rpcneeds no changes and remains wire-identical.Written for commit 63b69d8. Summary will update on new commits.