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: split overly long lines to keep embeddings under token limits.
|
||||
- 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
|
||||
|
||||
|
||||
@@ -202,6 +202,7 @@ describe("gateway server sessions", () => {
|
||||
verboseLevel?: string;
|
||||
sendPolicy?: string;
|
||||
label?: string;
|
||||
displayName?: string;
|
||||
}>;
|
||||
}>(ws, "sessions.list", {});
|
||||
expect(list2.ok).toBe(true);
|
||||
@@ -211,6 +212,7 @@ describe("gateway server sessions", () => {
|
||||
expect(main2?.sendPolicy).toBe("deny");
|
||||
const subagent = list2.payload?.sessions.find((s) => s.key === "agent:main:subagent:one");
|
||||
expect(subagent?.label).toBe("Briefing");
|
||||
expect(subagent?.displayName).toBe("Briefing");
|
||||
|
||||
const clearedVerbose = await rpcReq<{ ok: true; key: string }>(ws, "sessions.patch", {
|
||||
key: "agent:main:main",
|
||||
|
||||
@@ -392,7 +392,8 @@ export function listSessionsFromStore(params: {
|
||||
id,
|
||||
key,
|
||||
})
|
||||
: undefined);
|
||||
: undefined) ??
|
||||
entry?.label;
|
||||
const deliveryFields = normalizeSessionDeliveryFields(entry);
|
||||
return {
|
||||
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?: {
|
||||
reason?: string;
|
||||
force?: boolean;
|
||||
progress?: (update: MemorySyncProgressUpdate) => void;
|
||||
}) {
|
||||
const progress: MemorySyncProgressState | null = params?.progress
|
||||
? {
|
||||
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 progress = params?.progress ? this.createSyncProgress(params.progress) : null;
|
||||
const vectorReady = await this.ensureVectorReady();
|
||||
const meta = this.readMeta();
|
||||
const needsFullReindex =
|
||||
|
||||
Reference in New Issue
Block a user