mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-17 08:00:59 +00:00
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:
parent
c2793d8017
commit
b288cd9448
2 changed files with 4 additions and 1 deletions
|
|
@ -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";
|
||||||
|
|
|
||||||
|
|
@ -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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue