Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

three.ws/chat

nirholas0c712bcaadd7
diff --git a/api/permissions/[action].js b/api/permissions/[action].js
index b45fc18b5..4cce85eec 100644
--- a/api/permissions/[action].js
+++ b/api/permissions/[action].js
@@ -909,7 +909,7 @@ const revokeBodySchema = z.object({
});
const revokeIface = new Interface(DELEGATION_MANAGER_ABI);
-const DISABLED_TOPIC = revokeIface.getEvent('DelegationDisabled').topicHash;
+const DISABLED_TOPIC = revokeIface.getEvent('DisabledDelegation').topicHash;
const RPC_TIMEOUT_MS = 5000;
@@ -1005,14 +1005,14 @@ async function handleRevoke(req, res) {
return error(res, 400, 'tx_reverted', 'transaction was reverted on-chain');
}
- // Decode DelegationDisabled event: (address indexed delegationManager, bytes32 indexed delegationHash)
- // topics[0] = event sig, topics[1] = delegationManager, topics[2] = delegationHash
+ // Decode DisabledDelegation event: (bytes32 indexed delegationHash, address indexed delegator, address indexed delegate, ...)
+ // topics[0] = event sig, topics[1] = delegationHash, topics[2] = delegator, topics[3] = delegate
const disabledLog = receipt.logs.find((log) => log.topics[0] === DISABLED_TOPIC);
if (!disabledLog) {
- return error(res, 400, 'tx_mismatch', 'transaction contains no DelegationDisabled event');
+ return error(res, 400, 'tx_mismatch', 'transaction contains no DisabledDelegation event');
}
- const loggedHash = disabledLog.topics[2]; // bytes32 indexed — raw topic IS the value
+ const loggedHash = disabledLog.topics[1]; // bytes32 indexed — raw topic IS the value
if (loggedHash.toLowerCase() !== row.delegation_hash.toLowerCase()) {
return error(res, 400, 'tx_mismatch', 'transaction revoked a different delegation hash');
}
diff --git a/api/skills/categories.js b/api/skills/categories.js
index b9a38199a..ccac25a63 100644
--- a/api/skills/categories.js
+++ b/api/skills/categories.js
@@ -1,11 +1,12 @@
import { sql } from '../_lib/db.js';
-import { json, error, method, wrap } from '../_lib/http.js';
+import { cors, json, method, wrap } from '../_lib/http.js';
function toLabel(slug) {
return slug.charAt(0).toUpperCase() + slug.slice(1);
}
export default wrap(async (req, res) => {
+ if (cors(req, res, { methods: 'GET,OPTIONS' })) return;
if (!method(req, res, ['GET'])) return;
const rows = await sql`
diff --git a/chat/src/App.svelte b/chat/src/App.svelte
index 27e40020b..b728c6d38 100644
--- a/chat/src/App.svelte
+++ b/chat/src/App.svelte
@@ -482,7 +482,7 @@
const msg = {
id: uuidv4(),
role: 'assistant',
- error: 'No model selected. Please add at least one API key and select a model to begin.',
+ error: 'No model selected. Please select a model to begin.',
content: '',
};
saveMessage(msg);
@@ -1243,8 +1243,9 @@
// Always prepend built-in free models so they're available without any API key
models = [...BUILTIN_MODELS, ...models];
- // Auto-select default built-in model if no model chosen yet
- if (!convo.models?.[0]?.id) {
+ // Auto-select default built-in model if no model chosen yet, or if the saved model no longer exists
+ const savedModelStillValid = convo.models?.[0]?.id && models.some((m) => m.id === convo.models[0].id);
+ if (!savedModelStillValid) {
const defaultId = $brandConfig.default_model;
const defaultModel = models.find((m) => m.id === defaultId) ?? BUILTIN_MODELS[0];
if (defaultModel) convo = { ...convo, models: [defaultModel] };
diff --git a/chat/src/convo.js b/chat/src/convo.js
index 7f329ca7f..b7479b3c3 100644
--- a/chat/src/convo.js
+++ b/chat/src/convo.js
@@ -14,7 +14,8 @@ export async function complete(convo, onupdate, onabort) {
model.provider === 'OpenAI' ||
model.provider === 'OpenRouter' ||
model.provider === 'Groq' ||
- model.provider === 'Mistral';
+ model.provider === 'Mistral' ||
+ model.provider === 'Built-in';
let messages = convo.messages.map(
openAICompatibleFormat ? messageToOpenAIFormat : messageToAnthropicFormat
diff --git a/public/chat/index.html b/public/chat/index.html
index bd2f18930..832f807f9 100644
--- a/public/chat/index.html
+++ b/public/chat/index.html
@@ -43,7 +43,7 @@
}
}
</script>
- <script type="module" crossorigin src="/chat/assets/index-CGS445lX.js"></script>
+ <script type="module" crossorigin src="/chat/assets/index-Dewa3DP4.js"></script>
<link rel="stylesheet" crossorigin href="/chat/assets/index-Ciwx7Aa1.css">
</head>
<body>