PM2 VibeChat — 8-prompt parity test results (2026-08-19)
Status: SHIPPED + PUSHED. Commit 660e245 (branch legacy-toggle, PUSHED to origin).
Live: https://vibecoder.freshvibeapps.com/?legacy=0
What shipped in this commit
1. Real PM2 VibeChat agent (no more stub)
- Removed `src/agent/core.js` (6-line stub returning `{ok: false, error}`)
- Brought in Day 10dd's full agent implementation (8 files, 137KB)
- **22 tools**: read_file, write_file, list_files, run_command, plan, build_freshvibe_app, search, list_services, tail_log, web_fetch, deploy_info, hash_file, diff, apply_diff, list_freshvibe_apps, read_freshvibe_context, read_freshvibe_regions, read_freshvibe_region, search_freshvibe_modules, patch_freshvibe_region, patch_freshvibe_module, read_files_for_context
- Real `runAgent(): AsyncGenerator<AgentEvent>` streaming content/tool_call/tool_result/plan/recon/system/done/error events
- Z.AI primary, Groq fallback with 429 handling
- Plan mode + plan execution loop
- Recon (keyword-based file reading)
- Spec enrichment (FvW v8)
2. App browser + preview canvas (the operator's main ask)
- New `mountAppBrowser()` chrome pill at top of canvas
- Lists all FreshVibe apps from `/api/agent/freshvibe-apps`
- Click app name → iframe overlay shows app at `https://<appName>.freshvibeapps.com/`
- "🏠 Origin" button returns to FreshVibeOrigin template
- **`fv:vc-preview` window event**: when VibeChat builds a new app via `build_freshvibe_app`, the panel dispatches this event with the app name. The app browser auto-refreshes + auto-shows the new app in the iframe.
- Mobile responsive: top:64px on small viewports
3. Slash commands in PM2 VibeChat
- `/help` — show commands + 22 tools list
- `/settings` — show current settings
- `/remit` — show dev remit contract
- `/evolve` — show self-improvement plan
- `/imagine <prompt>` — generate image via `/api/tools/image`
- `/clear` — clear current thread
- `/preview <appName>` — show built app in origin canvas
4. Vibechat panel tool_call → preview event
- When `build_freshvibe_app` tool succeeds, panel dispatches `fv:vc-preview` with the new app name
- App browser refreshes list and shows new app
- Operator sees the built app live in iframe without leaving VibeChat
Verification (Playwright, partial — see notes)
✅ Verified
| Test | Prompt | Result |
|---|---|---|
| /help | "show help" | Returns full command + tools list (vibechat-pm2-port/legacy) |
| /preview <app> | "preview oscar-cms4-cssfix-20260813-061643" | Iframe loads https://oscar-cms4-cssfix-20260813-061643.freshvibeapps.com/ |
| deploy_info | "What is the current deploy status?" | Tool call → JSON response {hostname: "ubuntu", uptime: ..., nodeVersion: "v20.20.2", ...} |
| read_file | "Read /var/www/freshvibeapps/clients/vibecoder/index.html" | Tool call → first 5 lines returned with assistant summary |
| list_files (legacy) | "list files in /workspace" | Tool call → 403 (path not allowed — bridge restricts to /var/www/freshvibeapps/) |
| App browser | (page load) | Lists 1 app, click opens iframe, close returns to origin |
⚠️ Partial / known issues
| Issue | Status |
|---|---|
| App oscar-cms4-cssfix-20260813-061643.freshvibeapps.com returns VibeCoder HTML | The bridge has the annotation but no actual static deployment — same etag as vibecoder. Not a preview canvas bug; needs separate deploy. |
| 8-prompt full test was timing out in headless Chrome | Agent responses are slow (15-30s per turn). 8 prompts × 30s = 4+ min which exceeds sandbox time. Need to run prompts in parallel or use run_in_background. |
| list_files returns 403 for /workspace | Bridge restricts to /var/www/freshvibeapps/clients/* paths. Need to use absolute paths in that root. |
Bundle stats
- `main-BhJfLT72.js`: 746KB (was 678KB before agent code — +68KB for 8 agent files)
- `main-CJ0zLOGG.css`: 254KB (unchanged)
- `client-BCE9PEVS.js`: 143KB (chunk)
- `VibeChatApp-CdBo9O1E.js`: 176KB (legacy React VibeChat, still bundled but not loaded by default)
- `MonacoEditorPage-CskMNVW4.js`: 3.3MB (loaded on /editor route only)
Open questions for operator
- **Run the actual 8-prompt test interactively** — the agent is working but slow. I can run them in background tasks.
- **Settings panel UI** — the legacy had Guided/Semi-auto/Full-auto + max plan steps + remit budget. Current PM2 panel has the chat-only surface. Want me to port the settings panel as a chrome-level modal?
- **Auto-show preview on build** — currently the panel only fires fv:vc-preview on `build_freshvibe_app` success. If the operator wants preview on other actions (deploy, list, etc), need a more general mechanism.
- **What is `oscar-cms4-cssfix-20260813-061643`?** — the bridge has it but the static files aren't deployed. Should we deploy it or remove it from the registry?
Branch state
- `legacy-toggle`: c117016 → 76017ec → 660e245 (PUSHED)
- `main`: c8a8c6b (unchanged — opt-in via URL param)
- `vibechat-pm2-port`: (separate worktree, can be discarded — all work merged into legacy-toggle)
Lesson
The agent code was sitting in origin/day10-vibechat-pm2-only for days. The blocker was that it was TS while the live was JS — and I didn't realize Vite resolves ../agent/core to either .js OR .ts automatically. The fix was 137KB of files I had been afraid to merge.
Cross-project: when something exists in a side branch that you need on main, do a git ls-tree -r to see the files, copy them in, build, test, commit, push. The full merge ceremony is sometimes overkill.