Skip to content
PifeatureCLI & tooling7 files · +1137 −446

Add cross-project workspace discovery & open-new-workspace flow (pi-web bridge)

Session from pi-web on Hugging Face by woxQAQ · MIT · condensed by Coders Talk

33msession
0interventions
GOAL

Enable the Pi web UI to list and open workspaces that haven't previously been opened with pi (currently workspace listing only scans .pi/agent/sessions), and add a UI flow to open a brand-new project folder as a workspace.

  1. Prompt · +0
    Workspace list only comes from .pi/agent/sessions, which requires the workspace to have been opened with pi before. New/unopened projects can't be listed this way.
  2. Agent did · +0m
    Explored bridge (ws-rpc-adapter.ts, session-registry.ts, types.ts) and web (SessionRail.vue, AppSidebar.vue, useBridgeClient.ts) to trace how workspace/session lists are built; added a new RpcWorkspaceSummary type in bridge types.ts and wired it through shared-types.ts, ws-rpc-adapter.ts and useBridgeClient.ts as groundwork.
  3. Prompt · +6m
    Same problem restated more explicitly: I need a way to open a new workspace that hasn't been used with pi before — figure out how to do it.
  4. Agent did · +7m
    Confirmed backend new_session(workspacePath) already accepts arbitrary paths; added expandHomeDirectoryPath/normalizeWorkspacePath handling for tilde paths in ws-rpc-adapter.ts, extended useBridgeClient.ts state/commands, and built a new 'open workspace' dialog and workspace-row UI in SessionRail.vue (styles, modal, new-session button) to let the user type/select a new folder.
  5. Agent did · +27m
    After a resume, reviewed the full diff across bridge and web files and located the project's build/test scripts (build:web, vitest) to prepare a self-check.
  6. Fail · +29m
    web build succeeded, but running vitest against useBridgeClient.ext-ui.test.ts and ws-rpc-adapter.test.ts reported a failure in the bridge test suite.
  7. Agent did · +31m
    Rather than chase an apparently unrelated pre-existing macOS realpath test failure, added a focused new bridge test asserting that a '~/...' path resolves correctly to the home directory, editing ws-rpc-adapter.test.ts.
  8. Outcome · +33m
    Session ends with the open-new-workspace feature implemented (tilde/path normalization + new UI dialog) and web build passing, plus one new targeted bridge test added; overall test suite status wasn't confirmed green before the transcript ends.
VERDICT

Next time I'd open with the concrete ask up front — 'add a way to open any folder as a workspace, not just ones already scanned in .pi/agent/sessions' — instead of first describing the limitation and only later asking for the fix, since that cost a whole extra round of re-exploration. The correction that actually mattered was pushing the agent to verify the backend new_session already accepted arbitrary paths before building UI, which reframed the work as mostly a frontend/path-normalization problem rather than a backend rewrite.

I tried this · 0

Discussion · 0

How Builds work