Skip to content

Commit 7b4e20a

Browse files
luoxuanzaoQoder-AI
andauthored
chore: surface underlying errors when session history fails to load (#26)
* chore: surface underlying errors when session history fails to load The restore report only counted failed session files, discarding the underlying readSDKSession error, so user feedback could not reveal the root cause. Append each failing session id and its error to the reported detail. Co-authored-by: QoderAI (Qwen 3.8 Max) <qoder_ai@qoder.com> * docs: note the underlying file error in the restore diagnostics changelog entry Co-authored-by: QoderAI (Qwen 3.8 Max) <qoder_ai@qoder.com> --------- Co-authored-by: QoderAI (Qwen 3.8 Max) <qoder_ai@qoder.com>
1 parent 048de12 commit 7b4e20a

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ version with its date and start a fresh empty `[Unreleased]` above it.
5555
- Startup session restore no longer fails silently: when the tab
5656
layout, an individual tab, session metadata, or conversation history
5757
cannot be read, Qoderian now shows a single notice with the issue
58-
count and logs per-stage details to the developer console.
58+
count and logs per-stage details to the developer console, including
59+
the underlying file error (such as a permission denial) for each
60+
session history file that fails to load.
5961

6062
## [1.0.4] - 2026-08-12
6163

src/qoder/history/qoder-conversation-history-service.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ export class QoderConversationHistoryService {
385385
let missingSessionCount = 0;
386386
let errorCount = 0;
387387
let successCount = 0;
388+
const loadErrors: string[] = [];
388389

389390
const currentSessionId = isPendingFork
390391
? state.forkSource!.sessionId
@@ -404,6 +405,7 @@ export class QoderConversationHistoryService {
404405

405406
if (result.error) {
406407
errorCount++;
408+
loadErrors.push(`${sessionId}: ${result.error}`);
407409
continue;
408410
}
409411

@@ -415,7 +417,8 @@ export class QoderConversationHistoryService {
415417
if (errorCount > 0) {
416418
reportRestoreIssue(
417419
'history',
418-
`Conversation "${conversation.id}": ${errorCount} of ${allSessionIds.length} session file(s) failed to load.`,
420+
`Conversation "${conversation.id}": ${errorCount} of ${allSessionIds.length} session file(s) failed to load. `
421+
+ `Errors: ${loadErrors.join('; ')}`,
419422
);
420423
} else if (allSessionsMissing) {
421424
reportRestoreIssue(

tests/unit/qoder/history/qoder-conversation-history-service.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ describe('QoderConversationHistoryService restore diagnostics', () => {
9393
stage: 'history',
9494
detail: expect.stringContaining('conv-1'),
9595
});
96+
// The underlying error and session id must surface for diagnostics.
97+
expect(issues[0].detail).toContain('sess-1: read failed');
9698
});
9799

98100
it('reports a history issue when session files are missing on disk', async () => {

0 commit comments

Comments
 (0)