@skaile/workspaces 3.22.0 → 3.22.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.22.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#705](https://github.com/skaile-ai/workspaces/pull/705) [`d69c3ff`](https://github.com/skaile-ai/workspaces/commit/d69c3ff31fe4631936263d3dd48969972a68cbe4) Thanks [@Frozen666](https://github.com/Frozen666)! - fix(runner): answer a paused question before awaiting the driver swap
8
+
9
+ A wake that delivered a skill while the first turn was paused on
10
+ `AskUserQuestion` wedged the session permanently. `recreateAgentSession` arms
11
+ `beginSwap` synchronously and then waits for the active turn; that turn only
12
+ settles once `answerQuestion` resolves it; and `handleReply` awaited the swap
13
+ before it looked for a pending question — swap waits on turn, turn waits on
14
+ answer, answer waits on swap. Only a cancel escaped it.
15
+
16
+ The reply router now answers a paused question on the current driver (the one
17
+ the swap is waiting on, so it has not been disposed) and gates only the
18
+ fall-through, which genuinely starts a new turn, on the swap.
19
+
20
+ `attach_instance`'s skill branch also stops awaiting the driver rebuild, matching
21
+ its MCP sibling: the platform caps a runner capability call at 30s and a rebuild
22
+ routinely exceeds that, so each wake-delivered skill burned a 30s timeout even
23
+ though staging succeeded in ~9ms.
24
+
3
25
  ## 3.22.0
4
26
 
5
27
  ### Minor Changes
@@ -4,7 +4,7 @@ import { WorkspacePlugin } from './chunk-IUOXPQA3.js';
4
4
  import { assembleSystemPrompt, buildCapabilitiesPromptSection } from './chunk-W3UDISS2.js';
5
5
  import { WebSocketServerTransport } from './chunk-WQ7DE5UC.js';
6
6
  import { prepareNativePolicy, codexInstanceEnvironment, parseCodexCredential, parseCodexRefreshInput, parseCodexRefreshResult } from './chunk-T3YLZQS4.js';
7
- import { resolveFlowPath } from './chunk-AA3ZFPWX.js';
7
+ import { resolveFlowPath } from './chunk-V7QZ7QIE.js';
8
8
  import { findAiAssetsRoot as findAiAssetsRoot$1, deployCatalogEntry, undeployCatalogEntry } from './chunk-7BUZQVRR.js';
9
9
  import { registerBuiltinConnectors, buildConnectorPromptSection, findMissingPackages, installNpmPackages, ConnectorManager, ConnectorStartupError, buildSdkConnectorTools, buildConnectorToolDefs, buildFlowToolDefs, driveOrchestratorTurn, SessionNodeExecutor, SessionSubpromptRunner, SessionInlineSubFlowRunner, buildSdkFlowTools } from './chunk-PLLVREB2.js';
10
10
  import { loadConnectorDeclarations, SecretProviderChain, PreMintedSecretProvider, InMemorySecretProvider, resolvedConfigToDeclarations, isKnownSecretRef, deriveSingleMaterializedConnectorDeclaration } from './chunk-SIREWRZE.js';
@@ -3925,6 +3925,16 @@ var DriverSwapGate = class {
3925
3925
  }
3926
3926
  };
3927
3927
 
3928
+ // runner/src/reply-routing.ts
3929
+ async function routeReply(deps) {
3930
+ const current = deps.getDriver();
3931
+ if (current.hasPendingQuestion()) {
3932
+ return current.answerQuestion(deps.answer, deps.question, deps.requestId) ? "answered" : "fresh-turn";
3933
+ }
3934
+ await deps.awaitSwap();
3935
+ return "fresh-turn";
3936
+ }
3937
+
3928
3938
  // runner/src/compaction/prompt.ts
