Repository navigation
feat: add OpenCode agent support - #1227
chensational wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 25935d3bcd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| execSync(`command -v ${command} >/dev/null 2>&1`, { stdio: 'ignore' }); | ||
| return true; | ||
| } catch { | ||
| return commandExistsInCommonUserPaths(command); |
There was a problem hiding this comment.
Keep availability tied to an executable command
When the daemon's PATH does not include one of these common user bin directories (for example a launchd/systemd-started daemon with opencode only at ~/.local/bin/opencode), this fallback reports the CLI as available even though the later OpenCode path still spawns opencode by name with process.env in AcpBackend, not the absolute candidate path or an augmented PATH. The app will offer the agent and the session then fails with ENOENT; either add the discovered directory to the spawned environment or only report true for commands actually resolvable from the daemon environment.
Useful? React with 👍 / 👎.
Summary
Adds OpenCode as a first-class Happy agent through the existing ACP runner.
The main runtime issue was that OpenCode ACP could crash or hang when Happy sessions shared the large/global OpenCode database. This PR gives Happy-launched OpenCode sessions a per-session
OPENCODE_DBunder the Happy home directory, while preserving an explicitly configuredOPENCODE_DB.What Changed
happy opencodeas a dedicated CLI entry point backed by ACP.Scope Notes
happy openclawbehavior is preserved.opencodeCommand.tsapproach is not included.Verification
Passed:
Known unrelated existing failure:
pnpm --filter happy-agent exec vitest runThe full
happy-agentsuite still has 5 staleX-Happy-Clientheader expectation failures insrc/api.test.tsandsrc/auth.test.ts.