Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions apps/backend/agents/coder.py
Original file line number Diff line number Diff line change
Expand Up @@ -962,12 +962,21 @@ def _validate_and_fix_implementation_plan() -> tuple[bool, list[str]]:
):
route_allowed_providers = {"claude", "codex"}

explicit_provider_pin = os.environ.get(
f"AGENT_PROVIDER_{agent_type_for_session.upper()}"
)
if (
next_subtask
and current_phase == "coding"
and not override_model
and model is None
and not is_phase_model_locked(spec_dir, current_phase)
# ADR-006 precedence: an explicit per-agent provider pin is the
# strongest operator intent; cost-based smart routing must not
# silently re-route the session to another provider (live-build
# finding, 2026-06-12: AGENT_PROVIDER_CODER=openai was discarded
# in favor of claude).
and not explicit_provider_pin
):
route = TaskComplexityRouter().route(
next_subtask,
Expand All @@ -985,6 +994,13 @@ def _validate_and_fix_implementation_plan() -> tuple[bool, list[str]]:
"info",
)
logger.info("Smart routing selected: %s", route)
elif explicit_provider_pin and next_subtask and current_phase == "coding":
print_status(
"Smart routing skipped: AGENT_PROVIDER_"
f"{agent_type_for_session.upper()}={explicit_provider_pin} "
"pins the provider",
"info",
)

runner_route = resolve_runtime_runner_route(
provider_config=provider_config,
Expand Down
6 changes: 5 additions & 1 deletion apps/backend/cli/build_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,11 @@ def handle_build_command(
)
else:
reason = "review_required"
details = "This spec requires human approval before building."
details = (
"This spec requires human approval before building. "
"Approve it in the Auto Code UI, or pass --force to "
"bypass the approval check in CI/headless runs."
)
print(
format_build_result(
status=ExitCode.BUILD_FAILED,
Expand Down
Loading