mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-01 15:35:12 +01:00
fix: retain legacy plugin login output during session binding
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
1e608d78fc
commit
a31eba2381
2 files changed
+98
-5
No files matched your search
@@ -1548,7 +1548,14 @@ export function createPluginWorkerHandle(
|
||||
if (loginPtyRoutesByHostRouteId.size !== 1) return null;
|
||||
const workerSessionId = readNonEmptyString(params.workerSessionId);
|
||||
if (!workerSessionId) return null;
|
||||
return loginPtyRoutesByWorkerSessionId.get(workerSessionId) ?? null;
|
||||
const bound = loginPtyRoutesByWorkerSessionId.get(workerSessionId);
|
||||
if (bound) return bound;
|
||||
// The open reply and a legacy notification can share one stdout chunk,
|
||||
// before the await continuation binds the session ID. Queue against the
|
||||
// sole opening route; bounded replay still checks the claimed ID against
|
||||
// the validated reply. Never guess between concurrent or bound routes.
|
||||
const opening = loginPtyRoutesByHostRouteId.values().next().value;
|
||||
return opening?.state === "opening" ? opening : null;
|
||||
}
|
||||
|
||||
// Route one login pseudo-terminal output notification to the per-session
|
||||
|
||||
Reference in new issue
Block a user