fix: resolve nightly agent test failures for droid and opencode#1725
Merged
Conversation
Two root causes addressed:
1. DroidInstaller::check_hooks only checked for ~/.factory dir, missing
the droid binary on PATH. When droid CLI installs to ~/.local/bin
without creating ~/.factory, git-ai install skipped hook setup entirely.
Fix: check binary_exists("droid") alongside the dotfiles check, matching
the pattern used by GeminiInstaller and OpenCodeInstaller.
2. opencode-ai@next renamed its binary from 'opencode' to 'opencode2'.
The workflow hardcoded 'opencode --version' which fails with exit 127.
Fix: resolve binary names dynamically from npm package metadata at matrix
build time, pass through matrix.binary_name, and use it in verification
and test scripts. Also update OpenCodeInstaller to detect opencode2.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Apply resolved binary name consistently for claude, codex, and gemini in addition to droid and opencode. Ensures nightly tests remain robust if any agent pre-release renames its CLI binary. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…omputation - Add serial tests for droid check_hooks: verifies binary-on-PATH detection without ~/.factory, no-binary-no-dotfiles, dotfiles-only, and full install flow from binary detection. - Add serial tests for opencode: process_names includes opencode2, opencode2 binary detection, no-binary-no-config, and install flow from opencode2 detection. - Remove dead headless_cmd binary-name replacement (field was pre-existing dead code; stop computing a binary-name-aware variant for it). Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The headless_cmds dictionary and headless_cmd matrix field were never consumed by any workflow step. Remove them entirely to reduce confusion. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.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
Fixes the persistent nightly failures in "Tier 1: droid latest" and "Tier 1: opencode latest" jobs (failing daily since at least 2026-06-22). Closes #1723.
Droid —
settings.json not found:DroidInstaller::check_hooksonly checked~/.factorydir existence. When droid CLI installs to~/.local/binwithout creating~/.factory/,check_hooksreturnedtool_installed: falseandgit-ai installskipped hook setup entirely.fn check_hooks(&self, _params: &HookInstallerParams) -> Result<HookCheckResult, GitAiError> { + let has_binary = binary_exists("droid"); let has_dotfiles = home_dir().join(".factory").exists(); - if !has_dotfiles { + if !has_binary && !has_dotfiles { return Ok(HookCheckResult { tool_installed: false, ... });This matches the pattern already used by
GeminiInstallerandOpenCodeInstaller.OpenCode —
command not found(exit 127):opencode-ai@nextrenamed its binary fromopencodetoopencode2. The workflow hardcodedopencode --versionin verification.Fix: resolve binary names dynamically via
npm view <pkg> bin --jsonat matrix build time, passmatrix.binary_namethrough, and use it in:${{ matrix.binary_name }}instead of hardcoded case)verify-hook-wiring.sh(accepts optionalbinary_namearg)test-live-agent.sh(all five agents now use$BINARY_NAMEconsistently)Also updated
OpenCodeInstaller::check_hooksto detectopencode2viabinary_exists("opencode") || binary_exists("opencode2")and added"opencode2"toprocess_names().Tests: Added 8 new
#[serial]unit tests covering detection logic for both installers — binary-on-PATH without dotfiles, no-binary-no-dotfiles, dotfiles-only, and full install flows from binary detection. Useswith_temp_home+with_fake_binary_on_pathhelpers following the existinggemini.rspattern.Cleanup: Removed dead
headless_cmdbinary-name replacement computation (pre-existing dead field; no longer adding unnecessary.replace()on top).Link to Devin session: https://app.devin.ai/sessions/593476fb73c54d249654129305965de2
Requested by: @Siddhant-K-code