Add debug logging to RuntimeMessageRouter and increase API key validation tokens

- Add console.log for user script messages in RuntimeMessageRouter
- Increase ProviderKeyInput maxTokens from 10 to 200 for better validation
This commit is contained in:
Mario Zechner 2025-10-09 18:57:43 +02:00
parent c2793d8017
commit b288cd9448
2 changed files with 4 additions and 1 deletions

View file

@ -67,7 +67,7 @@ export class ProviderKeyInput extends LitElement {
const result = await complete(model, context, { const result = await complete(model, context, {
apiKey, apiKey,
maxTokens: 10, maxTokens: 200,
} as any); } as any);
return result.stopReason === "stop"; return result.stopReason === "stop";

View file

@ -183,6 +183,8 @@ export class RuntimeMessageRouter {
const context = this.sandboxes.get(sandboxId); const context = this.sandboxes.get(sandboxId);
if (!context) return false; if (!context) return false;
console.log("Router received user script message for sandbox:", sandboxId, message);
const respond = (response: any) => { const respond = (response: any) => {
sendResponse({ sendResponse({
...response, ...response,
@ -210,6 +212,7 @@ export class RuntimeMessageRouter {
}; };
chrome.runtime.onUserScriptMessage.addListener(this.userScriptMessageListener); chrome.runtime.onUserScriptMessage.addListener(this.userScriptMessageListener);
console.log("[RuntimeMessageRouter] Registered chrome.runtime.onUserScriptMessage listener");
} }
} }
} }