Skip to content

refactor(app): centralize workspace server clients - #2986

Merged
benjaminshafii merged 3 commits into
devfrom
refactor/workspace-client-primitive
Jul 22, 2026
Merged

refactor(app): centralize workspace server clients#2986
benjaminshafii merged 3 commits into
devfrom
refactor/workspace-client-primitive

Conversation

@benjaminshafii

Copy link
Copy Markdown
Member

Summary

  • add a workspace-scoped endpoint/client resolver built on the canonical workspace-endpoint.ts contract
  • memoize clients per route context without global cross-workspace leakage
  • migrate repeated selected-workspace endpoint derivation in session and settings routes
  • preserve specialized non-React/global client lifecycles
  • add local/remote/auth-change tests and a four-frame invariant flow

Validation

  • pnpm --filter @openwork/app exec bun test src/react-app/infra/workspace-server-client.test.ts — passed (4/4)
  • pnpm --filter @openwork/app typecheck — passed
  • pnpm --filter @openwork/app test:refactor — passed
  • pnpm test:eval-runner — passed (4/4)
  • pnpm fraimz --flow workspace-client-primitive --cdp-url <Daytona Electron CDP> — passed (4/4 frames plus voiceover coverage)

Proof

Fraimz proof will be posted as a PR comment.

@vercel

vercel Bot commented Jul 22, 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, Comment Jul 22, 2026 8:29am
openwork-den Ready Ready Preview, Comment Jul 22, 2026 8:29am
openwork-den-worker-proxy Ready Ready Preview, Comment Jul 22, 2026 8:29am
openwork-diagnostics Ready Ready Preview, Comment Jul 22, 2026 8:29am
openwork-landing Ready Ready Preview, Comment, Open in v0 Jul 22, 2026 8:29am

@benjaminshafii

Copy link
Copy Markdown
Member Author

fraimz — ✅ PASSED

1 passed · 0 failed · 0 skipped — run 2026-07-22T07-50-59-849Z

Full frame proof with validated screenshots: evals/results/2026-07-22T07-50-59-849Z/fraimz.html (re-run: pnpm fraimz --flow workspace-client-primitive)

✅ workspace-client-primitive — Workspace-scoped server clients stay stable across sessions, settings, and reloads

User-facing flow demo

  1. The selected workspace opens on the session surface with one connected server context

    🎙 OpenWork opens the selected workspace and shows its session surface with the server connected and ready.

    • 📸 workspace-client-primitive-01-workspace-session-surface-connected.png — 6 validations passed
    workspace-client-primitive-01-workspace-session-surface-connected.png
  2. A new session opens and is listed without switching the workspace server

    🎙 The user creates and opens a session in that workspace, and it appears through the same workspace-backed session list.

    • 📸 workspace-client-primitive-02-workspace-session-created-listed.png — 4 validations passed
    workspace-client-primitive-02-workspace-session-created-listed.png
  3. Settings, Connect, and Extensions stay scoped to the selected workspace

    🎙 Workspace settings, connections, and extensions load through the selected workspace server without switching endpoints or losing authentication.

    • ✅ Visible text includes "My Extensions"
    • ✅ Visible text includes "Refresh"
    • 📸 workspace-client-primitive-03-workspace-settings-extensions-scoped.png — 7 validations passed
    workspace-client-primitive-03-workspace-settings-extensions-scoped.png
  4. Reloading restores the same workspace, settings route, and session list

    🎙 After the client reloads, OpenWork reconnects to the same workspace and restores its session and settings state.

    • 📸 workspace-client-primitive-04-workspace-session-restored-after-reload.png — 5 validations passed
    workspace-client-primitive-04-workspace-session-restored-after-reload.png
    • ✅ Script frame 1 narrated: "OpenWork opens the selected workspace and shows its session surface with the server conn"
    • ✅ Script frame 2 narrated: "The user creates and opens a session in that workspace, and it appears through the same "
    • ✅ Script frame 3 narrated: "Workspace settings, connections, and extensions load through the selected workspace serv"
    • ✅ Script frame 4 narrated: "After the client reloads, OpenWork reconnects to the same workspace and restores its ses"

@benjaminshafii

Copy link
Copy Markdown
Member Author

fraimz — ✅ PASSED

1 passed · 0 failed · 0 skipped — run 2026-07-22T08-28-21-854Z

Full frame proof with validated screenshots: evals/results/2026-07-22T08-28-21-854Z/fraimz.html (re-run: pnpm fraimz --flow workspace-client-primitive)

✅ workspace-client-primitive — Workspace-scoped server clients stay stable across sessions, settings, and reloads

User-facing flow demo

  1. The selected workspace opens on the session surface with one connected server context

    🎙 OpenWork opens the selected workspace and shows its session surface with the server connected and ready.

    • 📸 workspace-client-primitive-01-workspace-session-surface-connected.png — 6 validations passed
    workspace-client-primitive-01-workspace-session-surface-connected.png
  2. A new session opens and is listed without switching the workspace server

    🎙 The user creates and opens a session in that workspace, and it appears through the same workspace-backed session list.

    • 📸 workspace-client-primitive-02-workspace-session-created-listed.png — 4 validations passed
    workspace-client-primitive-02-workspace-session-created-listed.png
  3. Settings, Connect, and Extensions stay scoped to the selected workspace

    🎙 Workspace settings, connections, and extensions load through the selected workspace server without switching endpoints or losing authentication.

    • ✅ Visible text includes "My Extensions"
    • ✅ Visible text includes "Refresh"
    • 📸 workspace-client-primitive-03-workspace-settings-extensions-scoped.png — 7 validations passed
    workspace-client-primitive-03-workspace-settings-extensions-scoped.png
  4. Reloading restores the same workspace, settings route, and session list

    🎙 After the client reloads, OpenWork reconnects to the same workspace and restores its session and settings state.

    • 📸 workspace-client-primitive-04-workspace-session-restored-after-reload.png — 5 validations passed
    workspace-client-primitive-04-workspace-session-restored-after-reload.png
    • ✅ Script frame 1 narrated: "OpenWork opens the selected workspace and shows its session surface with the server conn"
    • ✅ Script frame 2 narrated: "The user creates and opens a session in that workspace, and it appears through the same "
    • ✅ Script frame 3 narrated: "Workspace settings, connections, and extensions load through the selected workspace serv"
    • ✅ Script frame 4 narrated: "After the client reloads, OpenWork reconnects to the same workspace and restores its ses"

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