{"record":{"id":"b5d261c10bfab549","repo":"paperclipai/paperclip","slug":"setup-token-pty-route-busy","errorCode":"SETUP_TOKEN_PTY_ROUTE_BUSY","errorMessage":"SETUP_TOKEN_PTY_ROUTE_BUSY","messagePattern":"SETUP_TOKEN_PTY_ROUTE_BUSY","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/src/services/plugin-worker-manager.ts","lineNumber":1407,"sourceCode":"    kind: \"output\";\n    workerSessionId: string;\n    chunk: string;\n  }\n\n  interface LoginPtyPreBindExitRecord {\n    kind: \"exit\";\n    workerSessionId: string;\n    exitCode: number | null;\n  }\n\n  type LoginPtyPreBindRecord = LoginPtyPreBindOutputRecord | LoginPtyPreBindExitRecord;\n\n  interface LoginPtyRoute {\n    hostRouteId: string;\n    state: LoginPtyRouteState;\n    workerSessionId: string | null;\n    listener: ((chunk: string) => void) | null;\n    buffered: string[];\n    deliveredChars: number;\n    terminalized: boolean;\n    settleWait: (value: { exitCode: number | null }) => void;\n    // Every output and exit record that arrived before the bind, in arrival order.\n    preBind: LoginPtyPreBindRecord[];\n    // The cumulative characters `preBind` holds. Each record charges its\n    // `workerSessionId` characters, plus the `chunk` characters for an output\n    // record.\n    preBindChars: number;\n  }\n  // The live login pseudo-terminal routes on this worker, keyed by the host\n  // route id. A route lives here from reservation — before the open call —\n  // until it terminalizes. An output or an exit notification resolves its\n  // route through this map first, so more than one route can be `reserved`,\n  // `opening`, or `open` on one worker at once.\n  const loginPtyRoutesByHostRouteId = new Map<string, LoginPtyRoute>();\n  // True once this worker has logged the missing-`hostRouteId` warning below.\n  // A plugin build old enough to omit the field would otherwise log one line","sourceCodeStart":1389,"sourceCodeEnd":1425,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/services/plugin-worker-manager.ts#L1389-L1425","documentation":"The single setup-token PTY route is already reserved by another open session. Only one live login pseudo-terminal per worker is allowed, so the second concurrent open fails with this sentinel code.","triggerScenarios":"Thrown at server/src/services/plugin-worker-manager.ts:1181 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Another PTY session is active on this route. Close the existing session or wait for it to finish before opening a new one."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}