@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.
- package/dist/commands/install.js +5 -13
- package/dist/commands/install.js.map +1 -1
- package/dist/commands/status.js +3 -0
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/upload.js +23 -1
- package/dist/commands/upload.js.map +1 -1
- package/dist/i18n/index.js +2 -0
- package/dist/i18n/index.js.map +1 -1
- package/dist/media/oss-uploader.d.ts +1 -1
- package/dist/media/oss-uploader.js +19 -2
- package/dist/media/oss-uploader.js.map +1 -1
- package/dist/platform/service-manager.d.ts +3 -0
- package/dist/platform/service-manager.js +177 -44
- package/dist/platform/service-manager.js.map +1 -1
- package/dist/relay/relay-manager.js +10 -0
- package/dist/relay/relay-manager.js.map +1 -1
- package/package.json +1 -1
- package/rethinkingstudio-clawpilot-1.1.17.tgz +0 -0
- package/src/commands/install.ts +5 -12
- package/src/commands/status.ts +3 -0
- package/src/commands/upload.ts +23 -1
- package/src/i18n/index.ts +2 -0
- package/src/media/oss-uploader.ts +20 -2
- package/src/platform/service-manager.ts +179 -44
- package/src/relay/relay-manager.ts +14 -0
|
@@ -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
|