refactor(agent): move placeholder env injection into agent_provision_plan
test / unit (pull_request) Successful in 29s
test / integration (pull_request) Successful in 42s

The has_provider_auth check and egress-placeholder injection were
duplicated in both backends. Move them into agent_provision_plan so
the provisioner owns that decision entirely:

- Replace has_provider_auth: bool param with manifest_egress_routes,
  compute has_provider_auth internally from the route roles.
- Inject CLAUDE_CODE_OAUTH_TOKEN=egress-placeholder inside the plan
  when has_provider_auth, alongside the existing nonessential-traffic
  vars. Backends no longer touch the placeholder env.
- Remove placeholder_env from AgentProviderRuntime; expose
  placeholder_env_for() for print_util's hide-from-summary logic.

Assisted-by: Claude Code
This commit is contained in:
2026-06-02 00:57:43 +00:00
parent 86cfd94b72
commit 2eb6e02ee1
5 changed files with 26 additions and 46 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ from __future__ import annotations
from typing import Sequence
from ..agent_provider import runtime_for
from ..agent_provider import placeholder_env_for
from ..log import info
@@ -41,5 +41,5 @@ def visible_agent_env_names(
think a real key is entering the agent, so hide only the active
provider-owned placeholder.
"""
hidden = {runtime_for(agent_provider_template).placeholder_env}
hidden = {placeholder_env_for(agent_provider_template)}
return sorted({name for name in env_names if name and name not in hidden})