@openviking/openclaw-plugin 2026.9.10-1 → 2026.9.11
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/client.ts
CHANGED
|
@@ -80,6 +80,7 @@ export type CommitSessionResult = {
|
|
|
80
80
|
task_id?: string;
|
|
81
81
|
archive_uri?: string;
|
|
82
82
|
archived?: boolean;
|
|
83
|
+
reset_context?: boolean;
|
|
83
84
|
/** Present when wait=true and extraction completed. Keyed by category. */
|
|
84
85
|
memories_extracted?: Record<string, number>;
|
|
85
86
|
error?: string;
|
|
@@ -845,6 +846,8 @@ export class OpenVikingClient {
|
|
|
845
846
|
* preserves the pre-v2 "archive everything" behavior.
|
|
846
847
|
*/
|
|
847
848
|
keepRecentCount?: number;
|
|
849
|
+
/** Start empty context in the same session after archiving. */
|
|
850
|
+
resetContext?: boolean;
|
|
848
851
|
agentId?: string;
|
|
849
852
|
},
|
|
850
853
|
): Promise<CommitSessionResult> {
|
|
@@ -866,6 +869,9 @@ export class OpenVikingClient {
|
|
|
866
869
|
if (keepRecentCount > 0) {
|
|
867
870
|
body.keep_recent_count = keepRecentCount;
|
|
868
871
|
}
|
|
872
|
+
if (options?.resetContext) {
|
|
873
|
+
body.reset_context = true;
|
|
874
|
+
}
|
|
869
875
|
const result = await this.request<CommitSessionResult>(
|
|
870
876
|
`/api/v1/sessions/${encodeURIComponent(sessionId)}/commit`,
|
|
871
877
|
{ method: "POST", body: JSON.stringify(body) },
|
|
@@ -873,6 +879,10 @@ export class OpenVikingClient {
|
|
|
873
879
|
options?.agentId,
|
|
874
880
|
);
|
|
875
881
|
|
|
882
|
+
if (options?.resetContext && result.reset_context !== true) {
|
|
883
|
+
throw new Error("OpenViking server did not confirm reset_context; upgrade the server with the plugin.");
|
|
884
|
+
}
|
|
885
|
+
|
|
876
886
|
if (!options?.wait || !result.task_id) {
|
|
877
887
|
return result;
|
|
878
888
|
}
|
package/dist/client.js
CHANGED
|
@@ -415,7 +415,13 @@ export class OpenVikingClient {
|
|
|
415
415
|
if (keepRecentCount > 0) {
|
|
416
416
|
body.keep_recent_count = keepRecentCount;
|
|
417
417
|
}
|
|
418
|
+
if (options?.resetContext) {
|
|
419
|
+
body.reset_context = true;
|
|
420
|
+
}
|
|
418
421
|
const result = await this.request(`/api/v1/sessions/${encodeURIComponent(sessionId)}/commit`, { method: "POST", body: JSON.stringify(body) }, undefined, options?.agentId);
|
|
422
|
+
if (options?.resetContext && result.reset_context !== true) {
|
|
423
|
+
throw new Error("OpenViking server did not confirm reset_context; upgrade the server with the plugin.");
|
|
424
|
+
}
|
|
419
425
|
if (!options?.wait || !result.task_id) {
|
|
420
426
|
return result;
|
|
421
427
|
}
|
|
@@ -157,6 +157,7 @@ export async function commitOpenVikingSession({ sessionId, sessionKey, getClient
|
|
|
157
157
|
const commitResult = await client.commitSession(ovId, {
|
|
158
158
|
wait: true,
|
|
159
159
|
keepRecentCount: 0,
|
|
160
|
+
resetContext: true,
|
|
160
161
|
});
|
|
161
162
|
const memCount = totalExtractedMemories(commitResult.memories_extracted);
|
|
162
163
|
if (commitResult.status === "failed") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openviking/openclaw-plugin",
|
|
3
|
-
"version": "2026.9.
|
|
3
|
+
"version": "2026.9.11",
|
|
4
4
|
"displayName": "OpenViking",
|
|
5
5
|
"description": "OpenClaw context-engine plugin — OpenViking AI memory, long-term memory, knowledge base, semantic search, RAG, context engine. 长期记忆 · 知识库 · 语义检索 · 上下文引擎",
|
|
6
6
|
"type": "module",
|
|
@@ -370,6 +370,7 @@ export async function commitOpenVikingSession({
|
|
|
370
370
|
const commitResult = await client.commitSession(ovId, {
|
|
371
371
|
wait: true,
|
|
372
372
|
keepRecentCount: 0,
|
|
373
|
+
resetContext: true,
|
|
373
374
|
});
|
|
374
375
|
const memCount = totalExtractedMemories(commitResult.memories_extracted);
|
|
375
376
|
if (commitResult.status === "failed") {
|