VS Code sidebar chat extension for EasyMod backend gateway APIs.
What It Does
- Adds an
EasyModActivity Bar view with a webview chat panel. - Sends chat requests through backend
POST /api/vscode/send(including streaming). - Supports extension sign-in with auth code exchange + refresh token flow.
- Supports organization-aware requests (
org_id) and model loading. - Chat model dropdown includes an Auto option (sends
model: "auto"; backend performs routing selection) alongside concrete models; a small resolved-model badge is shown on assistant messages that were answered by an Auto turn. - Includes local workspace tool loop (
rg, file read, file list) for retrieval-style workflows. - Adds persistent workspace memory index (
.easymod/workspace-memory.json) for cross-language symbol/impact recall between turns. - Supports assistant patch preview/apply from unified diff output with workspace safety checks.
- Supports multiple local chat sessions (new/switch/rename/delete/clear).
- Keeps in-flight assistant streaming alive across Activity Bar/sidebar switches by retaining and rehydrating the chat webview state.
Requirements
- VS Code
^1.90.0 - Node/npm for build and test
- EasyMod backend reachable from
easymod.apiUrl
Setup
npm install
npm run compile
For development:
npm run watch
Run extension in Extension Development Host with F5.
Test
npm test
This rebuilds out/ and runs Node tests from compiled output (out/test/**/*.test.js) if present.
Development Tools
npm run compileruns the TypeScript strict compile check.npm run watchkeeps TypeScript compiling during extension development.npm testruns the repository safety gates (check-db-safety,check-test-suite), rebuildsout/, and then runs the compiled Node test suite.
Commands
EasyMod: Open Chat PanelEasyMod: Focus Chat ViewEasyMod: Sign InEasyMod: Sign OutEasyMod: Switch OrganizationEasyMod: Set Manual JWT SessionEasyMod: Toggle Full File Access
Settings (easymod.*)
Core connection/auth:
apiUrl(default:https://backend.easymodularity.com)model(default: empty; uses the EasyMod default chat model)defaultOrgId(default: empty)extensionAuthBridgeUrl(default:https://easymodularity.com/extension-auth/bridge/start; set empty to use<apiUrl>/extension-auth/bridge/start)extensionId(default: empty)mcpJson(default: empty JSON string field)
Context and prompt assembly:
includeSelection(default:true)includeWholeFile(default:false)contextMode(focused|fullActiveFile, default:focused)maxContextChars(default:32000)maxPromptChars(default:52000)reservedResponseChars(default:12000)maxPromptTokens(default:32000)maxContextTokens(default:12000)reservedResponseTokens(default:4000)historyMaxTokens(default:3000)memorySummaryMaxTokens(default:800)
Retrieval and memory behavior:
contextLedgerEnabled(default:true)contextLedgerMaxEntries(default:24)minRelevanceScore(default:24)retrievalChunkLines(default:80)retrievalChunkOverlapLines(default:8)retrievalMaxFiles(default:80)retrievalMaxSnippets(default:3)retrievalPerFileCharLimit(default:120000)maxToolResultChars(default:30000)
Patch and tooling behavior:
autoApplyPatchWithConfirmation(default:true, legacy/unused)enableWorkspaceToolLoop(default:true)commandLoopEnabled(default:true)commandLoopMaxRetries(default:2)commandExecTimeoutMs(default:120000)alwaysAutoRunCommands(default:false)autoRunProjectStartup(default:false)fullFileAccess(default:false)enableDeveloperDebugPage(default:false)apiKeyis legacy/unused in JWT backend mode.
Patch flow notes:
fullFileAccess: truemeans new assistant patches auto-apply, and it also turns on trusted command auto-run plus startup auto-run.fullFileAccess: falsemeans new assistant patches stay in preview mode until manually applied from the latest patch card.- When a prompt explicitly names a target workspace root (e.g.
in easymod-api workspace, …orin easymod-api, create …) and that name matches no existing root, auto-apply is blocked before any patch is applied; the extension surfaces the available roots and asks you to re-send. alwaysAutoRunCommands: trueskips the manual confirmation dialog only for trusted command runs that pass the extension policy.autoRunProjectStartup: truelets EasyMod auto-start exactly one trusted startup command after prompts like "serve this project", "run this app", or natural variants such as "help me serve it". Auto-run is now allowlist-based: only common local startup commands such asnpm run dev,npm start,npx serve,npx http-server,python -m http.server,php artisan serve,vite, and similar dev-server patterns qualify. Before launching a long-running startup command in the terminal, EasyMod now performs a short startup probe. If the command fails immediately, the captured stderr/stdout is fed into the command repair loop instead of being lost in terminal-only output. It still skips auto-run when there are multiple commands, the command is not startup-like, the command is outside the trusted auto-run allowlist, or a patch is still waiting for manual apply. The terminal working directory is anchored at the workspace root whose basename matches the command's leadingcd <target>prefix, and the redundant root-name segment is stripped from the cd before the command is sent to the terminal (e.g.cd easymod-api/calculator && npm run devspawns in theeasymod-apiroot and sendscd calculator && npm run dev; bare-rootcd easymod-api && npm run devdrops the cd entirely and sendsnpm run dev). Commands with nocdprefix or an unrecognized first segment fall back to the active-editor folder or the first workspace folder, and are sent verbatim.
Local Dev Tip
For local development against a local backend/frontend, use workspace overrides in .vscode/settings.json instead of changing defaults in package.json.
Example:
{
"easymod.apiUrl": "http://127.0.0.1:8010",
"easymod.extensionAuthBridgeUrl": "https://easymodularity.com/extension-auth/bridge/start",
"easymod.autoRunProjectStartup": true,
"easymod.fullFileAccess": false,
"easymod.enableDeveloperDebugPage": true
}
Notes
- Backend remains source of truth for auth, org access, and request handling.
- Extension-side tool loop and context assembly are configurable and can be disabled.
- Patch writes are guarded by workspace boundary checks and optional confirmation.
- In-flight assistant streams continue in the extension host even if the EasyMod sidebar is temporarily hidden; reopening the view rehydrates the current streamed text instead of starting from a blank panel.
Stream Log Semantics
chat stream chunkmeans raw bytes/chunks were read from backend SSE/stream transport.assistant delta receivedmeans user-visible assistant text delta was emitted into the extension turn pipeline.ui first flushis tied to the firstassistant delta received, not the firstchat stream chunk.- In tool-loop or multi-turn synthesis flows,
chat stream chunkcan appear long before first UI flush.
Example A (small-talk, fast path):
chat stream chunkat ~5msassistant delta receivedat ~600msui first flushimmediately after first delta
Example B (tool-loop heavy prompt):
- early
chat stream chunkevents appear quickly (transport is active) - multiple loop/follow-up turns happen
- first
assistant delta receivedmay appear much later (for example 50s+) ui first flushthen occurs right after that first assistant delta