docs(agent): fix stale runtime comments about token injection
amStartTemplateAgent no longer claims OPENAI_API_KEY is uninjected or that access_token is left empty for a future V2 path: the handler now mints + injects both OPENAI_API_KEY and the per-agent AGENT_ACCESS_TOKEN (forwarded as-is), and HM returns its own access_token to the client. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -160,9 +160,9 @@ func amStartTemplateAgent(ctx context.Context, args amStartArgs) (amStartResult,
|
|||||||
}
|
}
|
||||||
env["MODEL_NAME"] = modelName
|
env["MODEL_NAME"] = modelName
|
||||||
env["OPENAI_BASE_URL"] = publicV1BaseURL()
|
env["OPENAI_BASE_URL"] = publicV1BaseURL()
|
||||||
// NOTE: OPENAI_API_KEY is intentionally NOT injected here — the desktop
|
// NOTE: OPENAI_API_KEY and AGENT_ACCESS_TOKEN are already in args.Env (the
|
||||||
// client passes its own api_key per A2A request (CODING_A2A §7). A future
|
// handler mints + injects them before calling us) and are forwarded as-is by
|
||||||
// V2-decrypt path may hand the agent a scoped key instead.
|
// the copy loop above. We don't add model/auth keys here.
|
||||||
|
|
||||||
// env may carry plaintext secrets (db password, blob key…) — warn on http.
|
// env may carry plaintext secrets (db password, blob key…) — warn on http.
|
||||||
base := agentRuntimeClientConfigForMode(agentRuntimeModeAgent).BaseURL
|
base := agentRuntimeClientConfigForMode(agentRuntimeModeAgent).BaseURL
|
||||||
@@ -188,8 +188,10 @@ func amStartTemplateAgent(ctx context.Context, args amStartArgs) (amStartResult,
|
|||||||
return amStartResult{}, err
|
return amStartResult{}, err
|
||||||
}
|
}
|
||||||
// AM exposes the agent via access_info.{domain,external_ip}; the instance id
|
// AM exposes the agent via access_info.{domain,external_ip}; the instance id
|
||||||
// is name/namespace. access_token is not issued by AM (auth = per-request
|
// is name/namespace. AM's access_token (if any) is ignored — HM mints its own
|
||||||
// api_key); left empty until the V2-decrypt path lands.
|
// per-agent access token (AGENT_ACCESS_TOKEN) and returns that to the client;
|
||||||
|
// AM authorizes callers by comparing the X-Agent-Access-Token header to its
|
||||||
|
// env AGENT_ACCESS_TOKEN locally.
|
||||||
subdomain := stringFromMap(data, "subdomain", "address", "url")
|
subdomain := stringFromMap(data, "subdomain", "address", "url")
|
||||||
if subdomain == "" {
|
if subdomain == "" {
|
||||||
if ai, ok := data["access_info"].(map[string]any); ok {
|
if ai, ok := data["access_info"].(map[string]any); ok {
|
||||||
|
|||||||
Reference in New Issue
Block a user