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
## Summary
Add an optional `backend` parameter to the `dispatch_food_truck` MCP
tool that selects which coding-agent backend executes the dispatched
child session. When omitted, behavior is byte-for-byte identical to
today (uses `ctx.backend`). When supplied, the per-dispatch backend is
used for: capability gating (`food_truck_capable`), command building
(`build_food_truck_cmd`), pre-launch validation (`ensure_pre_launch`),
recipe admission control (capability overrides,
`backend-incompatible-skill` rule, `effective_backend_map`), session-log
resolution, and record persistence. The `DispatchRecord` gains a
`backend_name` field so downstream consumers (reset, diagnostics,
session-log lookup) resolve against the correct backend. The field is
added to `_RETRY_IDENTITY_FIELDS` so retried dispatches preserve the
backend override.
The implementation follows the existing `run_headless_core` call-local
override pattern: `ctx.backend` is never mutated; a resolved
`CodingAgentBackend` instance is threaded through the dispatch path as a
function argument.
## Requirements
**REQ-HBR-001:** The `dispatch_food_truck` MCP tool
(`server/tools/tools_fleet_dispatch.py`) must accept an optional
`backend` parameter whose accepted values are the names registered in
`BACKEND_REGISTRY` (`"claude-code"`, `"codex"`).
**REQ-HBR-002:** When the `backend` parameter is omitted, dispatch
behavior must be byte-for-byte identical to the current `ctx.backend`
path — zero behavior change for existing single-backend flows.
**REQ-HBR-003:** The child session command must be built via the
per-dispatch backend's `build_food_truck_cmd`, with backend-correct env
injection (`AUTOSKILLIT_AGENT_BACKEND__BACKEND`,
`AUTOSKILLIT_AGENT_BACKEND`, `AUTOSKILLIT_MCP_CLIENT_BACKEND`) so the
child process resolves the per-dispatch backend at boot.
**REQ-HBR-004:** `ensure_pre_launch()` must be invoked on the
per-dispatch backend before spawn (e.g., Codex MCP registration in
`config.toml`).
**REQ-HBR-005:** The `food_truck_capable` capability gate must be
evaluated against the per-dispatch backend, not the kitchen backend.
**REQ-HBR-006:** Recipe admission control and capability overrides must
be computed against the per-dispatch backend:
`_provider_aware_capability_overrides`, the `backend_supports_git_write`
ingredient, `_compute_effective_backend_map`, and the
`backend-incompatible-skill` validation rule
(`server/tools/_auto_overrides.py`,
`recipe/rules/rules_backend_compat.py`).
**REQ-HBR-007:** Per-dispatch backend selection must compose with
existing provider profiles (e.g., a MiniMax implement-step provider
override via `ANTHROPIC_BASE_URL`) and with the R0 capability-driven
auto-route (#4176) inside the child session — existing provider recipe
overrides must behave identically.
**REQ-HBR-008:** The `DispatchRecord` must persist which backend the
dispatch ran on, so that `reset_dispatch`, diagnostics, and session-log
lookup (Channel B for Claude Code vs `CodexSessionLocator` for Codex)
resolve against the correct backend.
**REQ-HBR-009:** Any `BackendCapabilities` field addition required by
this work must be forward-declared with a tracking entry in
`_FORWARD_DECLARED` in `test_capability_consumption.py`
(frozen-dataclass constraint noted in the forward-obligations doc).
Closes#4179
## Implementation Plan
Plan file:
`.autoskillit/temp/make-plan/dispatch_food_truck_per_dispatch_backend_override_plan_2026-07-04_152400.md`
🤖 Generated with [Claude Code](https://claude.com/claude-code) via
AutoSkillit
<!-- autoskillit:pipeline-signature
steps=prepare_pr,run_arch_lenses,compose_pr,annotate_pr_diff,review_pr
-->
## Token Usage Summary
| Step | Model | count | uncached | output | cache_read | peak_ctx |
turns | cache_write | time |
|------|-------|-------|----------|--------|------------|----------|-------|-------------|------|
| plan* | opus[1m] | 1 | 2.2k | 44.9k | 4.1M | 168.5k | 87 | 149.6k |
22m 37s |
| review_approach* | opus | 1 | 9.2k | 5.3k | 199.4k | 49.0k | 12 |
61.8k | 6m 1s |
| **Total** | | | 11.4k | 50.2k | 4.3M | 168.5k | | 211.4k | 28m 39s |
\* *Step used a non-Anthropic provider; caching behavior may differ.*
## Model Usage Breakdown
| Model | steps | uncached | output | cache_read | cache_write | time |
|-------|-------|----------|--------|------------|-------------|------|
| opus[1m] | 1 | 2.2k | 44.9k | 4.1M | 149.6k | 22m 37s |
| opus | 1 | 9.2k | 5.3k | 199.4k | 61.8k | 6m 1s |
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 commit comments