Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
0f78b5e
Add OpenClaw-owned semantic enrichment pipeline
Apr 15, 2026
657f22e
Harden semantic enrichment follow-up
Apr 15, 2026
28c3f78
Add generic local-agent wake hook for semantic enrichment
Apr 15, 2026
022b139
Compact ontology guidance for semantic enrichment
Apr 15, 2026
a04a596
Harden semantic enrichment review follow-ups
Apr 15, 2026
fe60ae5
Address remaining PR #192 review findings
Apr 15, 2026
798ab54
Preserve semantic events during OpenClaw outages
Apr 15, 2026
cbfa409
Harden semantic wake acknowledgement and drain retries
Apr 15, 2026
630d31d
Require relevance for project ontology guidance
Apr 15, 2026
8b49a17
Harden semantic queue gating and status recovery
Apr 15, 2026
54c147e
Fix semantic review edge cases
Apr 15, 2026
25a7bdd
Tighten semantic queue gating and stale import checks
Apr 15, 2026
836491c
Fix semantic worker exact-graph query routing
Apr 15, 2026
51d01ee
Fix exact-graph query scoping and semantic count reuse
Apr 15, 2026
1d28cff
Merge origin/v10-rc and reconcile semantic enrichment identity flow
Apr 16, 2026
cd68f1f
Fix post-merge PR review regressions
Apr 16, 2026
9dcb2df
Harden semantic enrichment review fixes
Apr 16, 2026
878fef7
Tighten semantic enrichment compatibility checks
Apr 16, 2026
6c89836
Harden semantic event invalidation
Apr 16, 2026
e8b101e
Fix semantic review follow-up edge cases
Apr 16, 2026
7186ea9
Tighten semantic integration queueing
Apr 16, 2026
54409a9
Harden semantic startup queueing
Apr 16, 2026
e999819
Tighten semantic wake queue gating
Apr 16, 2026
26351b6
Fix stale discard route test
Apr 16, 2026
943fc9d
Fix v10-rc test drift after review rounds
Apr 16, 2026
a437c1a
Harden semantic wake and dead-letter review fixes
Apr 16, 2026
72cb342
Fix semantic lease-loss and reconcile review findings
Apr 16, 2026
90ef5a8
Clarify ontologyRef override hint contract
Apr 16, 2026
a4317a0
Merge remote-tracking branch 'origin/v10-rc' into codex/openclaw-sema…
Apr 16, 2026
f7a6e25
Remove reintroduced V9 migration test assertion
Apr 16, 2026
2dccd54
Fix direct-route semantic enrichment queue fallback
Apr 16, 2026
72cbca3
Harden adapter semantic-enrichment review fixes
Apr 16, 2026
a13b344
Fix semantic restart recovery and wake transport overrides
Apr 16, 2026
7804507
Fix semantic worker startup gating and wake rotation
Apr 16, 2026
4ac6313
Harden semantic worker activation and failed-turn prompts
Apr 16, 2026
2c00d94
Harden semantic wake ack and stale drain recovery
Apr 16, 2026
0849c14
Harden semantic enrichment startup and validation
Apr 16, 2026
275946b
Tighten wake transport reconciliation
Apr 16, 2026
ef227a5
Tighten semantic enrichment review fixes
Apr 16, 2026
fdd6068
Align chat semantic URIs with assertion owner
Apr 16, 2026
7df56b9
Merge origin/v10-rc into codex/openclaw-semantic-enrichment
Apr 20, 2026
4a5dd1e
Chunk long file-import semantic extraction
Apr 21, 2026
828236a
Harden semantic worker route authz
Apr 21, 2026
e80befa
Persist semantic downgrade on worker failure
Apr 21, 2026
8b6a12d
Harden semantic worker review fixes
Apr 21, 2026
5533c68
Merge feat/dkg-memory-integration into semantic enrichment
Apr 27, 2026
b74b161
Merge remote-tracking branch 'origin/feat/dkg-memory-integration' int…
Apr 27, 2026
b6e2601
Merge remote-tracking branch 'origin/feat/dkg-memory-integration' int…
Apr 27, 2026
631ea1f
fix(openclaw): address semantic review regressions
Apr 27, 2026
78df652
Merge remote-tracking branch 'origin/feat/dkg-memory-integration' int…
Apr 27, 2026
b9fb8f6
fix(openclaw): harden semantic worker auth
Apr 27, 2026
c6f8f3e
Merge remote-tracking branch 'origin/feat/dkg-memory-integration' int…
Apr 27, 2026
1448321
Merge remote-tracking branch 'origin/feat/dkg-memory-integration' int…
Apr 27, 2026
9cebb31
Address semantic enrichment review edge cases
Apr 27, 2026
f7086ab
Fix semantic enrichment startup and payload refresh races
Apr 27, 2026
b00b15f
Harden semantic wake URLs and file root payloads
Apr 27, 2026
4f79867
Refine semantic queue startup and refresh semantics
Apr 27, 2026
f369cb7
Align OpenClaw chat turn FIFO pairing
Apr 27, 2026
4080c36
Merge feat/dkg-memory-integration into semantic enrichment
Apr 27, 2026
62c4ab9
Harden semantic wake and append recovery
Apr 27, 2026
4385d92
Fence refreshed semantic payloads
Apr 28, 2026
8c97616
Harden semantic transcript and wake targets
Apr 28, 2026
d93dc1b
Coordinate semantic refresh leases
Apr 28, 2026
5645cfe
Propagate semantic wake context
Apr 28, 2026
f7df4b9
Trust-gate semantic request hints
Apr 28, 2026
740acbc
Constrain semantic wake credentials
Apr 28, 2026
69972d9
Harden semantic worker recovery
Apr 28, 2026
9a77b6b
Stabilize semantic wake context
Apr 28, 2026
95e1ed1
Harden semantic bootstrap reconciliation
Apr 28, 2026
12dd18e
Tighten semantic worker auth and context validation
Apr 28, 2026
8c62e01
Harden semantic event versioning and wake publishing
Apr 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions packages/adapter-openclaw/src/ChatTurnWriter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ interface Logger {
debug?: (...args: unknown[]) => void;
}

