You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
WP AI Gateway as an opt-in model source for Pi (alongside the Roadie credential pool) #774
The optional WP AI Gateway integration only covers OpenCode, which is retired here. Pi, the active Roadie and Homeboy coding runtime, can't use it.
lib/ai-gateway.sh: ai_gateway_enabled_for_opencode() returns true only when the runtime is opencode.
Setup writes an OpenCode provider.wp-ai-gateway entry and nothing else.
Today Roadie-managed Pi runs on Roadie's credential pool (ROADIE_PI_MODEL=roadie/opus in the rendered unit).
Hosts should get a choice of model source for Pi sessions, including sessions behind the WordPress chat platform (#771/#773):
Roadie credential pool (current default): subscription-backed and pooled in Roadie.
WP AI Gateway: the gateway's OpenAI-compatible /wp-json/wp-ai-gateway/v1 endpoint. Upstream keys stay in WordPress, and usage goes through the WordPress AI client. Roadie and Pi hold only a minted gateway token.
Target state
--with-ai-gateway applies to Pi.
Setup and upgrade write a Pi provider/model entry pointing at the gateway base URL (respect Allow a full WP AI Gateway endpoint override #357's endpoint override if present), with the token from the existing mint/reuse flow.
The Roadie unit's Pi model is set to the gateway model.
Without the flag, Pi stays on the Roadie credential pool, exactly as today.
Keep the existing recursive-topology guard: a gateway route must not point back at the gateway.
Remove the retired OpenCode-only gating, or generalize it, rather than adding a parallel path.
Check how Pi reads custom OpenAI-compatible providers (its models/providers config) before choosing the file to write.
Deliverable
A committed change with tests in tests/ai-gateway.sh:
Pi with the gateway gets the provider entry and model env.
Pi without the gateway keeps the roadie/* model and has no gateway entry.
The token is reused across upgrades.
The topology guard still holds.
Update the bridge snapshots if the rendered unit changes. CHANGELOG and VERSION are release-owned and stay as they are.
Activity
feat(ai-gateway): route Pi sessions through the WP AI Gateway (#774) (#…
chubes4 commentedon Oct 17, 2026
Shipped in #775.