Skip to content

fix(vault): read OpenCode SQLite inside WSL and SSH hosts - #23128

Merged
OrcaWin merged 8 commits into
mainfrom
OrcaWin/np-vault-host-sqlite
Sep 26, 2026
Merged

OrcaWin merged 8 commits into
mainfrom
OrcaWin/np-vault-host-sqlite

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

OpenCode sessions created inside WSL or on an SSH host can disappear from Agent Session History because they now live in SQLite. Orca will read those databases on the host that owns them, including changes still in SQLite's WAL file.

What Changed

A small background reader reuses the existing OpenCode v1/v2 parsers. WSL reads execute inside the running distro; SSH reads execute beneath its relay. Session paths and identities retain their host, and SQLite candidates enter the existing sorting, limits, scope, cache and legacy-file pipeline.

The reader uses a host Node runtime only after an actual SQLite read succeeds. Otherwise host preparation supplies the existing pinned, hash-verified Bun runtime through Orca's proxy-aware downloader. Only the matching runtime is installed; desktop packages carry the small reader bundle, not every Bun platform. The older Node relay keeps running independently. Setup failures become Vault scan issues and do not block terminals or local history. Hosts without an OpenCode database skip runtime provisioning; later scans retry preparation when data appears. SSH uploads reuse the existing bounded, ownership-checked staging pool and stale recovery. An uncertain transfer prevents further setup commands on that connection.

Requests are queued with bounded messages, cancellation, timeouts, idle teardown and a guest watchdog. WSL full-prompt and search reads share the host route. SSH wire APIs stay unchanged.

Why

Windows cannot reliably take SQLite locks through WSL network paths, and older SSH Node runtimes cannot open SQLite. Copying the main database can miss uncheckpointed WAL changes. Running the existing read-only parsers beside the database preserves its locking and schema behavior without requiring a system Node upgrade.

Linked Issue

Fixes #20821.

Visual Proof

N/A — Agent Session History uses its existing presentation; this repairs missing database-backed rows. Live guest database fixtures verify the recovered rows and transcript data; no presentation code changes.

Testing

  • Automated tests added/updated
  • Real Windows/WSL reader qualification complete, including final admission changes

Validation includes 174 OpenCode/remote/first-prompt regressions across 25 suites, 204 affected SSH tests across 15 suites, and WSL admission/cancellation/source tests. Final independent native SSH review reran 97 tests across 6 suites successfully. Node and CLI typechecks, scoped lint/format and changed-code-quality gate pass (zero findings). All six relay targets and the actual Bun daemon artifact build. Native and Claude Opus reader and WSL reviews found no remaining P0/P1. The final SSH Opus review found no P0/P1; its targeted retry recheck found no P0/P1 or blocking findings and passed 279 focused tests plus typecheck/lint and four abort-classification reproductions.

An official Node 18.20.8 runtime ran the actual relay service with a Bun reader against a live uncheckpointed WAL fixture and returned the session with no scan issues, then shut down cleanly. This caught and fixed a real Node 18 file-read incompatibility.

Real Windows 11 / Ubuntu 24.04 qualification passed with both guest Node 24.18.0 and an actually downloaded, SHA-verified Bun 1.4.2 fallback. It covered an open WAL containing 28,872 bytes, list/parse/capture, a full 5,039-character prompt, UNC session/database/cwd identities, Linux resume commands, cancellation followed by a new reader, and the missing-distro guard. First preparation returned in 4–5 ms; test fixture processes and guest directories were removed. The existing running distro was preserved; this was not a distro stop/start test. Fifteen generated SSH setup operations also ran on real Windows PowerShell 5.1. No live SSH endpoint was exercised.

The retry review confirmed that local cancellation is retryable, while unresolved remote work remains blocked from retrying on the same connection. A narrow residual can leave a bounded upload slot until stale recovery if cancellation occurs during local filesystem work after reservation; this uses the existing 40-minute recovery policy. Prior d728c59 passed full CI. On 629df77, storage/platform, static, types, both package lanes, real WSL and seven unit shards passed; shard 4 exposed a stale fixture for the new connection-generation API, now corrected without changing its assertions. Merged reviewed head 7c393f7 as da6d483 after the final platform/native matrix, static/types, both package lanes, all eight unit shards, real WSL, localhost SSH and verify checks passed. Changed E2E specs and SSH Docker watcher isolation were still running at merge; no final-head failures were reported. This is not a claim that the final full workflow had completed.

