Skip to content

fix(ai-vault): discover and parse Devin sessions on Windows - #21337

Merged
nwparker merged 15 commits into
stablyai:mainfrom
lattenee:fix/devin-ai-vault-windows-sessions
Sep 19, 2026
Merged

nwparker merged 15 commits into
stablyai:mainfrom
lattenee:fix/devin-ai-vault-windows-sessions

Conversation

@lattenee

@lattenee lattenee commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

On Windows, Orca looked for Devin chat history in the wrong folder, so no Devin sessions ever showed up in the AI Vault — and because they were never found, they also couldn't be grouped under a workspace or resumed. Even on macOS/Linux, Devin transcripts written by the current Devin CLI (ATIF-v1.7 format) parsed as nearly empty: no title, no messages, no token counts. This change makes Orca look in the right place on every platform, read the real transcript format, and pull workspace/title details from Devin's own session index.

What Changed

  • Before: on Windows, the AI Vault listed zero Devin sessions. On all platforms, Devin sessions that did appear were missing their titles, message previews, and project grouping.
  • After: Devin sessions are discovered on Windows (%APPDATA%/devin/cli/transcripts), macOS and Linux ($XDG_DATA_HOME or ~/.local/share), and on remote Windows hosts scanned over SSH. Local sessions now carry real titles, message previews, token counts, and group under the correct workspace.
  • Mechanism:
    • session-scanner-agent-sources.ts: Devin transcripts root is now platform-aware (APPDATA on win32, XDG_DATA_HOME elsewhere); DEVIN_HOME override still works.
    • remote-session-scanner-devin-source.ts (new): remote Windows hosts resolve AppData/Roaming/devin/cli/transcripts.
    • session-scanner-service-env.ts: APPDATA joins the scanner child's env allowlist so relocated AppData folders resolve.
    • session-scanner-devin-parser.ts: accepts both the real ATIF-v1.7 step shape (source, timestamp, step-level metrics/model_name, plain-string message) and the legacy metadata.* shape. source: 'system' steps are excluded unconditionally. ATIF prompt_tokens already includes cached tokens, so cached tokens are no longer double-counted.
    • session-scanner-devin-db.ts (new) + session-scanner-sidecar-enrichment.ts: ATIF transcripts carry no working_directory, so the sibling sessions.db index is merged through the existing sidecar seam — filling cwd/title/model/timestamps, honoring Devin's hidden flag, and re-merging when only the db changes without re-reading transcripts. Missing/corrupt dbs degrade to transcript-only listing and retry on the next scan.

Devin 3000.10.31 exports ATIF to agent_logs/devin-<session-id>.json when launched with --export. Discovery now includes this sibling directory on local, WSL and remote hosts, while retaining transcripts for older versions. Both directories use the same session index, joined by the transcript’s session_id, and share the local per-agent discovery limit. Duplicate exports now collapse to one row per execution host, Devin installation, and session ID in local and remote scans. The newest export wins; agent_logs wins ties. The existing scan collection is reused so aliases do not consume the visible-session limit, while Codex identity rules are preserved. Explicit transcript-directory overrides remain isolated. A print-mode run without --export produced no ATIF file in the Windows verification; database-only sessions are outside this transcript scanner’s scope.

Why

The transcripts root hardcoded the XDG layout on every platform, so Windows installs were invisible. The parser read a metadata.* shape that current Devin transcripts don't emit. For workspace mapping, reading sessions.db was the only source of working_directory — the alternative (embedding it in transcripts) isn't ours to change. Using the existing sidecar-enrichment seam avoided a parallel post-parse system and gives dependency-stat invalidation for free.

Scope note: the sessions.db merge is wired into the local scanner only. The legacy SSH filesystem fallback gets transcript discovery/parsing; database enrichment in that fallback remains a follow-up. Hosts running the full scanner use their local database.

Linked Issue

Fixes #21330

Visual Proof

Rendered verification in a hidden macOS Electron build, using a synthetic ATIF-v1.7 transcript plus a SQLite session index. The session appears under its folder workspace with its title, two messages, model, first prompt, and assistant preview. Native Windows scanner checks are recorded below.

Devin session grouped under its workspace

