@questionbase/deskfree 0.6.8 → 0.6.9

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/dist/bin.js CHANGED
@@ -14012,6 +14012,13 @@ async function routeMessage(message, client, deps, sessionStore, config) {
14012
14012
  const delta = extractTextDelta(message2);
14013
14013
  if (delta) {
14014
14014
  fullText += delta;
14015
+ if (!fullText.trim()) {
14016
+ log.warn(`Skipping whitespace-only delta`, {
14017
+ delta: JSON.stringify(delta),
14018
+ fullText: JSON.stringify(fullText)
14019
+ });
14020
+ continue;
14021
+ }
14015
14022
  if (!streamStarted) {
14016
14023
  await streamingSession.start(fullText, replyTaskId);
14017
14024
  streamStarted = true;
@@ -14047,8 +14054,12 @@ async function routeMessage(message, client, deps, sessionStore, config) {
14047
14054
  }
14048
14055
  if (streamStarted && streamingSession.isActive()) {
14049
14056
  await streamingSession.close(fullText || void 0);
14050
- } else if (!streamStarted && fullText) {
14057
+ } else if (!streamStarted && fullText.trim()) {
14051
14058
  await client.sendMessage({ content: fullText, taskId: replyTaskId });
14059
+ } else if (!streamStarted && fullText && !fullText.trim()) {
14060
+ log.warn(`Skipping sendMessage: fullText is whitespace-only`, {
14061
+ fullText: JSON.stringify(fullText)
14062
+ });
14052
14063
  }
14053
14064
  if (capturedSessionId) {
14054
14065
  sessionStore.setSessionId(sessionKey, capturedSessionId);
@@ -14062,8 +14073,10 @@ async function routeMessage(message, client, deps, sessionStore, config) {
14062
14073
  }
14063
14074
  }
14064
14075
  const errMsg = err instanceof Error ? err.message : String(err);
14076
+ const errStack = err instanceof Error ? err.stack : void 0;
14065
14077
  const errStderr = err?.["stderr"] ?? "";
14066
14078
  log.warn(`Failed to handle message: ${errMsg}`, {
14079
+ stack: errStack,
14067
14080
  stderr: errStderr ? String(errStderr).slice(0, 2e3) : void 0,
14068
14081
  exitCode: err?.["exit_code"]
14069
14082
  });
@@ -14983,7 +14996,7 @@ async function startAgent(opts) {
14983
14996
  log.info("DeskFree Agent Runtime starting...");
14984
14997
  const { getRotationToken: getRotationToken2, setInitialRotationToken: setInitialRotationToken2 } = await Promise.resolve().then(() => (init_ws_gateway(), ws_gateway_exports));
14985
14998
  const { collectFingerprint: collectFingerprint2 } = await Promise.resolve().then(() => (init_fingerprint(), fingerprint_exports));
14986
- const runtimeVersion = "0.6.8";
14999
+ const runtimeVersion = "0.6.9";
14987
15000
  const fingerprint = collectFingerprint2(localConfig.stateDir, runtimeVersion);
14988
15001
  log.info("Connecting to DeskFree...", { wsUrl: localConfig.wsUrl });
14989
15002
  const connectResult = await initialConnect({