@rethinkingstudio/clawpilot 1.1.17-beta.0 → 1.1.17-beta.2

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.
@@ -15,6 +15,12 @@ import { randomUUID } from "crypto";
15
15
 
16
16
  const OUTBOUND_DIR = join(homedir(), ".openclaw", "media", "outbound");
17
17
 
18
+ function isSuspiciousShortReply(text: string | null | undefined): boolean {
19
+ const normalized = (text ?? "").replace(/\s+/g, " ").trim().toLowerCase();
20
+ if (!normalized) return true;
21
+ return normalized.length <= 4 || ["no", "ok", "nope", "n/a", "no_reply"].includes(normalized);
22
+ }
23
+
18
24
  function extensionFromMimeType(mimeType: string): string {
19
25
  const map: Record<string, string> = {
20
26
  "image/jpeg": ".jpg",
@@ -156,6 +162,11 @@ export async function runRelayManager(opts: RelayManagerOptions): Promise<boolea
156
162
  if (text) {
157
163
  (p as Record<string, unknown>).message = { content: [{ type: "text", text }] };
158
164
  }
165
+ if (isSuspiciousShortReply(text)) {
166
+ console.warn(
167
+ `[relay] suspicious chat final history text runId=${runId} sessionKey=${sessionKey} text=${JSON.stringify(text ?? "")}`
168
+ );
169
+ }
159
170
 
160
171
  // Upload any media blocks found in the history
161
172
  try {
@@ -178,6 +189,9 @@ export async function runRelayManager(opts: RelayManagerOptions): Promise<boolea
178
189
  })
179
190
  .catch((err) => {
180
191
  console.error(`[relay] chat.history fetch failed: ${err}`);
192
+ console.warn(
193
+ `[relay] suspicious chat final history fetch failure runId=${runId} sessionKey=${sessionKey}`
194
+ );
181
195
  send({ type: "event", event, payload });
182
196
  });
183
197
  return; // will send after history fetch + media upload