@hyperspell/openclaw-hyperspell 0.22.0 → 0.23.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/dist/hooks/hot-buffer.js
CHANGED
|
@@ -2,6 +2,7 @@ import fs from "node:fs";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { getWorkspaceDir } from "../config.js";
|
|
4
4
|
import { channelIdFromCtx } from "../lib/exclude-channels.js";
|
|
5
|
+
import { HOT_BUFFER_SOURCE } from "../lib/filters.js";
|
|
5
6
|
import { resolveUser } from "../lib/sender.js";
|
|
6
7
|
import { cleanupSpeakerSession, isMultiSpeaker, recordSender, senderIdFromCtx, } from "../lib/speaker-tracker.js";
|
|
7
8
|
import { log } from "../logger.js";
|
|
@@ -237,7 +238,7 @@ export function buildHotBufferHandler(client, cfg, opts) {
|
|
|
237
238
|
// would have blocked.
|
|
238
239
|
const channelId = channelIdFromCtx(ctx);
|
|
239
240
|
const metadata = {
|
|
240
|
-
openclaw_source:
|
|
241
|
+
openclaw_source: HOT_BUFFER_SOURCE,
|
|
241
242
|
openclaw_session_id: sessionId,
|
|
242
243
|
...(channelId ? { openclaw_channel_id: channelId } : {}),
|
|
243
244
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { excludeFilterFor } from "../lib/filters.js";
|
|
1
|
+
import { excludeFilterFor, HOT_BUFFER_SOURCE } from "../lib/filters.js";
|
|
2
2
|
import { resolveUser } from "../lib/sender.js";
|
|
3
3
|
import { resolveCurrentSessionId } from "../lib/session.js";
|
|
4
4
|
import { isMultiSpeaker } from "../lib/speaker-tracker.js";
|
|
@@ -144,13 +144,16 @@ async function fetchRecentTraces(client, cutoff, limit, userId) {
|
|
|
144
144
|
* modern source of "recent interactions" (the agent_end-trace path only works
|
|
145
145
|
* when auto-trace is on, which it usually isn't). The hot buffer writes one
|
|
146
146
|
* session-grouped Resource per conversation: `resource_id` = the session id (a
|
|
147
|
-
* UUID),
|
|
148
|
-
* `listMemories` returning resources newest-first (verified live) and take
|
|
149
|
-
* newest `limit` conversation resources — their metadata carries no date to
|
|
147
|
+
* UUID), tagged `openclaw_source: "hot_buffer"`, with a generated title. We rely
|
|
148
|
+
* on `listMemories` returning resources newest-first (verified live) and take
|
|
149
|
+
* the newest `limit` conversation resources — their metadata carries no date to
|
|
150
150
|
* filter on, so order is our recency signal.
|
|
151
151
|
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
152
|
+
* Selects ON the hot-buffer tag. This used to skip any row carrying an
|
|
153
|
+
* `openclaw_source` at all, which was correct only while hot rows were untagged;
|
|
154
|
+
* backend #1921 (2026-07-02) started tagging them, so that exclusion began
|
|
155
|
+
* dropping every row it was meant to keep and the block silently vanished.
|
|
156
|
+
* Sibling rows (memory_sync_section / command / agent_end) fail the same check.
|
|
154
157
|
*/
|
|
155
158
|
async function fetchRecentConversations(client, limit, userId) {
|
|
156
159
|
const out = [];
|
|
@@ -166,7 +169,7 @@ async function fetchRecentConversations(client, limit, userId) {
|
|
|
166
169
|
break;
|
|
167
170
|
if (!UUID_RE.test(memory.resourceId))
|
|
168
171
|
continue;
|
|
169
|
-
if (memory.metadata?.openclaw_source)
|
|
172
|
+
if (memory.metadata?.openclaw_source !== HOT_BUFFER_SOURCE)
|
|
170
173
|
continue;
|
|
171
174
|
const title = memory.title ?? "";
|
|
172
175
|
if (title.length === 0 || /^\[cron:/i.test(title))
|
package/dist/lib/filters.js
CHANGED
|
@@ -10,6 +10,13 @@
|
|
|
10
10
|
export const AGENT_END_SOURCE = "agent_end";
|
|
11
11
|
/** Metadata tag on mood-weather roll records (see `recordMoodRoll` in hooks/mood-weather.ts). */
|
|
12
12
|
export const MOOD_WEATHER_SOURCE = "mood_weather";
|
|
13
|
+
/**
|
|
14
|
+
* Metadata tag on hot-buffer conversation rows (written by hooks/hot-buffer.ts).
|
|
15
|
+
* Readers must select ON this value, never "any tag means not mine" — hot rows
|
|
16
|
+
* were untagged before backend #1921 (2026-07-02) and consumers written against
|
|
17
|
+
* that shape silently match nothing now.
|
|
18
|
+
*/
|
|
19
|
+
export const HOT_BUFFER_SOURCE = "hot_buffer";
|
|
13
20
|
/**
|
|
14
21
|
* Memories produced by the auto-trace session-end hook are tagged in metadata
|
|
15
22
|
* as `openclaw_source: "agent_end"` (see `sendTrace` in client.ts). Those should
|
package/openclaw.plugin.json
CHANGED