Skip to content

Commit 7600969

Browse files
author
StackMemory Bot (CLI)
committed
fix(digest): fallback to 'default' project_id when no frames match
Frames created by older versions or MCP sessions use project_id='default' while the CLI derives it from git remote URL. Fall back to querying 'default' when the derived ID returns no results.
1 parent c5f6ab0 commit 7600969

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

src/core/digest/chronological-digest.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ export function generateChronologicalDigest(
8383
): string {
8484
const { start, end, label } = getTimeRange(period);
8585

86-
// Query frames in the time window
87-
const frames = db
86+
// Query frames in the time window — try exact project_id, fallback to 'default', then all
87+
let frames = db
8888
.prepare(
8989
`SELECT frame_id, name, type, state, created_at, closed_at, inputs, outputs
9090
FROM frames
@@ -93,6 +93,17 @@ export function generateChronologicalDigest(
9393
)
9494
.all(projectId, start, end) as FrameRow[];
9595

96+
if (frames.length === 0 && projectId !== 'default') {
97+
frames = db
98+
.prepare(
99+
`SELECT frame_id, name, type, state, created_at, closed_at, inputs, outputs
100+
FROM frames
101+
WHERE project_id = 'default' AND created_at >= ? AND created_at < ?
102+
ORDER BY created_at ASC`
103+
)
104+
.all(start, end) as FrameRow[];
105+
}
106+
96107
if (frames.length === 0) {
97108
return `# ${label}\n\nNo activity recorded.\n`;
98109
}

0 commit comments

Comments
 (0)