fix: sessions list label fallback
Co-authored-by: abdaraxus <abdaraxus@users.noreply.github.com>
This commit is contained in:
@@ -11,6 +11,7 @@ Docs: https://docs.clawd.bot
|
|||||||
- Memory: parallelize embedding indexing with rate-limit retries.
|
- Memory: parallelize embedding indexing with rate-limit retries.
|
||||||
- Memory: split overly long lines to keep embeddings under token limits.
|
- Memory: split overly long lines to keep embeddings under token limits.
|
||||||
- Memory: skip empty chunks to avoid invalid embedding inputs.
|
- Memory: skip empty chunks to avoid invalid embedding inputs.
|
||||||
|
- Sessions: fall back to session labels when listing display names. (#1124) — thanks @abdaraxus.
|
||||||
|
|
||||||
## 2026.1.17-1
|
## 2026.1.17-1
|
||||||
|
|
||||||
|
|||||||
@@ -202,6 +202,7 @@ describe("gateway server sessions", () => {
|
|||||||
verboseLevel?: string;
|
verboseLevel?: string;
|
||||||
sendPolicy?: string;
|
sendPolicy?: string;
|
||||||
label?: string;
|
label?: string;
|
||||||
|
displayName?: string;
|
||||||
}>;
|
}>;
|
||||||
}>(ws, "sessions.list", {});
|
}>(ws, "sessions.list", {});
|
||||||
expect(list2.ok).toBe(true);
|
expect(list2.ok).toBe(true);
|
||||||
@@ -211,6 +212,7 @@ describe("gateway server sessions", () => {
|
|||||||
expect(main2?.sendPolicy).toBe("deny");
|
expect(main2?.sendPolicy).toBe("deny");
|
||||||
const subagent = list2.payload?.sessions.find((s) => s.key === "agent:main:subagent:one");
|
const subagent = list2.payload?.sessions.find((s) => s.key === "agent:main:subagent:one");
|
||||||
expect(subagent?.label).toBe("Briefing");
|
expect(subagent?.label).toBe("Briefing");
|
||||||
|
expect(subagent?.displayName).toBe("Briefing");
|
||||||
|
|
||||||
const clearedVerbose = await rpcReq<{ ok: true; key: string }>(ws, "sessions.patch", {
|
const clearedVerbose = await rpcReq<{ ok: true; key: string }>(ws, "sessions.patch", {
|
||||||
key: "agent:main:main",
|
key: "agent:main:main",
|
||||||
|
|||||||
@@ -392,7 +392,8 @@ export function listSessionsFromStore(params: {
|
|||||||
id,
|
id,
|
||||||
key,
|
key,
|
||||||
})
|
})
|
||||||
: undefined);
|
: undefined) ??
|
||||||
|
entry?.label;
|
||||||
const deliveryFields = normalizeSessionDeliveryFields(entry);
|
const deliveryFields = normalizeSessionDeliveryFields(entry);
|
||||||
return {
|
return {
|
||||||
key,
|
key,
|
||||||
|
|||||||
@@ -800,31 +800,35 @@ export class MemoryIndexManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private createSyncProgress(
|
||||||
|
onProgress: (update: MemorySyncProgressUpdate) => void,
|
||||||
|
): MemorySyncProgressState {
|
||||||
|
const state: MemorySyncProgressState = {
|
||||||
|
completed: 0,
|
||||||
|
total: 0,
|
||||||
|
label: undefined,
|
||||||
|
report: (update) => {
|
||||||
|
if (update.label) state.label = update.label;
|
||||||
|
const label =
|
||||||
|
update.total > 0 && state.label
|
||||||
|
? `${state.label} ${update.completed}/${update.total}`
|
||||||
|
: state.label;
|
||||||
|
onProgress({
|
||||||
|
completed: update.completed,
|
||||||
|
total: update.total,
|
||||||
|
label,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
};
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
private async runSync(params?: {
|
private async runSync(params?: {
|
||||||
reason?: string;
|
reason?: string;
|
||||||
force?: boolean;
|
force?: boolean;
|
||||||
progress?: (update: MemorySyncProgressUpdate) => void;
|
progress?: (update: MemorySyncProgressUpdate) => void;
|
||||||
}) {
|
}) {
|
||||||
const progress: MemorySyncProgressState | null = params?.progress
|
const progress = params?.progress ? this.createSyncProgress(params.progress) : null;
|
||||||
? {
|
|
||||||
completed: 0,
|
|
||||||
total: 0,
|
|
||||||
label: undefined,
|
|
||||||
report: (update) => {
|
|
||||||
if (!params.progress) return;
|
|
||||||
if (update.label) progress.label = update.label;
|
|
||||||
const label =
|
|
||||||
update.total > 0 && progress.label
|
|
||||||
? `${progress.label} ${update.completed}/${update.total}`
|
|
||||||
: progress.label;
|
|
||||||
params.progress({
|
|
||||||
completed: update.completed,
|
|
||||||
total: update.total,
|
|
||||||
label,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
}
|
|
||||||
: null;
|
|
||||||
const vectorReady = await this.ensureVectorReady();
|
const vectorReady = await this.ensureVectorReady();
|
||||||
const meta = this.readMeta();
|
const meta = this.readMeta();
|
||||||
const needsFullReindex =
|
const needsFullReindex =
|
||||||
|
|||||||
Reference in New Issue
Block a user