Generation is checked before and after every remote operation, including Linux libc fallback, and after final cleanup. Late results cannot mark a reconnected host ready or clear its newer setup. The late-result regressions and targeted suites pass (38 tests); independent Codex and Claude Opus review found no P0/P1/P2, with Opus rerunning 34 runtime/launcher/fixture tests.

Review

Native SQLite work stays off the calling thread. Missing host access never redirects a query to the client's database. Existing file-only providers retain their prior behavior; remote transcript/search APIs are not expanded in this PR.

Agent skill upstream boundary

  • Not applicable; no agent skill source changed.

Notes

The existing arbitrary OPENCODE_DB filename limitation remains; canonical opencode*.db overrides are supported. First-time Bun setup requires network access unless a verified cache is already present. WSL discovery retains its existing default home-directory roots; this repairs database access at those roots. Older remote version/ripgrep collectors retain their existing best-effort error handling; this PR does not claim to fix uncertainty across all deployment cleanup. A confirmed running-distro probe gates each WSL reader start or queued respawn, while reads through a live reader reuse its process. A failed probe cannot use stale running state to start a reader. As with other WSL commands, a distro can still stop between the check and launch. Runtime setup progress is surfaced as a scan issue; refresh retries after setup.

Checklist

  • Focused on OpenCode history across execution hosts
  • Explained behavior, mechanism and alternatives
  • No presentation change; N/A visual proof explained
  • Final review/fix loop and real WSL qualification complete
  • Cross-platform and SSH compatibility considered
  • Final platform/storage, unit, static/type, package, WSL and localhost SSH gates pass
  • Remaining changed-spec and Docker watcher E2E jobs finish

Final comment fixes: preserve the guest POSIX working directory for WSL resume while retaining UNC database identity; reject cancellation before reader admission; scope uncertain setup to a connection generation and fence every runtime probe, including Linux fallback. 48 targeted tests passed, followed by 34 resolver/runtime tests; Node types, scoped lint and strict anti-slop checks passed. Native and final Opus rechecks are clean of P0/P1/P2; Opus reran 101 targeted tests and 297 caller/connection tests, plus Node types and lint. All review threads are resolved.

@OrcaWin
OrcaWin marked this pull request as ready for review September 26, 2026 08:54
@coderabbitai

coderabbitai Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

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: d9161fc3-b1e2-4c7e-9c81-6e2fb6552339

📥 Commits

Reviewing files that changed from the base of the PR and between 629df77 and 7c393f7.

📒 Files selected for processing (3)
  • src/main/ssh/ssh-relay-cross-version-isolation.test.ts
  • src/main/ssh/ssh-relay-opencode-runtime.test.ts
  • src/main/ssh/ssh-relay-opencode-runtime.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/main/ssh/ssh-relay-opencode-runtime.test.ts
  • src/main/ssh/ssh-relay-opencode-runtime.ts

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


📝 Walkthrough

Walkthrough

The changes add OpenCode SQLite reader processes and integrate them with local, WSL, and relay session scans. They add runtime preparation and routing for WSL and SSH relay hosts, session discovery from SQLite alongside legacy files, and full first-user-prompt reads through worker parsers. Cancellation, request framing, runtime verification, cache behavior, and cleanup are also covered by implementation and tests.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 7c393

No actionable runtime failure was established from the stale-manifest race; the reviewed change has no identified merge-blocking risk.

Architecture Summary

Architecture risk: 🔵 Low · up to 7c393

The change affects 2 systems.

