Skip to content

Commit 143e593

Browse files
Compaction Runner: wire post-compaction memory sync (#25561)
Merged via squash. Prepared head SHA: 6d2bc02 Co-authored-by: rodrigouroz <[email protected]> Co-authored-by: jalehman <[email protected]> Reviewed-by: @jalehman
1 parent fd568c4 commit 143e593

File tree

19 files changed

+973
-47
lines changed

19 files changed

+973
-47
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Docs: https://docs.openclaw.ai
5555
- Gateway/session stores: regenerate the Swift push-test protocol models and align Windows native session-store realpath handling so protocol checks and sync session discovery stop drifting on Windows. (#44266) thanks @jalehman.
5656
- Context engine/session routing: forward optional `sessionKey` through context-engine lifecycle calls so plugins can see structured routing metadata during bootstrap, assembly, post-turn ingestion, and compaction. (#44157) thanks @jalehman.
5757
- Agents/failover: classify z.ai `network_error` stop reasons as retryable timeouts so provider connectivity failures trigger fallback instead of surfacing raw unhandled-stop-reason errors. (#43884) Thanks @hougangdev.
58+
- Memory/session sync: add mode-aware post-compaction session reindexing with `agents.defaults.compaction.postIndexSync` plus `agents.defaults.memorySearch.sync.sessions.postCompactionForce`, so compacted session memory can refresh immediately without forcing every deployment into synchronous reindexing. (#25561) thanks @rodrigouroz.
5859

5960
## 2026.3.11
6061

apps/macos/Sources/OpenClawProtocol/GatewayModels.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,6 @@ public struct PushTestResult: Codable, Sendable {
11061106
public let tokensuffix: String
11071107
public let topic: String
11081108
public let environment: String
1109-
public let transport: String
11101109

11111110
public init(
11121111
ok: Bool,
@@ -1115,8 +1114,7 @@ public struct PushTestResult: Codable, Sendable {
11151114
reason: String?,
11161115
tokensuffix: String,
11171116
topic: String,
1118-
environment: String,
1119-
transport: String)
1117+
environment: String)
11201118
{
11211119
self.ok = ok
11221120
self.status = status
@@ -1125,7 +1123,6 @@ public struct PushTestResult: Codable, Sendable {
11251123
self.tokensuffix = tokensuffix
11261124
self.topic = topic
11271125
self.environment = environment
1128-
self.transport = transport
11291126
}
11301127

11311128
private enum CodingKeys: String, CodingKey {
@@ -1136,7 +1133,6 @@ public struct PushTestResult: Codable, Sendable {
11361133
case tokensuffix = "tokenSuffix"
11371134
case topic
11381135
case environment
1139-
case transport
11401136
}
11411137
}
11421138

apps/shared/OpenClawKit/Sources/OpenClawProtocol/GatewayModels.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,6 @@ public struct PushTestResult: Codable, Sendable {
11061106
public let tokensuffix: String
11071107
public let topic: String
11081108
public let environment: String
1109-
public let transport: String
11101109

11111110
public init(
11121111
ok: Bool,
@@ -1115,8 +1114,7 @@ public struct PushTestResult: Codable, Sendable {
11151114
reason: String?,
11161115
tokensuffix: String,
11171116
topic: String,
1118-
environment: String,
1119-
transport: String)
1117+
environment: String)
11201118
{
11211119
self.ok = ok
11221120
self.status = status
@@ -1125,7 +1123,6 @@ public struct PushTestResult: Codable, Sendable {
11251123
self.tokensuffix = tokensuffix
11261124
self.topic = topic
11271125
self.environment = environment
1128-
self.transport = transport
11291126
}
11301127

11311128
private enum CodingKeys: String, CodingKey {
@@ -1136,7 +1133,6 @@ public struct PushTestResult: Codable, Sendable {
11361133
case tokensuffix = "tokenSuffix"
11371134
case topic
11381135
case environment
1139-
case transport
11401136
}
11411137
}
11421138

src/agents/memory-search.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ describe("memory search config", () => {
284284
expect(resolved?.sync.sessions).toEqual({
285285
deltaBytes: 100000,
286286
deltaMessages: 50,
287+
postCompactionForce: true,
287288
});
288289
});
289290

src/agents/memory-search.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export type ResolvedMemorySearchConfig = {
6161
sessions: {
6262
deltaBytes: number;
6363
deltaMessages: number;
64+
postCompactionForce: boolean;
6465
};
6566
};
6667
query: {
@@ -248,6 +249,10 @@ function mergeConfig(
248249
overrides?.sync?.sessions?.deltaMessages ??
249250
defaults?.sync?.sessions?.deltaMessages ??
250251
DEFAULT_SESSION_DELTA_MESSAGES,
252+
postCompactionForce:
253+
overrides?.sync?.sessions?.postCompactionForce ??
254+
defaults?.sync?.sessions?.postCompactionForce ??
255+
true,
251256
},
252257
};
253258
const query = {
@@ -315,6 +320,7 @@ function mergeConfig(
315320
);
316321
const deltaBytes = clampInt(sync.sessions.deltaBytes, 0, Number.MAX_SAFE_INTEGER);
317322
const deltaMessages = clampInt(sync.sessions.deltaMessages, 0, Number.MAX_SAFE_INTEGER);
323+
const postCompactionForce = sync.sessions.postCompactionForce;
318324
return {
319325
enabled,
320326
sources,
@@ -336,6 +342,7 @@ function mergeConfig(
336342
sessions: {
337343
deltaBytes,
338344
deltaMessages,
345+
postCompactionForce,
339346
},
340347
},
341348
query: {

0 commit comments

Comments
 (0)