Repository navigation
fix: find opencode in its installer's folder on check again - #36707
bolichen97 wants to merge 1 commit into
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: a small, additive search rung on one harness's own launch record. It is searched after PATH and mise, so no binary that resolves today changes. Notes
[DESIGN-REVIEWED] 7c7629b Description read[DESCRIPTION-READ] 884e127d1bfe619f3af9951a760296944a01266f5c406b537e6525efc84ebf26 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks: the fix makes the existing resolver search one folder ( Notes
What this change shipsInventory (4 items) — 3 justifiedIntent: let a user who installs OpenCode with its own installer while the gateway runs press Check again and use it with no restart. FIX.
[FIRST-PRINCIPLES-REVIEWED] 7c7629b Description read[DESCRIPTION-READ] 6df931f5c1dfbce4f56d0e9b0bdafc4b0abc34f089e562bacfc834e1d50536f4 That sha256 names the PR description this verdict read. Recompute it with |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Code change approver recommendation: ApproveWhy: the decider estimates an 8% chance that this change introduces a defect, within the 12% limit for approving on its own, and every check passes. Adds An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
|
[operator: bolichen97] The four red checks on this head are main's, not this PR's.
main's own push run in the same window failed in exactly the same two jobs with the same signature: https://github.com/kirodotdev/KiroCrew/actions/runs/43458639790 (main, head The shard-7 runner pressure behind it is tracked in #36261, and #36653 is the open fix that cuts that shard's memory. This PR carries no fix for it and is neither pushing nor overriding for this red: the occurrence is recorded on #36261 and the failed jobs get their one rerun. Every other check on this head passes, every review lane is PASS or no-blocking-findings, and no review thread is open. |
OpenCode's official installer puts the binary in ~/.opencode/bin and adds that folder to PATH only for new shells. A gateway started before the install never saw it, so Settings > Agent Harness kept showing OpenCode as not installed and Check again changed nothing until the gateway restarted. A self-served harness's launch record can now name the folders its own installer uses; the shared resolver searches them after PATH. OpenCode names ~/.opencode/bin, so the install probe and the spawn both find it without a restart. Other harnesses are unchanged.
|
[operator: bolichen97] Rebased onto current main to resolve the merge conflict in docs/guides/local-and-hosted-models.md and docs/system-specs/modules/agent-host-contract.md. |
631f2a0 to
7c7629b
Compare
Problem / Motivation
Goal: Check again in Settings → Agent Harness finds an OpenCode that its own installer put in place while the gateway was running, with no restart.
On a running gateway, installing OpenCode with its official installer (
curl -fsSL https://opencode.ai/install | bash) leaves the OpenCode card at Not installed. Pressing Check again changes nothing, and Use OpenCode stays disabled until the gateway restarts.Why it matters
The card tells a new user to install OpenCode and then press Check again. Anyone who follows that advice with OpenCode's own installer, on Linux or Windows, sees the button do nothing, so they conclude the install failed or Kiro Crew is broken. The only way out today is a restart that nothing on the page mentions.
Not a goal
opencoderesolve for agent shell commands or MCP servers. This is about the OpenCode harness itself.What changed (motivation → approach → change)
OpenCode installed by its own installer is now found by Check again, and by the next session, without a restart.
The installer puts the binary in
~/.opencode/binand adds that folder to PATH only for shells started afterwards. The gateway's install check and its session spawn search the PATH the gateway started with plus a fixed list of well-known folders. That folder was in neither, so the binary stayed invisible.A self-served harness's launch record (
SelfServedLaunchinagent_sdk/backends_launch.py) can now name the folders its own installer uses (install_dirs). The shared resolver (_resolve_self_served_bininacp/launch.py) searches them after PATH, so a binary on PATH or under mise still wins. Only OpenCode names one:~/.opencode/bin, which is under%USERPROFILE%on Windows. The harness-onboarding spec and the local-models guide say so.Backwards compatibility
Compatible: the folder is searched only after everything searched today, so an OpenCode that resolves now keeps resolving to the same binary, and every other harness searches exactly what it did.
Removes nothing: the change only adds one folder to one harness's search.
Tests
test/test_agent_backend_recheck_e2e.py::TestRecheckOverHttp::test_opencode_from_its_own_installer_is_found_on_recheckdrives the real routes over HTTP. OpenCode first readsmissing; an executable then appears in<home>/.opencode/binwhile PATH and mise find nothing; the re-check reports itinstalledwith no restart needed.Red before, green after: with only this test file copied onto the base, the test fails with
AssertionError: assert 'missing' == 'installed'; on this change it passes. Determinism: 20/20 runs at-n0; 10/10 runs at-n 4 --dist loadgrouptogether withtest/test_agent_sdk_backend_install.pyandtest/test_acp_opencode_backend.py(266 passed each); the file's 10 tests in a shuffled order (seed 1842874382): 10 passed.Proof: PROVEN test/test_agent_backend_recheck_e2e.py::TestRecheckOverHttp::test_opencode_from_its_own_installer_is_found_on_recheck (head a5b9ba2e420d)
prove.pyran ona5b9ba2e420d, which has the same code and tests as this head; only one test docstring line and one spec table cell differ.Manual verification
Run on a fresh Ubuntu 24.04.5 LTS machine (x86_64, Python 3.12.3) against a real gateway: an isolated
KIROCREW_HOME, a freshHOME, and a gateway PATH without~/.opencode/bin, exactly as a user who installs OpenCode after starting Kiro Crew. OpenCode was installed while the gateway ran, with its official installer (curl -fsSL https://opencode.ai/install | bash, OpenCode 1.19.5 into$HOME/.opencode/bin).On the base (
c22557cd8), both re-checks 30 s apart still say missing:With this change, same steps, first re-check:
The last line is the session spawn finding the same binary the card reports.
Gates, on the same machine: every static gate in the project's gate list (black, isort, flake8,
mypy src/kiro_crew/, comment history, brand name, harness parity, sync I/O in async, loop-bound locks, docs lint, vendor manifest and the rest) exits 0 on this head's tree, as does semgrep on the diff (0 findings) and the flake-pattern ratchet. The backend related-test set: 24754 passed, plus 2 teardown errors intest/test_live_target_pointer_visibility.pyandtest/test_sandbox_mount_pinned_target.pythat the base shows identically. No frontend file changes; the frontend gates that were red (render-time i18n, the Electron test, the bundle-size build, the frontend related set) are red the same way on the base.Screenshots / video
Settings → Agent Harness on the same fresh Ubuntu machine, after OpenCode was installed with its official installer while the gateway ran and Check again was pressed. No dashboard code changed; these show the card's verdict.
Before (base): OpenCode still Not installed, Use OpenCode disabled.
After (this change): OpenCode Installed, Use OpenCode enabled.
Related Issues
Closes #36375
Sibling sweep
Swept:
git grep -nE "install_command=" -- src/kiro_crew/agent_sdk/backends_launch.pySibling: src/kiro_crew/agent_sdk/backends_launch.py:233 -- changed here
Sibling: src/kiro_crew/acp/harness/goose.py -- not affected -- goose's download_cli.sh installs into ~/.local/bin, which the gateway already searches
Sibling: src/kiro_crew/acp/harness/deepseek.py -- not affected -- installed with npm i -g, whose global bin folder the gateway already searches
Sibling: src/kiro_crew/acp/harness/copilot.py -- not affected -- installed with npm i -g, whose global bin folder the gateway already searches
Sibling: src/kiro_crew/acp/harness/strands.py -- not affected -- installed with npm i -g, whose global bin folder the gateway already searches
Sibling: src/kiro_crew/acp/harness/mimocode.py -- not affected -- installed with npm i -g, whose global bin folder the gateway already searches
Pattern harvest
Not generalizable: where a harness's own installer puts its binary is a fact about that one harness, and it now lives on that harness's launch record.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)