Testing

  • Manually checked the rendered session history in a hidden Electron build through CDP.
  • Automated regressions added for parser, discovery, database enrichment and cache behavior.

Verification through 9cde00651c0:

  • macOS: 1,523 tests pass across the AI Vault suite and OMP resume regressions; the prior 1,475-test run also covered both CI-failing performance suites; all typechecks, the full anti-slop audit, and the changed-code quality gate pass. An earlier fully concurrent run hit an indexer timing assertion; the isolated rerun and the final full run passed.
  • Native Windows (awin, reached through Orca CLI): 202 checks passed in 16 suites on the deduplication revision; 13f2aca92cc additionally passes 18 real-session, deduplication, and OMP integration checks. Coverage includes relocated/missing AppData, real SQLite enrichment, upgrade cache invalidation, contention recovery, remote paths, and large remote transcripts. The authenticated real-session check also passes on this revision.
  • The broader Windows suite is not green: the prior PR head had 29 failures and the pre-PR base had 30, involving existing path assumptions and SQLite numeric-range errors. These are outside the targeted Devin checks.
  • Rendered proof uses a synthetic ATIF-v1.7 transcript and SQLite index in a folder workspace. Separately, authenticated Devin CLI 3000.10.31 generated a real Windows session with --export: the scanner found all four messages, model, 35,559 tokens, assistant previews, and the correct workspace from the real database. The binary was checksum-verified against its official manifest.
  • Final GitHub checks passed (all eight test shards, Linux/Windows packaging, typecheck, static analysis, relay integration, Pi runtime checks, and bot review): https://github.com/stablyai/orca/actions/runs/35437223014. The latest relay test passes locally; both scanner benchmark harnesses completed 40,000 differential correctness comparisons each, timing runs, and the deduplication GC retention checks.

AI Disclosure

Implemented with AI assistance (Devin, Cognition). Approach, code review, and verification by the contributor.

Review

The final benchmark review identified two stale imports after extracting the scan collection. Both harnesses now use the new module and names and run successfully. A relay test now awaits main’s async environment augmenter.

CI’s newer main includes #20634, which intentionally prefers a recorded OMP transcript path when resuming. Two integration tests still expected a session ID; their assertions now follow that contract and preserve the existing ID-fallback checks. No OMP runtime behavior was changed by this PR.

The final bot review found duplicate rows when the same Devin session existed in both export directories. Added local bounded/unlimited and remote Windows/Linux regressions, plus host/install isolation and deterministic winner checks. CI also exposed an outdated terminal-pane count budget from main: tracing measured three keyed readers (activity status, card inputs, sleep state), so the test now budgets those three readers while continuing to reject full-inventory scans.

Current main was merged to validate the integration. CI exposed a false-positive naming error in main’s new browser-markup test: shapes is the drawing compositor’s geometry field. The existing annotator exception now includes that one regression test; no assertion or runtime behavior was changed.

Additional review found and fixed three cache problems: old persisted Devin results needed invalidation after the parser changed; a contended index was retried once per transcript instead of once per scan; and switching between the database and its write-ahead log could reuse cached metadata when their size and modification time matched. Regression tests cover all three, plus relocated and missing platform data-directory variables. A second code review found no blocking issues.

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Cross-platform: local Windows + posix roots covered; remote win32 hosts get the AppData/Roaming layout. DEVIN_HOME and XDG_DATA_HOME overrides preserved.
  • SSH/remote: uses existing joinRemotePath + RemoteHostPlatform; remote sessions currently list transcript-only (see scope note above).
  • Backwards compatibility: legacy metadata.* transcript shape still parses; missing sessions.db lists sessions transcript-only.
  • Performance: db reads cached by database path plus observed sidecar path, mtime and size (LRU 8). Failed reads are remembered only within a scan, so a locked index costs one attempt and the next scan retries.

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)
  • 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)

…workspace mapping

Devin sessions never appeared in the AI Vault on Windows, and parsed
nearly empty elsewhere:

- The transcripts root hardcoded the XDG layout
  (~/.local/share/devin/cli/transcripts), but Devin CLI writes under
  %APPDATA%/devin/cli/transcripts on Windows. The root is now
  platform-aware (APPDATA on win32, XDG_DATA_HOME elsewhere) for both
  local scans and win32 remote hosts, and APPDATA joins the scanner
  child's env allowlist so relocated AppData resolves.
