feat(workspaces): auto-detect installed agent runtimes + frontend install guidance#366
Merged
Merged
Conversation
…tall guidance The launcher registers all adapters unconditionally (claude/codex/opencode/ pi/shell), so `/api/workspaces/agents` listed every runtime as if it were ready — even on a fresh box with zero CLIs installed. The only signal a missing runtime gave was a silent ENOENT at spawn time. Bad first-run / bad conversion: the user has no idea what to install. Backend: - New `agent-detect.ts`: cross-platform PATH probe (POSIX walk + win32 PATH×PATHEXT, so npm `.cmd` shims for opencode/pi resolve). Pure fs lookup, no spawn — cheap enough to re-run per list call, so a CLI installed mid-session shows up on the next poll. - `CliAdapter.binary` declares each adapter's canonical PATH binary; shell omits it (runs `$SHELL`, always present → reported installed). - `WorkspaceService.detectAgents()` + `/agents` now returns `installed` + `binPath` per agent (additive, backward-compatible). Frontend: - `AgentInfo` gains `installed?`/`binPath?`. - Quick-chat landing defaults to the first INSTALLED runtime, marks missing ones in the picker, and shows install guidance (command + docs link). When nothing is installed, a prominent "install a coding-agent CLI" nudge. - Template cards dim runtimes not on PATH. - `agentInstall.ts` holds best-effort install commands + authoritative docs URLs. i18n keys across en/zh/zh-Hant/ja. - Demo handler reports all agents installed (no host to probe). Detection is a hint, not a gate — send still attempts (PATH probing can be wrong), it just tells the user what to install. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BaBzYZBSrGRMauMkhyDXMh
…ng-agent) The pi runtime ships its `pi` bin from @earendil-works/pi-coding-agent; fill in the install hint that was left as docs-link-only. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BaBzYZBSrGRMauMkhyDXMh
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
… load ChatLandingPage derived `anyInstalled` from the agents list, which is `[]` until the async `/agents` fetch lands — so `[].some(isInstalled)` was false and the amber "nothing installed, go install something" guidance flashed on every page load before the real (installed) result arrived. Gate the nudge on `agentsKnown` (cliAgents.length > 0): the backend registers claude/codex/opencode/pi/shell unconditionally, so a loaded list always has ≥1 CLI agent; an empty list means "still loading" (or fetch failed) — neither should assert the host is missing its runtimes. Mirrors the `hasLoaded` guard the workspaces list already uses against the same empty-initial-state trap. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
3 tasks
yodaliu
pushed a commit
to yodaliu/OpenAlice
that referenced
this pull request
Jun 22, 2026
Since beta.3: - feat(workspaces): auto-detect installed agent runtimes + install guidance (TraderAlice#366) - feat(workspaces): quick-chat AI-config injection for loginless runtimes opencode/pi (TraderAlice#367) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/api/workspaces/agentslisted every runtime as ready even on a fresh box — the only signal a missing CLI gave was a silentENOENTat spawn time. Bad first-run / bad conversion: the user had no idea what to install.agent-detect.tsdoes a cross-platform PATH probe (POSIX walk + win32 PATH×PATHEXT, so opencode/pi npm.cmdshims resolve). Pure fs lookup, no spawn — cheap enough to re-run per list call, so a CLI installed mid-session shows up on the next poll.CliAdapter.binarydeclares each adapter's canonical bin (shell omits it → always installed)./agentsnow returnsinstalled+binPathper agent (additive, backward-compatible).agentInstall.ts; i18n across en/zh/zh-Hant/ja. Demo handler reports all installed (no host to probe).npm ion the user's machine is a product decision left out by design).Test plan
npx tsc --noEmitclean (Alice src/)cd ui && npx tsc -bclean (UI strict)pnpm testpasses (2012 tests, incl. 8 new inagent-detect.spec.ts)Boundary touch
None — no trading / auth / broker-credential / migration paths touched.
🤖 Generated with Claude Code
Generated by Claude Code