Skip to content

fix: only offer integrations for agents whose config dir exists - #5745

Open
dhh wants to merge 2 commits into
herdrdev:masterfrom
dhh:offer-integrations-once-config-dir-exists
Open

dhh wants to merge 2 commits into
herdrdev:masterfrom
dhh:offer-integrations-once-config-dir-exists

Conversation

@dhh

@dhh dhh commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

The settings integrations panel offers every agent whose command is on PATH, but the installers refuse to run until the agent's config directory exists, which only happens after the agent's first run. Any agent that's installed but has never run is shown as available, and pressing install fails on it:

grok config directory not found at ~/.grok. install grok cli first

This is common on setups that put agent commands on PATH before they are used, such as mise lazy shims. On Omarchy that is around 15 agents, so the install action fails every time.

The recommendation is now available only when the agent is on PATH and the directory its installer requires already exists. Pi and OMP need only the parent of their extensions directory, which matches ensure_extension_dir. Mastra Code's installer creates its own directory, so it's unchanged. integration_target_available keeps meaning "the agent is installed", so the Windows availability tests are untouched. Installed or outdated integrations are still listed as before.

The first commit fixes a test race this exposed: letta_staged_install_can_restore_the_prior_file called unique_base(), which clears XDG_CONFIG_HOME, without the env lock. With the new test, that reliably broke install_opencode_and_kilo_use_xdg_config_home in parallel runs.

Tests: cargo test --bin herdr integration:: gives 192 passed, both in parallel and with --test-threads=1. The new test fails without the registry change. cargo fmt --check and cargo clippy --all-targets are clean.

🤖 Generated with Claude Code

dhh and others added 2 commits November 1, 2026 20:10
unique_base() clears the integration env vars, so calling it without the
lock can wipe XDG_CONFIG_HOME while another test is mid-install.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The installers refuse to create an agent's config directory, so an agent
that is on PATH but has never run was offered as available and then
failed to install. Mark it available once that directory exists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 93062f4b-2e9f-44e1-86de-dcab2264011c
Commits

Reviewing files that changed from the base of the PR and between ee5bfb5 and 7a76d01.

Files selected for processing: 2
  • src/integration/registry.rs
  • src/integration/tests.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

Uninstalled integration targets are now recommended as available only when the target is available and its configuration directory is present. Pi and OMP check the parent of their extension directory; Mastra Code always passes the directory check. Installed targets remain available. A Unix-only Droid test checks recommendations before and after creating ~/.factory. The staged Le tta rollback test now acquires the integration environment lock.

Possibly related PRs

  • herdrdev/herdr#5585: Updates directory-resolution functions that this change uses to check OpenCode and Kilo configuration-directory presence.

Suggested reviewers: ogulcancelik

Merge Risk: Minimal · up to 7a76d

Recommendations now account for installer directory requirements. No actionable merge-blocking issue was identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: limiting integration offers to agents whose configuration directories exist.
Description check Passed The description directly explains the configuration-directory issue, the implementation scope, the test-race fix, and the reported validation.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 2 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@kangal-bot

Copy link
Copy Markdown
Collaborator

@coderabbitai review
@greptileai

@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@greptile-apps

greptile-apps Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

The PR stops recommending new integrations until their required config directories exist.

  • Settings offer agent installs only when their install location is ready.
  • The Letta rollback test takes the shared environment lock.

Reviews (1) · Last reviewed commit: "fix: only offer integrations for agents ..." · Reviewed by Greptile

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.

2 participants