Skip to content

refactor(app): use opencode SDK for session reads - #4193

Merged
benjaminshafii merged 1 commit into
devfrom
thin/app-native-session-reads
Aug 28, 2026
Merged

benjaminshafii merged 1 commit into
devfrom
thin/app-native-session-reads

Conversation

@benjaminshafii

Copy link
Copy Markdown
Member

Stack

Stacked on #4192 → #4191 → #4190 → #4189 → #4188. Review commit b34673b5 (plus the parent-forward merge) / diff against thin/app-native-session-list.

Why

After #4192 migrated session lists, the app still overrode native SDK get/messages/todo with wrapper reads and directly called OpenworkServerClient get/messages/snapshot/delete methods. This migrates the remaining app session data plane while leaving server routes and engine-plugin/eval consumers for later PRs.

What changed

  • Removed remaining get/messages/todo wrapper overrides and all old-server read-fallback machinery from app/lib/opencode.ts. Prompt/command compatibility handling remains intact.
  • Removed app-facing OpenworkServerClient session get/messages/snapshot/delete methods after all app production callers migrated.
  • Added opencode-session-native.ts with:
    • workspace-endpoint-bound get/messages/delete
    • parallel get/messages/todo/status snapshot composition
    • idle fallback
    • message limit + AbortSignal propagation
    • preserved status/error-code metadata
    • injectable operations for deterministic test isolation
  • Migrated:
    • selected route-session hydration
    • session search transcript reads
    • sidebar/control deletion
    • session surface snapshot query
    • voice context transcript reads
  • Existing native abort helpers stay unchanged.
  • Fixed voice callback dependencies for the new endpoint/token inputs and removed the obsolete workspaceId prop.
  • Server wrappers remain until plugin/direct-eval migration is complete.

Verification

  • Native-session/list focused suite — 26 pass / 0 fail
  • Post-parent-merge focused suite — 7 pass / 0 fail
  • Workspace session load-budget eval — 1 pass / 0 fail
  • pnpm --filter @openwork/app typecheck — pass
  • pnpm --filter @openwork/app build — pass (6705 modules)
  • Full app suite — 1071 pass / 5 fail. The five are pre-existing order-dependent global-mock/browser fixture failures; each passes isolated:
    • Connect inventory: 6/6
    • cloud workspace overlay: 24/24
    • provider-auth sync: 7/7
    • extensions sidebar: 3/3
      All branch-specific native-session tests pass in the full suite.
  • git diff --check — pass

Coverage

  • endpoint/token selection through injected operation factory
  • parallel snapshot operations with exact limit/signal
  • idle fallback
  • raw SDK get/messages/delete shapes, including native false delete result
  • native 404 mapped to session_not_found
  • component snapshot failure propagation
  • route hydration/search/delete/voice call-site type coverage
  • stale voice endpoint/token callback dependency prevention

@vercel

vercel Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openwork-app Ready Ready Preview Aug 28, 2026 7:07pm
openwork-den Ready Ready Preview Aug 28, 2026 7:07pm
openwork-diagnostics Ready Ready Preview Aug 28, 2026 7:07pm
openwork-landing Ready Ready Preview, v0 Aug 28, 2026 7:07pm

diff-warden[bot]
diff-warden Bot previously approved these changes Aug 28, 2026

@diff-warden diff-warden 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.

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (5741074bd69868c83c49084fe2c224cbb154d5bf). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

Deploying openwork with  Cloudflare Pages  Cloudflare Pages

Latest commit: a10c513
Status: ✅  Deploy successful!
Preview URL: https://9c89c980.openwork.pages.dev
Branch Preview URL: https://thin-app-native-session-read.openwork.pages.dev

View logs

@diff-warden diff-warden 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.

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (3ff4d8e44c0be617f447104e13a44708ced1f8e0). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@benjaminshafii
benjaminshafii force-pushed the thin/app-native-session-reads branch from 3ff4d8e to 977e47a Compare August 28, 2026 19:00

@diff-warden diff-warden 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.

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (a10c513d9f6da461faf12b8f0b1b43c6af1011ca). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@benjaminshafii
benjaminshafii merged commit b8810d9 into dev Aug 28, 2026
19 checks passed

This branch was successfully deployed

4 active deployments
Preview – openwork-landing — a10c513d Deployed Aug 28, 2026 by vercel[bot]
Preview – openwork-den — a10c513d Deployed Aug 28, 2026 by vercel[bot]
Preview – openwork-app — a10c513d Deployed Aug 28, 2026 by vercel[bot]
Preview – openwork-diagnostics — a10c513d Deployed Aug 28, 2026 by vercel[bot]
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