Problem
On WordPress Studio installs, wp-coding-agents correctly detects the WordPress command transport as studio wp, but a successfully composed AGENTS.md prescribes bare commands such as:
wp --path=/Users/example/Studio/site intelligence search <query>
wp --path=/Users/example/Studio/site datamachine-code workspace list
Bare wp is not available in the non-interactive agent shell. studio wp intelligence search ... works.
This caused an OpenCode session to fail every prescribed Intelligence and Data Machine Code command before the operator corrected the transport.
Root cause
runtimes/opencode.sh::runtime_generate_instructions() has two paths:
- The static-template fallback computes
wp_cli_display and substitutes studio wp for Studio.
- The normal path runs
wp_cmd datamachine memory compose AGENTS.md and returns immediately on success.
The comment says composition handles WP-CLI prefix resolution automatically, but the resulting composed file contains environment-specific absolute --path values prefixed by bare wp. The transport detected by wp-coding-agents is not provided to or reflected by composed SectionRegistry content.
The same risk applies to other non-bare transports and to Codex/Claude Code composition paths.
Desired contract
Generated agent guidance must use the same resolved WordPress control transport that setup and runtime commands actually use.
The solution should preserve section ownership: Intelligence, Data Machine, and Data Machine Code own their command guidance, while wp-coding-agents owns runtime transport detection and composition orchestration. Transport values must remain structured runtime context rather than ad hoc global text replacement.
Acceptance criteria
- A Studio fixture composes
AGENTS.md whose executable WordPress commands use studio wp, with no bare wp --path=... instructions.
- A colocated WP-CLI fixture continues to use its resolved
wp command and path flags.
- An external/portable runtime fixture uses its declared control wrapper without exposing credentials in guidance.
- OpenCode, Codex, and Claude Code use the same transport-aware composition contract.
- SectionRegistry contributors can express WordPress commands without hardcoding one host transport.
- A test executes at least one generated Intelligence or Data Machine command through the composed transport, rather than asserting only static text shape.
- Existing
AGENTS.md files are regenerated or diagnosed when their rendered transport no longer matches the detected runtime transport.
Reproduction
- Install/upgrade
wp-coding-agents on a WordPress Studio site.
- Compose the normal SectionRegistry-backed
AGENTS.md.
- Start a non-interactive OpenCode shell.
- Run the prescribed
wp --path=<studio-site> intelligence search test; observe command not found: wp.
- Run
studio wp intelligence search test; observe that WP-CLI executes.
AI assistance
- Model: OpenAI gpt-5.6-sol
- Tool: OpenCode
- Used for: Reproduced the command failure, verified the working Studio transport, inspected runtime generation and transport detection paths, searched existing trackers, and drafted this issue under Chris Huber's direction.
Problem
On WordPress Studio installs,
wp-coding-agentscorrectly detects the WordPress command transport asstudio wp, but a successfully composedAGENTS.mdprescribes bare commands such as:Bare
wpis not available in the non-interactive agent shell.studio wp intelligence search ...works.This caused an OpenCode session to fail every prescribed Intelligence and Data Machine Code command before the operator corrected the transport.
Root cause
runtimes/opencode.sh::runtime_generate_instructions()has two paths:wp_cli_displayand substitutesstudio wpfor Studio.wp_cmd datamachine memory compose AGENTS.mdand returns immediately on success.The comment says composition handles WP-CLI prefix resolution automatically, but the resulting composed file contains environment-specific absolute
--pathvalues prefixed by barewp. The transport detected bywp-coding-agentsis not provided to or reflected by composed SectionRegistry content.The same risk applies to other non-bare transports and to Codex/Claude Code composition paths.
Desired contract
Generated agent guidance must use the same resolved WordPress control transport that setup and runtime commands actually use.
The solution should preserve section ownership: Intelligence, Data Machine, and Data Machine Code own their command guidance, while
wp-coding-agentsowns runtime transport detection and composition orchestration. Transport values must remain structured runtime context rather than ad hoc global text replacement.Acceptance criteria
AGENTS.mdwhose executable WordPress commands usestudio wp, with no barewp --path=...instructions.wpcommand and path flags.AGENTS.mdfiles are regenerated or diagnosed when their rendered transport no longer matches the detected runtime transport.Reproduction
wp-coding-agentson a WordPress Studio site.AGENTS.md.wp --path=<studio-site> intelligence search test; observecommand not found: wp.studio wp intelligence search test; observe that WP-CLI executes.AI assistance