Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core/src/curator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function filterOps(arr: unknown[]): CuratorOp[] {
typeof o.category === "string" &&
typeof o.title === "string" &&
typeof o.content === "string" &&
typeof o.scope === "string"
(o.scope === "project" || o.scope === "global")
);
}
if (o.op === "update") {
Expand Down
7 changes: 4 additions & 3 deletions packages/core/src/embedding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -616,9 +616,10 @@ let remoteFallbackLogged = false;
* produces 401 errors.
*/
function looksLikeApiKey(key: string): boolean {
// Real API keys are at least 20 characters and don't look like
// common placeholders.
return key.length >= 20;
// Real API keys are at least 20 characters, don't contain whitespace,
// and aren't common placeholders.
const trimmed = key.trim();
return trimmed.length >= 20 && !/\s/.test(trimmed);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions packages/gateway/instrument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ if (sentryEnabled && !Sentry.isInitialized()) {
/LocalProviderUnavailableError/,
/ECONNRESET\b/,
/ECONNREFUSED\b/,
// Remote embedding fallback with invalid/placeholder API key
/Incorrect API key/i,
/onnxruntime/i,
// Remote embedding fallback with invalid/placeholder API key (OpenAI SDK format)
/Incorrect API key provided/i,
// ONNX runtime init failures on various platforms
/Cannot find package 'onnxruntime-node'/,
/LoadLibrary failed/,
/Protobuf parsing failed/,
Expand Down
4 changes: 4 additions & 0 deletions packages/gateway/src/translate/anthropic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,10 @@ export function parseAnthropicResponseJSON(
input: block.input,
});
break;
default:
// Preserve unknown block types as text so no data is silently lost
content.push({ type: "text", text: JSON.stringify(block) });
break;
}
}
}
Expand Down
Loading