@elvatis_com/openclaw-cli-bridge-elvatis 1.8.4 → 1.8.5
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/package.json +1 -1
- package/src/proxy-server.ts +5 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elvatis_com/openclaw-cli-bridge-elvatis",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.5",
|
|
4
4
|
"description": "Bridges gemini, claude, and codex CLI tools as OpenClaw model providers. Reads existing CLI auth without re-login.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"openclaw": {
|
package/src/proxy-server.ts
CHANGED
|
@@ -578,15 +578,17 @@ async function handleRequest(
|
|
|
578
578
|
// BitNet has a 4096 token context window. Long sessions blow it up and
|
|
579
579
|
// cause a hard C++ crash (no graceful error). Truncate to system prompt +
|
|
580
580
|
// last 10 messages (~2k tokens max) to stay safely within the limit.
|
|
581
|
-
const BITNET_MAX_MESSAGES =
|
|
581
|
+
const BITNET_MAX_MESSAGES = 6;
|
|
582
|
+
// Replace the full system prompt (MEMORY.md etc, ~2k+ tokens) with a
|
|
583
|
+
// minimal one so BitNet's 4096-token context isn't blown by the system msg alone.
|
|
584
|
+
const BITNET_SYSTEM = "You are Akido, a concise AI assistant. Answer briefly and directly. Current user: Emre. Timezone: Europe/Berlin.";
|
|
582
585
|
const allFlat = parsed.messages.map((m) => ({
|
|
583
586
|
role: m.role,
|
|
584
587
|
content: flattenContent(m.content),
|
|
585
588
|
}));
|
|
586
|
-
const systemMsgs = allFlat.filter((m) => m.role === "system");
|
|
587
589
|
const nonSystemMsgs = allFlat.filter((m) => m.role !== "system");
|
|
588
590
|
const truncated = nonSystemMsgs.slice(-BITNET_MAX_MESSAGES);
|
|
589
|
-
const bitnetMessages = [
|
|
591
|
+
const bitnetMessages = [{ role: "system", content: BITNET_SYSTEM }, ...truncated];
|
|
590
592
|
const requestBody = JSON.stringify({ ...parsed, messages: bitnetMessages, tools: undefined });
|
|
591
593
|
|
|
592
594
|
try {
|