openclaw-abacusai-auth 1.1.0 → 1.2.0
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/README.md +9 -5
- package/index.ts +12 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -87,7 +87,7 @@ openclaw send "Hello" --model abacusai/gemini-3-flash-preview
|
|
|
87
87
|
│
|
|
88
88
|
▼
|
|
89
89
|
┌──────────────────────────────────────────────────────────────────┐
|
|
90
|
-
│ Local Proxy (http://127.0.0.1
|
|
90
|
+
│ Local Proxy (http://127.0.0.1:<dynamic-port>) │
|
|
91
91
|
│ │
|
|
92
92
|
│ Schema Normalization: │
|
|
93
93
|
│ 1. Removes `strict` field from tool definitions │
|
|
@@ -104,6 +104,9 @@ openclaw send "Hello" --model abacusai/gemini-3-flash-preview
|
|
|
104
104
|
└──────────────────────────────────────────────────────────────────┘
|
|
105
105
|
```
|
|
106
106
|
|
|
107
|
+
**Security:** The local proxy uses a dynamic port assigned by the OS at startup,
|
|
108
|
+
avoiding port conflicts and improving security.
|
|
109
|
+
|
|
107
110
|
**Why a local proxy?** AbacusAI's RouteLLM is _mostly_ OpenAI-compatible but has
|
|
108
111
|
strict schema requirements that OpenClaw's default tool schemas don't meet:
|
|
109
112
|
|
|
@@ -190,7 +193,7 @@ The plugin configures the AbacusAI provider to use the local proxy:
|
|
|
190
193
|
|
|
191
194
|
```json
|
|
192
195
|
{
|
|
193
|
-
"baseUrl": "http://127.0.0.1
|
|
196
|
+
"baseUrl": "http://127.0.0.1:<dynamic-port>",
|
|
194
197
|
"api": "openai-completions",
|
|
195
198
|
"auth": "token",
|
|
196
199
|
"compat": {
|
|
@@ -200,8 +203,9 @@ The plugin configures the AbacusAI provider to use the local proxy:
|
|
|
200
203
|
}
|
|
201
204
|
```
|
|
202
205
|
|
|
203
|
-
The local proxy automatically starts when the plugin loads
|
|
204
|
-
schema normalization before forwarding
|
|
206
|
+
The local proxy automatically starts when the plugin loads with a dynamic port
|
|
207
|
+
assigned by the OS, and handles all schema normalization before forwarding
|
|
208
|
+
requests to `https://routellm.abacus.ai/v1`.
|
|
205
209
|
|
|
206
210
|
---
|
|
207
211
|
|
|
@@ -214,7 +218,7 @@ After login, the plugin writes the following to `~/.openclaw/openclaw.json`:
|
|
|
214
218
|
"models": {
|
|
215
219
|
"providers": {
|
|
216
220
|
"abacusai": {
|
|
217
|
-
"baseUrl": "http://127.0.0.1
|
|
221
|
+
"baseUrl": "http://127.0.0.1:<dynamic-port>",
|
|
218
222
|
"api": "openai-completions",
|
|
219
223
|
"auth": "token",
|
|
220
224
|
"compat": {
|
package/index.ts
CHANGED
|
@@ -14,8 +14,9 @@ const DEFAULT_CONTEXT_WINDOW = 200_000;
|
|
|
14
14
|
const DEFAULT_MAX_TOKENS = 8192;
|
|
15
15
|
|
|
16
16
|
// Proxy configuration
|
|
17
|
-
const PROXY_PORT = 18790;
|
|
18
17
|
const PROXY_HOST = "127.0.0.1";
|
|
18
|
+
// Dynamic port - will be assigned when proxy starts
|
|
19
|
+
let proxyPort = 0;
|
|
19
20
|
|
|
20
21
|
// Models available on AbacusAI RouteLLM endpoint (OpenAI-compatible, with
|
|
21
22
|
// function calling support). Verified 2026-02.
|
|
@@ -539,18 +540,17 @@ function startProxy(apiKey: string): Promise<void> {
|
|
|
539
540
|
sendJsonResponse(res, 500, { error: { message: String(err) } });
|
|
540
541
|
});
|
|
541
542
|
});
|
|
542
|
-
|
|
543
|
-
|
|
543
|
+
// Use port 0 to let the OS assign a random available port
|
|
544
|
+
proxyServer.listen(0, PROXY_HOST, () => {
|
|
545
|
+
const addr = proxyServer?.address();
|
|
546
|
+
if (addr && typeof addr === "object") {
|
|
547
|
+
proxyPort = addr.port;
|
|
548
|
+
}
|
|
549
|
+
console.log(`[abacusai] proxy listening on http://${PROXY_HOST}:${proxyPort}`);
|
|
544
550
|
resolve();
|
|
545
551
|
});
|
|
546
552
|
proxyServer.on("error", (err: NodeJS.ErrnoException) => {
|
|
547
|
-
|
|
548
|
-
// Port already in use, assume proxy is already running
|
|
549
|
-
proxyServer = null;
|
|
550
|
-
resolve();
|
|
551
|
-
} else {
|
|
552
|
-
reject(err);
|
|
553
|
-
}
|
|
553
|
+
reject(err);
|
|
554
554
|
});
|
|
555
555
|
});
|
|
556
556
|
}
|
|
@@ -746,7 +746,7 @@ const abacusaiPlugin = {
|
|
|
746
746
|
// Use local proxy for schema normalization
|
|
747
747
|
// The proxy handles: removing `strict`, `patternProperties`,
|
|
748
748
|
// and adding `additionalProperties: false`
|
|
749
|
-
baseUrl: `http://${PROXY_HOST}:${
|
|
749
|
+
baseUrl: `http://${PROXY_HOST}:${proxyPort}`,
|
|
750
750
|
api: "openai-completions",
|
|
751
751
|
auth: "token",
|
|
752
752
|
models: modelIds.map((id) => buildModelDefinition(id)),
|
|
@@ -768,7 +768,7 @@ const abacusaiPlugin = {
|
|
|
768
768
|
defaultModel: defaultModelRef,
|
|
769
769
|
notes: [
|
|
770
770
|
"Local proxy mode: schema normalization handled by plugin proxy.",
|
|
771
|
-
"Proxy
|
|
771
|
+
"Proxy uses dynamic port and forwards to RouteLLM.",
|
|
772
772
|
"Full OpenAI function-calling support is enabled.",
|
|
773
773
|
"Manage your API keys at https://abacus.ai/app/profile/apikey",
|
|
774
774
|
],
|