Skip to content

fix(history): retain unreadable transcript errors - #37628

Merged
AmoabaKelvin merged 2 commits into
mainfrom
retain-history-read-errors
Nov 3, 2026
Merged

AmoabaKelvin merged 2 commits into
mainfrom
retain-history-read-errors

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​143 $\color{#cf222e}{\Huge{\mathbf{−}}}$​22 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​121
Prod 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​76 $\color{#cf222e}{\Huge{\mathbf{−}}}$​15 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​61

ELI5

Session History keeps telling you when a chat cannot be read, even after restarting Orca. Once readable messages return, the error disappears.

What Changed

Kiro now forwards the transcript reader's skipped-record evidence. The shared parse cache retains that evidence with each result and persists it independently of live parser state. Existing content classification still keeps recovered conversations warning-free.

Why

Kiro discarded skip facts immediately, and SQLite rows discarded them for every parser. An unchanged cached empty row therefore looked like a successful read after restart. Schema 9 rebuilds version 8 rows once because they cannot distinguish an empty transcript from discarded diagnostics; later unchanged hits still read zero transcript bytes.

Linked Issue

Visual Proof

N/A: scanner and cache retention only; the existing error component, copy, and interactions are unchanged. The behavioral before/after is reproduced with real over-budget records and SQLite below.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

On macOS, the new Claude restart, Kiro first-scan, and version 8 upgrade cases each failed against the original production code for the expected missing-error assertion. All 36 tests in the budget, persistence, and Kiro parser suites pass with the fix.

The lifecycle regression flushes SQLite and resets both cache owners, proves an unchanged restored hit reads zero transcript bytes, appends recovered conversation content, and replaces unreadable transcripts with empty files. Recovery and replacement stay warning-free across another restart. The upgrade regression uses the actual version 8 table shape and proves one cold reconstruction followed by reuse.

Changed-file oxlint/oxfmt, diff whitespace, changed-code quality, and React Doctor changed gates passed. The explicit dependent inventory passed 49 files and 430 tests. The default check:changed selection passed 20 checks and found a nullable-size type error in the new SQLite fixture; its unit selection was stopped after 235.7 seconds when it expanded into unrelated ACP scaling tests. The fixture was corrected. Final check:changed --base=HEAD~1 --maxWorkers=2 passed all 21 checks after rebase, including the selected node/web/CLI typechecks and unit tests. This is incremental evidence for the fixture correction; CI covers the broader related selection. CI covers broad platform checks; no full local suite, standalone full typecheck, packaging build, or visible app launch was run.

Risk

Level: Low

The saved-cache schema changes, so the first scan after upgrade reconstructs cached rows from source transcripts. If retention regresses, unreadable chats could lose their existing error or keep a stale error after repair. Tests cover both directions, Kiro transcript-only changes, and unchanged reuse. No transcript data, wire format, UI, or mobile code changes. A revert rebuilds the derived cache again.

AI Disclosure

Review

Exactly two independent Codex/Claude rounds completed. Round 1 was pinned to the dirty implementation at aaf4a5d: Codex had no findings; Claude raised one P3 redundant internal test assertion, which was removed. Round 2 was pinned to clean 8591f5b5690: both reviewers returned NO FINDINGS after tracing persistence, recovery, sibling readers, host routes, and test value. No accepted or refuted P0/P1/P2 findings remain.

The later fixture correction changes only the optional byte-size argument to SQLite's supported null value; no production code or behavioral assertion changed after round 2. The rebase onto 534ecb7 was conflict-free. Review artifacts and the test audit are retained outside the repository.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

The execution host owns these results for local, WSL/SSH, paired, and mobile callers, so no client protocol change is needed. Paths use existing platform-neutral wrappers. Scope discovery, #37372, and paused history-scope-first-scan work are outside this change.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

The change captures skipped transcript records during whole-transcript parsing and stores them in session parse-cache entries. Schema version 9 adds a skipped_records column and validates records when reading persisted rows. Cache diagnostics remain available independently of resume state. Tests cover cache reuse across restarts and issue changes after transcript recovery or replacement.

Merge Risk: Minimal · up to f881a

No actionable merge-blocking risk was identified in the cache diagnostic changes.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: preserving unreadable transcript errors across history and cache operations.
Description check Passed The description is complete and directly matches the changes. It includes the user impact, implementation details, linked issues, visual proof status, testing results and limits, risk, review notes, c…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description is complete and directly matches the changes. It includes the user impact, implementation details, linked issues, visual proof status, testing results and limits, risk, review notes, compatibility considerations, and checklist status.

Full details: Docstring Coverage

Explanation

Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 7 functions across 8 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ast-grep (0.51.1)

ast-grep could not parse rule config: /ast-grep-rules/ast-grep-essentials/rules/swift/security/weak-cipher-des-cccrypt-swift.yml

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 24296b6f-c007-474a-9a24-6e47fb7509a2
Commits

Reviewing files that changed from the base of the PR and between 534ecb7 and f881adb.

Files selected for processing: 8
  • src/main/ai-vault/session-parse-cache-database.ts
  • src/main/ai-vault/session-parse-cache-persistence.test.ts
  • src/main/ai-vault/session-parse-cache-store.ts
  • src/main/ai-vault/session-scanner-agent-parser.ts
  • src/main/ai-vault/session-scanner-kiro-parser.ts
  • src/main/ai-vault/session-scanner-parse-cache.ts
  • src/main/ai-vault/session-scanner-record-budget.test.ts
  • src/main/ai-vault/session-transcript-reader.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@AmoabaKelvin
AmoabaKelvin merged commit 8eb1d14 into main Nov 3, 2026
47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant