Skip to content

fix: resolve nightly agent test failures for droid and opencode#1725

Merged
svarlamov merged 4 commits into
mainfrom
devin/1782980040-fix-nightly-agent-tests
Jul 6, 2026
Merged

fix: resolve nightly agent test failures for droid and opencode#1725
svarlamov merged 4 commits into
mainfrom
devin/1782980040-fix-nightly-agent-tests

Conversation

@Siddhant-K-code

@Siddhant-K-code Siddhant-K-code commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

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_hooks only checked ~/.factory dir existence. When droid CLI installs to ~/.local/bin without creating ~/.factory/, check_hooks returned tool_installed: false and git-ai install skipped 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 GeminiInstaller and OpenCodeInstaller.

OpenCode — command not found (exit 127): opencode-ai@next renamed its binary from opencode to opencode2. The workflow hardcoded opencode --version in verification.

Fix: resolve binary names dynamically via npm view <pkg> bin --json at matrix build time, pass matrix.binary_name through, and use it in:

  • "Verify agent binary is present" step (uses ${{ matrix.binary_name }} instead of hardcoded case)
  • verify-hook-wiring.sh (accepts optional binary_name arg)
  • test-live-agent.sh (all five agents now use $BINARY_NAME consistently)

Also updated OpenCodeInstaller::check_hooks to detect opencode2 via binary_exists("opencode") || binary_exists("opencode2") and added "opencode2" to process_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. Uses with_temp_home + with_fake_binary_on_path helpers following the existing gemini.rs pattern.

Cleanup: Removed dead headless_cmd binary-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


Open in Devin Review

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>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

devin-ai-integration[bot]

This comment was marked as resolved.

Siddhant-K-code and others added 3 commits July 2, 2026 08:27
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>
@svarlamov svarlamov merged commit 8647d98 into main Jul 6, 2026
36 checks passed
@svarlamov svarlamov deleted the devin/1782980040-fix-nightly-agent-tests branch July 6, 2026 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nightly agent integration failure: 2026-07-02

2 participants