Stop daemon crashes from terminal-list worker timeouts
getTerminals was the only terminal read that round-tripped the terminal worker process. Under load the IPC call could hit its 10s timeout, and the rejection from a fire-and-forget workspace-update emit propagated as an unhandled rejection — taking down the whole daemon. The daemon already maintains an authoritative mirror of terminal state (every other read is served from it), so getTerminals now reads that mirror locally, preserving the worker's descendant-path aggregation and absolute-path guard. The getTerminals worker IPC request is removed entirely, so no terminal read can stall on the worker anymore. Also adds a defensive .catch to the two fire-and-forget workspace-update sites, and hoists the duplicated assertAbsolutePath guard into one shared helper in path-utils.
This commit is contained in:
@@ -241,19 +241,6 @@ async function handleCreateTerminalRequest(message: TerminalCreateRequest): Prom
|
||||
|
||||
async function handleRequest(message: TerminalWorkerRequest): Promise<void> {
|
||||
switch (message.type) {
|
||||
case "getTerminals": {
|
||||
const terminals = await manager.getTerminals(message.cwd, {
|
||||
workspaceId: message.workspaceId,
|
||||
});
|
||||
sendToParent({
|
||||
type: "response",
|
||||
requestId: message.requestId,
|
||||
ok: true,
|
||||
result: terminals.map(toTerminalInfo),
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
case "createTerminal": {
|
||||
await enqueueCreateTerminalRequest(message);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user