MCPcopy Create free account
hub / github.com/coder/mux / waitForAgentSessionIdle

Function waitForAgentSessionIdle

src/node/services/workspaceService.ts:558–568  ·  view source on GitHub ↗
(session: AgentSession, signal?: AbortSignal)

Source from the content-addressed store, hash-verified

556const IDLE_ONLY_BUSY_SKIP_MESSAGE = "Workspace is busy; idle-only send was skipped.";
557
558async function waitForAgentSessionIdle(session: AgentSession, signal?: AbortSignal): Promise<void> {
559 assert(session instanceof AgentSession, "waitForAgentSessionIdle requires an AgentSession");
560 try {
561 await session.waitForIdle(signal);
562 } catch (error) {
563 if (signal?.aborted === true) {
564 throw new Error(WORKSPACE_IDLE_WAIT_CANCELED_MESSAGE);
565 }
566 throw new Error(getErrorMessage(error));
567 }
568}
569
570interface FileCompletionsCacheEntry {
571 index: FileCompletionsIndex;

Callers 1

waitForWorkspaceIdleMethod · 0.85

Calls 3

getErrorMessageFunction · 0.90
assertFunction · 0.50
waitForIdleMethod · 0.45

Tested by

no test coverage detected