fix(session): claim named Sessions in arrival order before resolving presets

session.create resolved the requested preset before queueing on the named
identity, so a later request whose preset resolved first could run first, and
an undeclared preset masked the directory conflict the README promises.
Queue first, check the named Session's directory and ownership, then resolve
the preset inside the queue, and report the preset each request left the
Session running instead of reading it after the queue moved on. The no-roster
conflict message now names its actual cause.
This commit is contained in:
Yichen Jiang committed 2026-10-09 11:29:04 +08:00
1 parent 64c47c6306
commit 1b8a55116e
8 files changed
+95 -41

No files matched your search

@@ -494,8 +494,8 @@ export class SessionManager {
} = {},
): Promise<RemoteResult<{ sessionId: SessionId }>> {
const shared = {
...opts.sessionId === undefined ? {} : { sessionId: opts.sessionId },
...opts.agentPreset === undefined ? {} : { agentPreset: opts.agentPreset },
...(opts.sessionId === undefined ? {} : { sessionId: opts.sessionId }),
...(opts.agentPreset === undefined ? {} : { agentPreset: opts.agentPreset }),
}
const payload = opts.workspaceId !== undefined
? { workspaceId: opts.workspaceId, ...shared }