function isSemanticEnrichmentSubagentSessionKey(value: unknown): boolean {
return typeof value === "string" && value.includes(":subagent:semantic-enrichment:");
}

export interface ChatTurnMessage {
role: "user" | "assistant" | "system" | "tool";
content: string | Array<{ type: string; text?: string }>;
Expand Down Expand Up @@ -157,6 +161,7 @@ export class ChatTurnWriter {

async onAgentEnd(event: AgentEndContext, ctx?: any): Promise<void> {
try {
if (isSemanticEnrichmentSubagentSessionKey(ctx?.sessionKey ?? (event as any)?.sessionKey)) return;
// B5 — skip dkg-ui channel; DkgChannelPlugin.queueTurnPersistence
// owns UI-channel persistence with richer metadata (correlation IDs,
// attachment refs). Avoids double-persist under different sessionIds.
Expand Down Expand Up @@ -352,6 +357,7 @@ export class ChatTurnWriter {

onMessageReceived(ev: InternalMessageEvent): void {
try {
if (isSemanticEnrichmentSubagentSessionKey(ev.sessionKey)) return;
// B5 — skip dkg-ui channel; DkgChannelPlugin owns UI persistence.
const channelId = (ev as any)?.context?.channelId ?? (ev as any)?.channelId;
if (channelId === "dkg-ui") return;
Expand All @@ -376,6 +382,7 @@ export class ChatTurnWriter {

async onMessageSent(ev: InternalMessageEvent): Promise<void> {
try {
if (isSemanticEnrichmentSubagentSessionKey(ev.sessionKey)) return;
// B5 — skip dkg-ui channel; DkgChannelPlugin owns UI persistence.
// Internal-hook envelope carries channelId on event.context per
// openclaw/src/infra/outbound/deliver.ts.
Expand Down Expand Up @@ -422,6 +429,13 @@ export class ChatTurnWriter {
// be persisted later, they should go through a dedicated path
// that supplies a synthesized user side or a distinct schema.
if (!queue || queue.length === 0) return;
if (queue.length > 1) {
const joinedUserText = queue.join("\n");
if (this.peekTurnIdSeen(sessionId, this.w4aOriginKey(joinedUserText, assistantText))) {
this.pendingUserMessages.delete(conversationKey);
return; // W4a already persisted the coalesced consecutive-user turn.
}
}
const userText = queue.shift()!;
if (queue.length === 0) this.pendingUserMessages.delete(conversationKey);
if (userText || assistantText) {
Expand Down
Loading
Loading