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
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.
- +0Prompt · +0Workspace 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.
- +0mAgent did · +0mExplored 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.
- +6mPrompt · +6mSame 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.
- +7mAgent did · +7mConfirmed 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.
- +27mAgent did · +27mAfter 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.
- +29mFail · +29mweb 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.
- +31mAgent did · +31mRather 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.
- +33mOutcome · +33mSession 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.
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.