Changed systems: src, config

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — src (service) was modified; 82 changed files map to changed impact.
  • observed — config (service) was modified; 2 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in config/scripts/build-relay.mjs: The build script now imports RELAY_OPENCODE_SQLITE_READER_FILENAME from the shared relay artifacts module.
  • observed — Modified behavior in config/scripts/build-relay.mjs: Adds the entry-point path for the OpenCode SQLite reader process.
  • observed — Modified behavior in config/scripts/build-relay.mjs: Adds a per-platform esbuild step that bundles the OpenCode SQLite reader as a Node 18 CommonJS artifact, externalizes electron and bun:sqlite, and enables minification with production mode defined.
  • observed — Modified behavior in config/scripts/relay-artifact-manifest.test.mjs: The test imports relayOptionalArtifactFilenames alongside the required-artifact filename helper.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The directly linked issue [#20821] requires WSL OpenCode SQLite sessions in Agent Session History. The PR also adds SSH-host runtime installation, relay artifact deployment, SSH command builders, remo… Remove the SSH-specific runtime, relay, and lifecycle changes, or link an active issue that requires SSH-host OpenCode SQLite support and runtime provisioning.
Docstring Coverage ⚠️ Warning Docstring coverage is 29.17% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 72 functions across 58 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR meets the coding objective in [#20821]. It prepares WSL OpenCode SQLite readers, routes WSL database paths to those readers, and adds parsed v1/v2 SQLite sessions to Agent Session History. Auto…
Title check ✅ Passed The title clearly and concisely describes the primary change: reading OpenCode SQLite data inside WSL and SSH hosts.
Description check ✅ Passed The description is complete and directly aligned with the pull request. It explains the user impact, implementation, rationale, linked issue, visual proof, testing, compatibility considerations, and c…
Full details: Out of Scope Changes check

Explanation

The directly linked issue [#20821] requires WSL OpenCode SQLite sessions in Agent Session History. The PR also adds SSH-host runtime installation, relay artifact deployment, SSH command builders, remote runtime retries, and SSH session lifecycle integration. The linked issue does not require SSH-host support.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

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: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 58329cb8-2d4d-4b75-ae9a-913a16019f97

📥 Commits

Reviewing files that changed from the base of the PR and between 4cafa50 and 8b1fcb0.

📒 Files selected for processing (80)
  • config/scripts/build-relay.mjs
  • config/scripts/relay-artifact-manifest.test.mjs
  • src/main/ai-vault-search/session-search-scan-roots.test.ts
  • src/main/ai-vault-search/session-search-scan-roots.ts
  • src/main/ai-vault/cached-session-list-wsl-probe.test.ts
  • src/main/ai-vault/cached-session-list.ts
  • src/main/ai-vault/opencode-wsl-runtime-preparation.test.ts
  • src/main/ai-vault/opencode-wsl-runtime-preparation.ts
  • src/main/ai-vault/remote-session-large-transcripts.test.ts
  • src/main/ai-vault/remote-session-parse-cache.ts
  • src/main/ai-vault/remote-session-scan-concurrency.ts
  • src/main/ai-vault/remote-session-scanner-discovery.ts
  • src/main/ai-vault/remote-session-scanner-opencode-source.ts
  • src/main/ai-vault/remote-session-scanner-opencode.test.ts
  • src/main/ai-vault/remote-session-scanner-types.ts
  • src/main/ai-vault/remote-session-scanner.ts
  • src/main/ai-vault/remote-session-transcript-read.ts
  • src/main/ai-vault/session-first-user-prompt-opencode.test.ts
  • src/main/ai-vault/session-first-user-prompt-read.ts
  • src/main/ai-vault/session-scanner-agent-parser.ts
  • src/main/ai-vault/session-scanner-background.ts
  • src/main/ai-vault/session-scanner-opencode-cancellation.test.ts
  • src/main/ai-vault/session-scanner-opencode-process-admission.test.ts
  • src/main/ai-vault/session-scanner-opencode-sources.ts
  • src/main/ai-vault/session-scanner-opencode-sqlite-discovery.ts
  • src/main/ai-vault/session-scanner-opencode-sqlite-dispatch.ts
  • src/main/ai-vault/session-scanner-opencode-sqlite-process-client.ts
  • src/main/ai-vault/session-scanner-opencode-sqlite-process-entry.ts
  • src/main/ai-vault/session-scanner-opencode-sqlite-process-framing.ts
  • src/main/ai-vault/session-scanner-opencode-sqlite-process.test.ts
  • src/main/ai-vault/session-scanner-opencode-sqlite-worker-client.ts
  • src/main/ai-vault/session-scanner-opencode-sqlite-worker-entry.ts
  • src/main/ai-vault/session-scanner-opencode-sqlite-worker-protocol.ts
  • src/main/ai-vault/session-scanner-opencode-sqlite-worker-spawn.ts
  • src/main/ai-vault/session-scanner-opencode-wsl-client.test.ts
  • src/main/ai-vault/session-scanner-opencode-wsl-client.ts
  • src/main/ai-vault/session-scanner-opencode-wsl-routing.test.ts
  • src/main/ai-vault/session-scanner-opencode-wsl-runtime.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-source-discovery.ts
  • src/main/ai-vault/session-scanner-types.ts
  • src/main/ai-vault/session-scanner-unlimited-dedup.test.ts
  • src/main/ai-vault/session-scanner.ts
  • src/main/ai-vault/session-transcript-reader.ts
  • src/main/lazy-worker-thread-host.ts
  • src/main/ssh/relay-bundle-paths.ts
  • src/main/ssh/relay-socket-path-limit.test.ts
  • src/main/ssh/ssh-relay-deploy-incumbent-verdict.test.ts
  • src/main/ssh/ssh-relay-deploy-staged-upload.test.ts
  • src/main/ssh/ssh-relay-deploy-windows-pipe.test.ts
  • src/main/ssh/ssh-relay-deploy.test.ts
  • src/main/ssh/ssh-relay-deploy.ts
  • src/main/ssh/ssh-relay-native-deps-cache-deploy.test.ts
  • src/main/ssh/ssh-relay-native-deps-install.test.ts
  • src/main/ssh/ssh-relay-native-deps-probe-verdict.test.ts
  • src/main/ssh/ssh-relay-node-pty-spawn-repair.test.ts
  • src/main/ssh/ssh-relay-opencode-runtime-commands.test.ts
  • src/main/ssh/ssh-relay-opencode-runtime-commands.ts
  • src/main/ssh/ssh-relay-opencode-runtime-retry.test.ts
  • src/main/ssh/ssh-relay-opencode-runtime-retry.ts
  • src/main/ssh/ssh-relay-opencode-runtime.test.ts
  • src/main/ssh/ssh-relay-opencode-runtime.ts
  • src/main/ssh/ssh-relay-pty-master-cloexec-install.test.ts
  • src/main/ssh/ssh-relay-session.test.ts
  • src/main/ssh/ssh-relay-session.ts
  • src/main/ssh/ssh-relay-sftp-namespace-install.test.ts
  • src/main/worker-thread-request-queue.test.ts
  • src/main/worker-thread-request-queue.ts
  • src/main/wsl-running-distro-cache.ts
  • src/main/wsl-running-distros.test.ts
  • src/main/wsl-running-path-filter.ts
  • src/main/wsl.ts
  • src/relay/ai-vault-handler.test.ts
  • src/relay/ai-vault-opencode-reader.test.ts
  • src/relay/ai-vault-opencode-reader.ts
  • src/relay/ai-vault-service-entry.ts
  • src/relay/ai-vault-service-filesystem.ts
  • src/shared/relay-artifacts.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.

Comment thread src/main/worker-thread-request-queue.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.

Important

Two live issues in new code: WSL OpenCode rows carry a Windows UNC cwd, which breaks the copied resume command, and the SSH runtime-setup latch is keyed on the pooled SshConnection, so it outlives a reconnect and permanently disables setup.

Reviewed changes

Initial review of all 80 files at 8b1fcb0 (base 4cafa50), focused on the new host-side OpenCode SQLite read path.

  • WSL runtime preparation — opencode-wsl-runtime-preparation.ts probes the guest for a database, runs a real node:sqlite probe, and otherwise downloads/hash-verifies the pinned Bun; caches per distro with coalesced in-flight work.
  • WSL reader client — session-scanner-opencode-wsl-client.ts spawns the bundled reader through wsl.exe -d <distro> --exec and maps guest sessions back to UNC identities.
  • Host-routed reads — session-scanner-opencode-sqlite-worker-spawn.ts splits native vs WSL database paths and routes list/parse/capture to the owning host.
  • Remote OpenCode source — remote-session-scanner-opencode-source.ts adds database discovery and a legacy merge; the parse cache is rekeyed by agent\0path.
  • SSH runtime setup — ssh-relay-opencode-runtime*.ts plus the ssh-relay-deploy.ts cleanup-chain refactor provision the reader on the relay host, serialized against cleanup, with a scan-triggered retry.
  • Reader process transport — session-scanner-opencode-sqlite-process-* frames JSON lines over a persistent child; worker-thread-request-queue.ts gains abort/dispose support.
  • Relay artifact and env — opencode-sqlite-reader.cjs becomes a required relay artifact; buildRelayAiVaultServiceEnv allowlists XDG_DATA_HOME/OPENCODE_DB.

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

Comment thread src/main/worker-thread-request-queue.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.

ℹ️ Incremental review of d728c59 only. The queue cancellation fix is correct; the two findings from the previous review still stand at this head.

Reviewed changes

Delta since the prior review (8b1fcb0 → d728c59), 2 files.

  • fix(queue): discard aborted requests before respawn — worker-thread-request-queue.ts now stores the dispatch signal on PendingCall and drains already-aborted queued calls in pump() before host.ensure(), so a shared scan-signal abort no longer spawns-and-kills one worker per queued request. worker-thread-request-queue.test.ts adds a covering test asserting a single worker for 8 cancelled calls, plus an optional survivor that still gets dispatched.

The drain is self-consistent: it settles each cancelled call through settle, which removes that call's abort listener during the in-flight abort dispatch (so the remaining listeners never run), and the now-empty queue falls through to scheduleIdleTeardown(), which is a no-op once host.destroy() has cleared the worker. No new issues in the delta.

Pullfrog  | Fix it ➔ | 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 new issues found.

Reviewed changes

Delta since the prior review (d728c59 → b0fedcb), 9 files.

  • Preserved WSL cwd as the guest's POSIX path — mapOpenCodeWslSession no longer rewrites cwd to a \\wsl.localhost\… UNC path, so the copied resume command (cd '/home/ada/project' && opencode …) runs inside the distro; filePath/id stay UNC for the first-user-prompt route.
  • Scoped the SSH runtime-setup latch to the connection generation — the installations map is now keyed by conn.getConnectGeneration(), so a reconnect starts a fresh setup map and an unconfirmed teardown no longer permanently disables setup for that target; remote() refuses a superseded generation, which is classified 'failed' (retryable) rather than 'teardown-unconfirmed'.
  • Gated WSL admission on an un-aborted controller — createAdmittedProcessTransport calls controller.signal.throwIfAborted() before admit(...), so a reader cancelled before admission no longer fires a wsl.exe running-distro probe.
  • Coverage — new tests assert no admission probe for a pre-cancelled reader, per-generation recovery after an unconfirmed teardown, that a superseded setup issues no further host commands, and WSL identity/cwd mapping.

All four findings from the previous reviews are addressed; their review threads were replied to and resolved. The queue fan-out fix (d728c59) remains verified.

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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 2a55632b-cc2d-48dd-9818-308d59835bdd

📥 Commits

Reviewing files that changed from the base of the PR and between d728c59 and 629df77.

📒 Files selected for processing (11)
  • src/main/ai-vault/session-scanner-opencode-process-admission.test.ts
  • src/main/ai-vault/session-scanner-opencode-sqlite-process-client.ts
  • src/main/ai-vault/session-scanner-opencode-sqlite-worker-spawn.ts
  • src/main/ai-vault/session-scanner-opencode-wsl-client.test.ts
  • src/main/ai-vault/session-scanner-opencode-wsl-client.ts
  • src/main/ai-vault/session-scanner-opencode-wsl-routing.test.ts
  • src/main/ssh/orcad-deployment-target.test.ts
  • src/main/ssh/orcad-deployment-target.ts
  • src/main/ssh/ssh-connection.ts
  • src/main/ssh/ssh-relay-opencode-runtime.test.ts
  • src/main/ssh/ssh-relay-opencode-runtime.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 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

Delta since the prior review (b0fedcb → 629df77), 3 files.

  • Fenced every runtime platform probe across reconnects — resolveOrcadDeploymentTarget now accepts an optional injected exec, and the SSH runtime setup passes its generation-checked exec (install's helper). Previously the outer remote(() => resolveOrcadDeploymentTarget(...)) fenced only the call boundary, so the internal fallback getconf/musl probe could run on a torn-down channel; now both the ldd and fallback probes pass through remote().
  • Coverage — orcad-deployment-target.test.ts adds a test that a generation change between the first and fallback probe rejects with SSH connection changed and issues no second execCommand; the existing default (no exec) path is unchanged for the orcad-remote-deploy.ts caller.

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.

✅ No new issues found.

Reviewed changes

Delta since the prior pullfrog review (629df77 → 7c393f7), 3 files.

  • Rejected setup results from superseded connections — ssh-relay-opencode-runtime.ts now asserts the connection generation before and after every host operation inside remote(), and once more after install() resolves. A late ready/not-needed from a superseded generation now resolves 'failed' (retryable) instead of being admitted.
  • Kept the newer generation's setup registered — the old setup's cleanup byDirectory.delete still runs against the generation-1 map it captured, so a setup registered under the new generation survives; the coalesced newer call keeps joining it.
  • Coverage — extended the late-result case to both ready and not-needed, added generation-change-during-publication/cleanup tests with exact exec counts, and a regression that a newer setup stays registered while a superseded one finishes late. ssh-relay-cross-version-isolation.test.ts mocks the runtime module so the deploy path stays isolated.

I traced the rejection path end to end: a generation error is neither signal.aborted nor an unconfirmed termination, so it is classified 'failed', and the map deletion touches the superseded generation's map only. Ran both touched suites locally at 7c393f7 (23 + 1 tests) — all pass.

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

@OrcaWin
OrcaWin merged commit da6d483 into main Sep 26, 2026
46 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.

[Bug] OpenCode sessions are missing from Agent Session History for WSL workspaces

1 participant