Regeneration-Prompt: |
Address the live PR review comment on plugin-subagent provider/model override forwarding.
A one-off per-run provider/model override in agentCommand must stay non-persistent: it should
not clear a stored session authProfileOverride, and it also should not pass that stored auth
profile into the temporary cross-provider run. Keep the existing persisted override cleanup
behavior for real session/default provider mismatches. Add a regression test in
src/commands/agent.test.ts that seeds a session with an Anthropic auth profile, runs a single
OpenAI override, verifies the run uses the override without an auth profile, and confirms the
stored auth profile fields remain intact.
Regeneration-Prompt: |
Rebase PR #48277 onto current origin/main without changing its intent: gateway-owned plugin subagent runs should be able to forward per-run provider and model overrides through the internal agent RPC, while admin-only gating stays in the gateway agent handler.
After rebasing, keep the PR scoped to prep fallout instead of broad unrelated cleanup. Commit the generated Swift protocol models required by adding provider/model to AgentParams, add the required Unreleased changelog entry, and update the new commands/agent test fixture so the explicit openai/gpt-4.1-mini override is allowed under the current model allowlist rules. Do not fold in unrelated existing main-branch test failures.
Keep plugin subagent provider/model overrides working for synthetic admin dispatch, but stop forwarding those overrides for plain operator.write gateway callers. Add regressions for both the admin-allowed and write-scoped paths.
Regeneration-Prompt: |
After the first fix for PR #48277, Codex flagged that gateway agent requests were now forwarding provider/model overrides for every operator.write caller. Verify that claim against the current gateway trust model and method scopes.
Preserve the plugin subagent use case, which dispatches with the synthetic admin gateway client, but restore least-privilege behavior for normal write-scoped agent RPC callers. The boundary should be enforced at the gateway handler so the core agent command path can still support trusted callers. Add focused tests proving admin callers keep override forwarding while write-scoped callers do not.
Allow plugin subagent runs to pass provider/model overrides through the typed runtime, gateway validation, and ingress agent path. Apply explicit per-run overrides without persisting them to session state, and cover the gateway + agent behavior with regressions.
Regeneration-Prompt: |
PR #48277 already forwarded provider and model from plugin subagent runtime calls, but review found two contract gaps: the typed plugin runtime did not declare those fields, and the gateway agent RPC rejected them because the schema and handler path did not accept or propagate them. Make the override path end-to-end valid without broad refactors.
Keep the change additive. Extend the plugin runtime and gateway agent request types just enough to carry provider/model overrides. Ensure gateway ingress passes those fields into the existing agent command path, and let agent runs honor explicit per-call overrides without persisting them as session overrides. Add focused regression coverage for the gateway forwarding path and for non-persistent per-run overrides.
The "treats bundle MCP as a supported bundle surface" test was missing
the useNoBundledPlugins() call present in all surrounding bundle plugin
tests. Without it, loadOpenClawPlugins() scanned and loaded the full
real bundled plugins directory on every call (with cache:false), causing
excessive memory pressure and an OOM crash on Linux CI, which manifested
as the test timing out at 120s.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>