3929
3939
  var DEFAULT_COMPACTION_PROMPT = `You are being asked to compact this conversation into a structured summary.
3930
3940
  This summary will replace the full conversation history when the session
@@ -7430,7 +7440,9 @@ async function startAgentServer(opts) {
7430
7440
  }
7431
7441
  log(`[serve] runner.attach_instance staged skill(s): ${staged.join(", ")}`);
7432
7442
  const live = driverStarted;
7433
- await restartDriverForSkillChanges(staged.map((s) => ({ name: s, action: "add" })));
7443
+ scheduleDriverRestartForSkillChanges(
7444
+ staged.map((s) => ({ name: s, action: "add" }))
7445
+ );
7434
7446
  return { ok: true, id: name, live, toolCount: 0 };
7435
7447
  } catch (err) {
7436
7448
  return {
@@ -7474,6 +7486,13 @@ async function startAgentServer(opts) {
7474
7486
  }))
7475
7487
  });
7476
7488
  }
7489
+ function scheduleDriverRestartForSkillChanges(catalogActions) {
7490
+ void restartDriverForSkillChanges(catalogActions).catch((err) => {
7491
+ serverLog.warn(
7492
+ `[serve] background driver restart for skill changes failed: ${err instanceof Error ? err.message : String(err)}`
7493
+ );
7494
+ });
7495
+ }
7477
7496
  let runtimeRejected = false;
7478
7497
  async function handleSessionInit(cmd) {
7479
7498
  const initReceivedAt = Date.now();
@@ -7779,9 +7798,14 @@ async function startAgentServer(opts) {
7779
7798
  async function handleReply(cmd) {
7780
7799
  if (!await awaitSessionReadyOrFail()) return;
7781
7800
  log(`[serve] reply: ${cmd.answer.slice(0, 80)}...`);
7782
- await driverSwapGate.awaitSwap();
7783
- if (driver.hasPendingQuestion() && driver.answerQuestion(cmd.answer, cmd.question, cmd.requestId))
7784
- return;
7801
+ const routed = await routeReply({
7802
+ getDriver: () => driver,
7803
+ awaitSwap: () => driverSwapGate.awaitSwap(),
7804
+ answer: cmd.answer,
7805
+ question: cmd.question,
7806
+ requestId: cmd.requestId
7807
+ });
7808
+ if (routed === "answered") return;
7785
7809
  if (!driver.acceptsReplyAsPrompt) return;
7786
7810
  if (!await awaitCompactionIdle("reply")) return;
7787
7811
  const endTurn = driverSwapGate.beginTurn();
@@ -8346,5 +8370,5 @@ function touchSession(state) {
8346
8370
  }
8347
8371
 
8348
8372
  export { CLAUDE_CODE_CREDENTIALS_KEY, COMPILE_MANIFEST_FILENAME, CapabilityRegistry, DEFAULT_CAPABILITY_CALL_TIMEOUT_MS, DEFAULT_COALESCE_MS, DEFAULT_FLOW_MUTATE_CONNECTOR_WAIT_MS, MOUNT_LIST_MAX_DEPTH, MOUNT_LIST_MAX_ENTRIES, MOUNT_READ_DEADLINE_FACTOR, MOUNT_TREE_OP_DEADLINE_FACTOR, MarkdownStreamer, PreInitRingSink, agentDefinitionExists, bootstrapCapabilityRegistry, bootstrapRunnerLogStore, buildAgentResources, buildClientCapabilityHandler, buildConnectorTokenMediator, buildContextSection, buildEnvironmentSection, buildResourcesAvailablePayload, buildStoreSnapshotReplay, builtinCapabilities, capabilityLogInstance, clearPreInitRingSink, clearSession, compileComposition, computeCapabilitySignature, connectorRefreshKind, createAgentSession, createFlowConnectorReadiness, createManagedCodexSubpromptDriver, createSessionStimulusBus, defineCapability, deleteSession, dispatchRunnerCapabilityInvocation, emitSystemPromptComposed, ensureClaudeSettingsDisablesConnectors, ensureGitConfigInclude, executeConnectorMutate, extractClaudeAiOauthExpiresAt, getPreInitRingSink, handleMountResourceRequest, handleResourceRequest, hasNonTerminalFlow, hostOpResumeStimulus, installPreInitRingSink, isTerminalFlowStatus, listSessions, loadAgentManifest, loadCompileManifest, loadCompileManifestFromDir, loadManagedCodexHostConfig, loadSession, loadSessionById, mcpAuthSecretKey, newSession, nulTailPaddingLength, pickRepointedManager, planFlowMutate, prepareCodexTools, reconcilePendingDecisions, registerActiveFlow, registerCompositionCapabilities, rejectCapabilityOnApprovalDeny, resetRunnerLogStore, resolveAgentComposition, resolveAgentMixins, resolveBinding, resolveCapabilityCallTimeoutMs, resolveCapabilityResult, resolveComposition, resolveFlowMutateConnectorWaitMs, resolveMixin, runAgentChat, saveSession, setCurrentSession, setUpFlowConnector, startAgentServer, stimulusFromMetas, supportsLiveToolUpdates, touchSession, validateInputResponse, writeClaudeCodeCredentialsFile };
8349
- //# sourceMappingURL=chunk-FXHBHT75.js.map
8350
- //# sourceMappingURL=chunk-FXHBHT75.js.map
8373
+ //# sourceMappingURL=chunk-SYHMXGLF.js.map
8374
+ //# sourceMappingURL=chunk-SYHMXGLF.js.map