- The parser read metadata.is_user_input / created_at / metrics, which
  real ATIF-v1.7 transcripts don't carry. It now also accepts the ATIF
  step shape (source, timestamp, step-level metrics/model_name,
  plain-string message) while keeping the legacy shape.
- ATIF transcripts carry no working_directory, so sessions couldn't
  group under a workspace. The sibling sessions.db index is now merged
  through the existing sidecar seam: it fills cwd/title/model/
  timestamps, honors the db's hidden flag, and re-merges on db-only
  changes without re-reading transcripts.
@coderabbitai

coderabbitai Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 18d8f27d-de21-49d7-91f9-9b9997372410

📥 Commits

Reviewing files that changed from the base of the PR and between 6187f50 and 9fbc647.

📒 Files selected for processing (1)
  • src/main/ai-vault/session-scanner-devin-parser.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

Devin session discovery now resolves Windows and POSIX transcript roots for local and remote hosts. The parser supports ATIF-v1.7 message, source, timestamp, model, and token fields. The scanner reads sibling sessions.db files, caches indexes, merges metadata, excludes hidden sessions, and re-enriches cached parses. APPDATA is passed to the scanner service, and tests cover platform paths, parsing, database handling, enrichment, and rescans.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 9fbc6

The change preserves platform-specific Devin discovery, transcript parsing, and database enrichment with safe fallback behavior.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 34.48% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 29 functions across 14 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The pull request satisfies the coding requirements in [#21330]. Local discovery uses Windows APPDATA with a home fallback and preserves DEVIN_HOME, devinTranscriptsDir, and POSIX XDG_DATA_HOME…
Out of Scope Changes check ✅ Passed The changed production code and tests support [#21330]. Remote platform path selection, local path resolution, environment propagation, ATIF parsing, database enrichment, parse-cache merging, and WAL …
Title check ✅ Passed The title clearly and concisely describes the main change: fixing Devin session discovery and parsing on Windows.
Description check ✅ Passed The description is complete and follows the repository template. It explains the user impact, implementation, rationale, linked issue, visual proof, testing, AI disclosure, scope, cross-platform behav…
  • Fix all pre-merge checks with AI

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

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 7c3c1ba5-bea0-43f0-9c87-b8c2eac0c4d1

📥 Commits

Reviewing files that changed from the base of the PR and between ad4f26c and 9f14eb5.

📒 Files selected for processing (14)
  • src/main/ai-vault/remote-session-large-transcripts.test.ts
  • src/main/ai-vault/remote-session-scanner-devin-source.ts
  • src/main/ai-vault/remote-session-scanner-sources.test.ts
  • src/main/ai-vault/remote-session-scanner-sources.ts
  • src/main/ai-vault/session-scanner-agent-root-overrides.test.ts
  • src/main/ai-vault/session-scanner-agent-sources.ts
  • src/main/ai-vault/session-scanner-devin-db.test.ts
  • src/main/ai-vault/session-scanner-devin-db.ts
  • src/main/ai-vault/session-scanner-devin-parser.test.ts
  • src/main/ai-vault/session-scanner-devin-parser.ts
  • src/main/ai-vault/session-scanner-parse-cache.ts
  • src/main/ai-vault/session-scanner-service-env.test.ts
  • src/main/ai-vault/session-scanner-service-env.ts
  • src/main/ai-vault/session-scanner-sidecar-enrichment.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

This PR does not build. session-scanner-agent-sources.ts imports resolveDevinTranscriptsDir from ../devin/devin-cli-data-dir, a module that is not in this PR and does not exist on main. pnpm run typecheck:node fails with TS2307, and session-scanner-devin-db.test.ts fails to load, so the entire Devin discovery/enrichment path is currently unreachable.

Reviewed changes

  • Platform-aware Devin transcripts root — local resolution moves behind resolveDevinTranscriptsDir() (%APPDATA% on win32, XDG/~/.local/share elsewhere) with DEVIN_HOME preserved, and APPDATA joins the scanner child env allowlist so a relocated AppData resolves.
  • Remote Devin source — new remoteDevinSource gives remote win32 hosts AppData/Roaming/devin/cli/transcripts; posix roots unchanged.
  • ATIF-v1.7 parser support — plain-string message, source-based user/agent/system classification, step timestamp/metrics/model_name, and token buckets that treat prompt_tokens as already including cached tokens.
  • sessions.db sidecar enrichment — new reader maps sessions rows to cwd/title/model/timestamps, honors hidden, caches by path+mtime+size, and merges through the existing sidecar seam; whole-file agents now enrich after read and re-merge on a db-only change.
  • Test coverage — new db and remote-source suites, an ATIF fixture, platform-aware root fixtures, and a normalized remote issue-path expectation.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

…ases

- Resolve the platform-aware Devin cli dir in agent-sources instead of
  importing the shared devin-cli-data-dir module, which is not part of
  this change (broke typecheck).
- Exclude source:'system' steps unconditionally, even when legacy
  metadata fields would classify them as user/assistant messages.
- Guard unix-seconds conversion against out-of-range values so a single
  bad sessions.db row cannot mark the whole index unreadable.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟡 Minor · Invalidate Devin metadata when the WAL changes. · session-scanner-devin-db.ts:76-94

src/main/ai-vault/session-scanner-devin-db.ts:76-94
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Invalidate Devin metadata when the WAL changes.

devinSessionsDbPath observes only sessions.db. devinSessionsIndexForSidecar and parseCachedInLane reuse cached data when that file’s mtime and size are unchanged. SyncDatabase binds to node:sqlite, which reads committed WAL frames from sessions.db-wal while the main database file can retain its stat until checkpoint.

Therefore, a live Devin database in WAL mode can leave DB-derived working directory, title, model, or hidden state stale. A transcript change alone does not refresh indexCache; it can only trigger another read that returns the same cached index.

Include sessions.db-wal in the dependency key while retaining sessions.db invalidation, or otherwise invalidate both caches when the WAL changes.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: baa3d200-251a-4325-9f45-41560d684e14

📥 Commits

Reviewing files that changed from the base of the PR and between 9f14eb5 and c5aa6df.

📒 Files selected for processing (3)
  • src/main/ai-vault/session-scanner-agent-sources.ts
  • src/main/ai-vault/session-scanner-devin-db.ts
  • src/main/ai-vault/session-scanner-devin-parser.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/main/ai-vault/session-scanner-agent-sources.ts
  • src/main/ai-vault/session-scanner-devin-db.ts
  • src/main/ai-vault/session-scanner-devin-parser.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

Incremental delta since the prior pullfrog review (9f14eb5 → c5aa6df):

  • Build blocker fixed — removed the import of the nonexistent ../devin/devin-cli-data-dir module and inlined the platform-aware Devin transcripts-root resolution in session-scanner-agent-sources.ts. pnpm tc:node is clean and the 116 targeted Devin/root/env tests pass.
  • System steps excluded from message counts — session-scanner-devin-parser.ts now gates both the user and assistant branches on source !== 'system', so ATIF setup steps can no longer feed the title or preview.
  • Out-of-range timestamps tolerated — unixSecondsToIso returns null for non-positive or non-finite dates instead of throwing, so one bad sessions.db row no longer marks the whole index unreadable.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

… stale

In WAL mode, committed rows sit in sessions.db-wal while sessions.db
keeps its stat until checkpoint, so keying the dependency on the db
alone could serve a stale index. The dependency now observes the wal
when one exists; the reader still opens sessions.db itself.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

The new WAL probe imports existsSync from node:fs into a guarded scanner module, so pnpm test now fails session-scanner-fs-import-guard.test.ts. Devin roots can be WSL UNC paths, so the probe needs to go through the WSL gate rather than be allowlisted.

Reviewed changes

Incremental delta since the prior pullfrog review (c5aa6df → c23d49e):

  • WAL-aware Devin db dependency — devinSessionsDbDependencyPath returns sessions.db-wal when it exists, else sessions.db, and contentDependencyPath now points at it so a WAL-mode write invalidates the sidecar cache instead of leaving cwd/title/model/hidden stale.
  • Sidecar path normalized back to the db — devinSessionsDbPathForSidecarPath strips the -wal suffix before SQLite opens it, and the index cache is keyed by the db path rather than the observed path.
  • Tests — a devinSessionsDbDependencyPath unit test (db until a wal appears) and a wal-observation test that re-reads when only the wal stat moves.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

existsSync bypasses wslGatedStat and can hang a scan on a stalled 9P
mount; the fs-import guard forbids it in session-scanner modules. The
dependency path resolution is now async and probes through the gate.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

Incremental delta since the prior pullfrog review (c23d49e → 6187f50):

  • WAL probe moved behind the WSL gate — devinSessionsDbDependencyPath is now async and probes sessions.db-wal with wslGatedStat(walPath, 'scan'), catching a missing or refused stat to fall back to sessions.db. This removes the raw node:fs existsSync import that failed session-scanner-fs-import-guard.test.ts, while preserving the wal-vs-db dependency choice.
  • Test updated for the async signature — the devinSessionsDbDependencyPath unit test awaits the helper for both the db-only and wal-present cases.

The previously flagged guard-test blocker is resolved. I confirmed the guard suite and the Devin db suite pass locally (17 tests) and pnpm tc:node is clean, and that the new gated stat cannot nest inside another gate task (session-scanner-discovery.ts:34-58 awaits each gated call sequentially). Prior review threads on the raw node:fs import and the remote-enrichment scope have been resolved.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (2)

🟡 Minor · Honor explicit zero metric values. · session-scanner-devin-parser.ts:96-114

src/main/ai-vault/session-scanner-devin-parser.ts:96-114
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Honor explicit zero metric values.

firstDevinMetricValue skips finite zero values because it returns only when value > 0. A higher-priority zero can therefore fall through to a lower-priority positive metric, causing consumeDevinSessionStep to overstate totalTokens. Preserve numberValue and distinguish an explicit finite numeric zero from missing or unsupported values.

Proposed fix
-      const value = numberValue(source[key])
-      if (value > 0) {
+      const rawValue = source[key]
+      const value = numberValue(rawValue)
+      if (
+        value > 0 ||
+        (value === 0 && typeof rawValue === 'number' && Number.isFinite(rawValue))
+      ) {
         return value
       }
🟡 Minor · Extract text from ATIF array messages. · session-scanner-devin-parser.ts:134-165

src/main/ai-vault/session-scanner-devin-parser.ts:134-165
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Extract text from ATIF array messages.

ATIF v1.7 allows step.message to be a string or an array of content parts. extractContentText already supports arrays, but extractDevinStepText never passes step.message to it. An array message therefore increments the message count but does not contribute to the title or preview.

-  return extractString(step.text)
+  return extractContentText(step.message) ?? extractString(step.text)

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 8f2e413d-8cc7-4865-9858-e7ff5120e0ee

📥 Commits

Reviewing files that changed from the base of the PR and between c23d49e and 6187f50.

📒 Files selected for processing (2)
  • src/main/ai-vault/session-scanner-devin-db.test.ts
  • src/main/ai-vault/session-scanner-devin-db.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/ai-vault/session-scanner-devin-db.test.ts

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

- firstDevinMetricValue skipped explicit numeric zeros, letting a
  lower-priority positive metric win and overstating token totals.
- ATIF allows step.message as an array of content parts; route it
  through extractContentText so those steps still feed title/preview.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — the delta is a correct, narrow follow-up; one coverage suggestion below.

Reviewed changes

Incremental delta since the prior pullfrog review (6187f50 → 9fbc647):

  • Explicit zero metrics honored — firstDevinMetricValue now returns a finite numeric 0 instead of skipping it, so a higher-priority source or key that explicitly reports zero no longer falls through to a lower-priority positive value.
  • ATIF array messages parsed — extractDevinStepText routes an array-valued step.message through extractContentText, so those steps feed title and preview instead of only incrementing the message count.

ℹ️ Both edge-case fixes ship without a regression fixture

extractDevinStepText and firstDevinMetricValue changed behavior for two shapes the existing suites never produce: the ATIF-v1.7 fixture uses plain-string message values, and no Devin test supplies an explicit 0 metric. Without a fixture, a future refactor can silently reintroduce either bug.

Technical details
# Regression coverage for the two parser edge cases

## Affected sites
- `src/main/ai-vault/session-scanner-devin-parser.test.ts` — no case with an array-valued `message` or an explicit `0` metric.

## Required outcome
- A case where a higher-priority metric source/key is explicitly `0` and a lower-priority one is positive asserts the zero wins (guards the `firstDevinMetricValue` change).
- A case with an array-valued `message` asserts the step contributes title/preview text (guards the `extractContentText(step.message)` fallback).

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

The extractDevinStepText fallback that routes an array-valued
step.message through extractContentText shipped without a fixture that
produces that shape, so a future refactor could silently drop the
branch. Pin that an array of text parts feeds the step's title and
preview.
@lattenee

Copy link
Copy Markdown
Contributor Author

Added the array-valued message regression fixture in fa45d8a.

I deliberately did not add the suggested explicit-zero case as specified: "a higher-priority metric source/key is explicitly 0 and a lower-priority one is positive asserts the zero wins" pins the semantics that were since corrected on the stacked branch feat/devin-usage-analytics (b9e44ea3be) — firstDevinMetricValue there returns the first positive metric across all sources and only falls back to an explicit zero when nothing positive exists, and that branch already carries the regression test lets a positive metric win over an explicit zero in an earlier source. Asserting zero-wins here would fail as soon as the stacked change lands on top of this branch.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

Incremental delta since the prior pullfrog review (9fbc647 → fa45d8a):

  • Array-message regression fixture — session-scanner-devin-parser.test.ts now parses an ATIF step whose message is an array of { text } parts, asserting it contributes to messageCount, title, and the user preview. This guards the extractContentText(step.message) fallback added in 9fbc647; the assertion fails without that fallback, so it is real coverage rather than theatre.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@nwparker nwparker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI-assisted code review of 98fd988: no remaining blocking findings in this PR's documented scope.

Fixed during review: persisted pre-ATIF parser results survived upgrades; a locked sessions.db could be retried for every transcript in one scan; and equal database/WAL stats could reuse the wrong metadata cache entry. Added regression coverage and had the final changes reviewed independently.

Verification: 1,370 AI Vault tests on macOS, 133 targeted tests on native Windows via Orca CLI, Node typecheck, and changed-code quality checks pass. The rendered folder-workspace session shows its title, messages and preview (proof in the description).

Limits: broad Windows suite has baseline failures; legacy SSH filesystem scanning still does not enrich from the remote SQLite index; the newly installed Devin CLI is awaiting browser login for a fresh real-session check. CI is approved and queued.

@nwparker

nwparker commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Readiness checklist — PR #21337, revision 9cde006

Verdict: PASS for the reviewed change. All final GitHub checks pass on 9cde006; the PR is approved and all review threads are resolved. Validation limits are recorded below.

No new P0, P1, or P2 candidate findings remain after the review fixes. Counsel validation is not required under the checklist's zero-candidate exception.

Item Evidence and scope
01 SSH / remote / network Remote source uses the existing remote path and document-parser adapters, preserves execution-host identity and host platform. Remote path, large-document, cancellation, stream-error and source-release tests passed in the full suite. No connection/reconnection/relay ownership logic changed. A live network-fault matrix was not rerun. Legacy SSH filesystem fallback still lacks database enrichment, as documented in the PR.
02 Crash / casts / retry / growth Dedicated diff scan found no new unsafe casts, non-null assertions, unhandled JSON parse path, recursive retry, timer, or process launch. Database cache is capped at eight roots. Failed opens are remembered only within one scan; a regression counts one attempt for three transcripts and proves recovery next scan with unchanged stats.
03 Security / supply chain The scanner/cache changes are code or tests; one lint-config change extends the existing geometry-name exception to main’s new browser markup regression test. No dependencies, lockfiles, install hooks, binaries, workflow edits, network sinks, or embedded credentials in the PR diff. Database access uses the existing read-only/query-only adapter and fixed schema-checked column names. The separately downloaded Windows Devin executable was verified against its official SHA256 manifest.
04 Performance / resources Existing streamed parsing and bounded preview consumers are preserved. A large Devin transcript with 11,001 messages passes. Database contention is bounded to one open per root per scan, successful indices use an eight-root LRU, and every database handle closes in finally. No new polling, subprocesses, listeners, or timers.
05 Functional correctness Native Windows tests cover default, relocated and missing AppData, overrides, ATIF user/agent/system messages and token totals, database workspace/hidden metadata, WAL invalidation, and remote roots. Rendered hidden Electron check shows the fixture in its folder workspace with title, model, two messages and previews.
06 Backward compatibility / data loss No mobile-facing surface touched: no RPC/schema, pairing, stored mobile state, deep-link or protocol changes. Existing metadata-shaped Devin transcripts remain supported. Cache schema 3 invalidates old parsed results; rollback regenerates the disposable cache. User transcripts and sessions.db are read-only. No user-data migration or deletion introduced.
07 Cross-platform / remoting 202 targeted checks pass on native Windows through the paired awin host; 1,475 AI Vault and affected performance tests pass on macOS. Paths use Node path or joinRemotePath, and WSL stat probes stay gated. No shell, shortcut, native-module, packaging or Git-provider changes. Linux and Windows packaging passed on the final revision; live WSL and full SSH fault-injection were not repeated for this change.
08 Organization Changes are colocated in ai-vault; existing SQLite, sidecar-enrichment, path, parser, resume-command and scan-scope patterns are reused. All imports are tracked. Typecheck and changed-code quality gate pass; worktree is clean.

Validation limits:

  • The broader Windows suite is not green: 29 failures on the prior PR revision and 30 on the pre-PR base. These concern baseline path assumptions and SQLite numeric-range errors; the final 202 targeted checks pass.
  • One fully concurrent macOS run hit an indexer timing assertion. Its isolated rerun and the final full run with four workers passed.
  • The screenshot uses synthetic ATIF and SQLite data. Separately, authenticated Devin 3000.10.31 on Windows generated a real session with --export. Final scanner verification passes: four messages, model, 35,559 tokens, assistant previews, correct database-derived workspace. The actual export directory is agent_logs; the final fix includes both it and the older transcripts directory locally, in WSL, and remotely. A print-mode run without --export produced no ATIF file; database-only sessions remain outside this transcript scanner’s scope.
  • Final GitHub PR Checks run: https://github.com/stablyai/orca/actions/runs/35437223014. All eight test shards, Linux/Windows packaging, static analysis, typecheck, relay integration, Pi runtime checks on all three platforms, and bot review passed on the latest commit.

Review follow-up: duplicate Devin exports now share the existing scan-local collection. Identity includes agent, execution host, Devin installation and session ID, preserving separate hosts/WSL roots and Codex behavior. Local bounded/unlimited and remote Windows/Linux regressions pass. Both benchmark harnesses use the extracted collection and completed 40,000 differential correctness comparisons each, plus their timing runs and deduplication GC retention checks.

Main integration exposed stale tests: the terminal-pane count budget now accounts for its three keyed readers while continuing to reject full-inventory scans; two OMP assertions follow main's recorded-transcript resume contract and retain ID fallback coverage; the relay environment test awaits main's async augmenter. The existing geometry-name lint exemption includes main's browser markup regression test. No OMP or terminal runtime behavior was changed by these test corrections.

1,523 AI Vault/OMP tests pass locally. Windows verified the real Devin session, deduplication and OMP assertions on 13f2aca: 18 tests pass, in addition to the earlier 202-check run. The last commit changes only benchmark imports and the relay assertion; that relay suite passes both tests and the changed-code quality gate passes. All review threads are resolved; final CI and bot review passed. No remaining candidate findings; ready to merge.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

Incremental delta since the prior pullfrog review (fa45d8a → 98fd988):

  • Stale Devin cache entries invalidated on upgrade — SCHEMA_VERSION is bumped to 3, so pre-ATIF Devin rows persisted under schema 2 are discarded whole and re-parsed instead of replaying with empty titles and message counts. This is the codebase's documented mechanism for a parser-semantics change (session-parse-cache-persistence.test.ts:133-145).
  • Contended database bounded to one attempt per scan — session-scanner.ts wraps the scan in withDevinSessionsDbScan, and session-scanner-devin-db.ts records a failed db path in an AsyncLocalStorage set. A locked sessions.db now costs one open attempt per scan rather than one per transcript, and the next scan retries.
  • db↔WAL switch invalidates the index cache — the cached index entry now stores the observed sidecarPath and requires it to match, so switching between sessions.db and sessions.db-wal re-reads even when their mtime and size are identical.
  • Regression coverage — new upgrade-reparse, contention-and-recovery, db→WAL-identical-stat, and relocated/empty platform data-directory tests.

I verified the five touched suites pass locally (124 tests) and that the AsyncLocalStorage context reaches the parse lane, so the per-scan bound is genuinely exercised rather than only satisfied by the mock. The scan-body re-indent in session-scanner.ts is otherwise mechanical. No new issues.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

The new agent_logs discovery root can list the same Devin session twice when it exists in both transcripts and agent_logs, because nothing dedupes Devin rows by session_id. Please confirm the two directories can never hold the same session on one install, or collapse the duplicate.

Reviewed changes

Incremental delta since the prior pullfrog review (98fd988 → 9763f42):

  • agent_logs discovery added — Devin's sibling agent_logs directory is now scanned alongside transcripts on local, WSL, and remote hosts. The local roots merge under one per-agent discovery limit (mergeRootDiscoveries: true), and remoteDevinSource takes a directory argument so the same source is registered twice.
  • Root-resolution tests — local, relocated/empty platform-data, WSL, and remote fixtures now assert both directories are returned.
  • Enrichment scan parameterized — the sessions.db enrichment scan test now runs for a transcripts and an agent_logs transcript.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — the Devin cross-root dedupe is correct; one minor cleanup below.

Reviewed changes

Incremental delta since the prior pullfrog review (9763f42 → c225063):

  • Generic post-parse dedupe extracted — new session-root-dedup.ts holds dedupeScannedSessions and ScannedSessionCollection, which now handle Codex (delegating to codexSessionAliasKey/codexSessionAliasBeats) and Devin. Devin rows collapse on (executionHostId, install dir, sessionId), choosing the newest export and preferring agent_logs on ties; the local and remote scanners plus the cutoff type switched to the generic names.
  • Codex-only exports removed — codex-session-root-dedup.ts drops dedupeCodexSessionsBySessionId and CodexSessionCollection and exports the two alias helpers for delegation.
  • Dedupe regression tests — new session-scanner-devin-dedup.test.ts covers local both-roots collapse while still filling the scan limit, remote win32/linux collapse, and winner/isolation unit cases; the Codex collection/root-dedup, cutoff, and unlimited-dedup suites were retargeted to the generic names.
  • Terminal-pane budget test — pane-title-update-global-scan-budget.test.tsx raises the bucket-read budget from WORKSPACE_COUNT * 2 to * 3 to account for main's per-workspace sleep-state reader (test-only; the guard still rejects full-inventory scans by ~290×).

The prior open finding (no cross-root Devin sessionId dedupe) is addressed by 4e7cdc2060. I read the delta end-to-end and ran the touched suites (45 AI Vault dedupe tests + the renderer budget test) locally — all pass.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Comment thread src/main/ai-vault/session-root-dedup.ts Resolved

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

Incremental delta since the prior pullfrog review (c225063 → 9cde006):

  • Benchmark scripts repointed — config/scripts/session-dedup-batches-benchmark.mjs and config/scripts/session-scan-cutoff-benchmark.mjs now import ScannedSessionCollection/dedupeScannedSessions from session-root-dedup instead of the removed Codex-only exports, so both perf harnesses run again. This closes the prior review's finding.
  • Async relay augmenter awaited — src/relay/omp-fresh-launch-environment.test.ts now awaits the addEnvAugmenter callback before asserting its empty result.

I verified the delta locally: the dedup benchmark completes its 40,000 differential batches (exit 0), the cutoff benchmark's new import specifiers bundle and resolve, and the relay suite passes (2 tests). A repo-wide search finds no remaining CodexSessionCollection/dedupeCodexSessionsBySessionId references. The one prior pullfrog thread (stale benchmark imports) is resolved.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@nwparker
nwparker merged commit bb2afe1 into stablyai:main Sep 19, 2026
33 checks passed
@lattenee
lattenee deleted the fix/devin-ai-vault-windows-sessions branch September 21, 2026 01:19
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.

Devin sessions missing from AI Vault on Windows (and parsed nearly empty elsewhere)

2 participants