fix: bake the resolved homeboy path into AGENTS.md guidance - #577
Open
chubes4 wants to merge 1 commit into
Open
Conversation
The emitted guidance block resolved the homeboy binary by walking
getenv('PATH') at AGENTS.md compose time. AGENTS.md is recomposed by
whichever process happens to trigger it — PHP-FPM, cron, a plugin
upgrade, a WP-CLI call with a trimmed environment — and none of those
inherit an interactive PATH. On a host with homeboy installed and
executable the section silently deleted itself.
Resolve the absolute path once at sync time, where guidance_applies()
already runs 'type -P homeboy', and bake it into the block. The
compose-time check becomes a single is_executable() on that path.
This deletes the PATH walk rather than guarding it, and preserves the
#254 live gate: losing the binary still drops the section at compose
time with no wp-coding-agents sync.
Fixes #575
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.
Fixes #575.
Problem
The emitted guidance block resolved
homeboyby walkinggetenv('PATH')at AGENTS.md compose time. AGENTS.md is recomposed by whichever process triggers it — PHP-FPM, cron, a plugin upgrade, a WP-CLI call with a trimmed environment — and none of those carry an interactive PATH.Observed live on a host with homeboy installed and executable:
AGENTS.mdsilently dropped from 81 lines / 5 sections to 54 / 4. The deleted section is the one instructing the agent to route tracked work through Homeboy, so the failure quietly reverts agent behavior.Change
Resolve the absolute path once at sync time, where
guidance_applies()already runstype -P homeboy, and bake it into the block. The compose-time check becomes a singleis_executable().The PATH walk is deleted, not guarded — about 20 lines of PHP removed.
The #254 live gate is preserved
Still re-checked at every compose, so a host that loses the binary stops emitting the section with no wp-coding-agents sync. The existing
Homeboy guidance is removed when Homeboy becomes unavailableassertion passes unchanged.Verification
bash tests/agents-md-guidance.sh— all assertions pass.Three new assertions, and I confirmed they go red against the old implementation rather than assuming they were meaningful:
The third executes the generated mu-plugin under
putenv('PATH=')— the exact live condition — and asserts the section still registers and renders.Emitted PHP linted with
php -l.🤖 Authored by chubes-bot (Claude). Finalized outside Homeboy under explicit operator authorization: Cook could not admit the task on this host because its
opencoderoute is missingAI_PROVIDER_OPENAI_CODEX_*credentials. Bounded recovery was attempted first —--preview, nativehomeboy worktree create, backend rotation,homeboy upgrade0.360.4 → 0.367.9, andhomeboy daemon recover. Work was done in the linked isolated worktreewp-coding-agents@fix-issue-575-homeboy-guidance-path.