Use the portfolioagent.app harness inside VS Code: chat in a sidebar or panel, sync thread workspace files into your open folder, edit repro scripts, and run them in the integrated terminal.
Quick start (local dev)
cd extensions/vscode-portfolio-agent
npm install
npm run compile
Press F5 in VS Code (Run Extension) with extensions/vscode-portfolio-agent as the workspace folder, or add a launch config at repo root.
Commands
Command
What it does
Portfolio Agent: Sign In
Browser sign-in (Clerk) — enables sync via BFF, no LangSmith key
Portfolio Agent: Sign Out
Clear stored session
Portfolio Agent: Open Chat
Hosted app in Simple Browser
Portfolio Agent: Set Active Thread ID
Paste threadId from the web app URL
Portfolio Agent: Sync Thread to Workspace
Pull files from LangGraph state → workspace folder
Settings
Key
Purpose
portfolioAgent.webAppUrl
Chat harness (default https://portfolioagent.app)
portfolioAgent.activeThreadId
Deep-link chat + default sync target
portfolioAgent.langgraphDeploymentUrl
Advanced: direct LangGraph URL (skip if signed in)
portfolioAgent.langsmithApiKey
Advanced: direct mode only — prefer Sign In
portfolioAgent.syncOnSave
Push workspace edits back to thread state (experimental)
Typical workflow
Open a folder (e.g. my-analysis/).
Portfolio Agent: Sign In (one-time per machine).
Run analysis on portfolioagent.app.
Click Open in VS Code or Set Active Thread ID.
Sync Thread to Workspace → data/returns.csv, repro/*.R, etc. appear locally.
Edit scripts, run in terminal: Rscript repro/optimize_portfolio.R.
Optional: enable sync on save so the agent sees your edits on the next turn.
Chat = embed hosted app (full harness: plan approval, repro bar, teach feedback).
Sync = direct LangGraph SDK + operator API key (same as self-hosted / dev).
Phase 1:
Browser sign-in → extension token → call portfolioagent.app/api/langgraph (no raw key in settings).
Open in VS Code deep link from web app (thread id + one-click sync).
Phase 2:
Branded Code-OSS build with extension preinstalled (only if extension retention proves out).
Why not fork Code-OSS first?
The extension reuses 100% of your existing web harness for chat and HITL. The incremental value in VS Code is files + terminal + git — sync delivers that without maintaining a VS Code fork.
Related
MCP server: portfolio-agent-mcp (Telegram / other clients)