diff --git a/examples/agentos-api.ts b/examples/agentos-api.ts index d3ea167..481aac2 100644 --- a/examples/agentos-api.ts +++ b/examples/agentos-api.ts @@ -274,6 +274,9 @@ export function createAgentOSApp(opts: AgentOSOptions): Hono { return c.json({ user: null }, 401); }); + // Health check stays public so liveness probes can poll it without creds. + app.get("/agentos/api/health", (c) => c.json({ ok: true, agents: opts.agents.map((a) => a.name) })); + // Everything else under /agentos/api/* requires auth. app.use("/agentos/api/*", requireAuth); @@ -917,8 +920,6 @@ export function createAgentOSApp(opts: AgentOSOptions): Hono { return c.json({ ok: true }); }); - app.get("/agentos/api/health", (c) => c.json({ ok: true, agents: opts.agents.map((a) => a.name) })); - // ── Policies stubs ───────────────────────────────────────────────────────── // The Policies tab is wired against an external SRS (Security/Runtime/Safety) // service in the upstream design. In this deployment SRS isn't running, so diff --git a/packages/engine-claude-agent-sdk/src/engine.ts b/packages/engine-claude-agent-sdk/src/engine.ts index e1661b4..5b85ede 100644 --- a/packages/engine-claude-agent-sdk/src/engine.ts +++ b/packages/engine-claude-agent-sdk/src/engine.ts @@ -269,9 +269,11 @@ function signalToController(signal: AbortSignal): AbortController { * * Caller envs (api keys, etc.) override these on conflict. */ -function inheritEssentialHostEnv(): Record { +export function inheritEssentialHostEnv(): Record { const out: Record = {}; for (const k of [ + // POSIX + XDG basics — required for the SDK to resolve $HOME, $PATH, etc. + // Without these, transcript-mirror writes silently drop. "HOME", "PATH", "USER", @@ -281,6 +283,19 @@ function inheritEssentialHostEnv(): Record { "CLAUDE_CONFIG_DIR", "XDG_CONFIG_HOME", "XDG_DATA_HOME", + // Bedrock + AWS IRSA passthrough (task #68 Phase 2a) — when the caller + // routes the agent via Bedrock, the AWS SDK's default credential chain + // needs these. Picked up automatically from the pod env (IRSA injects + // AWS_ROLE_ARN + AWS_WEB_IDENTITY_TOKEN_FILE) or developer shell. + "CLAUDE_CODE_USE_BEDROCK", + "AWS_REGION", + "AWS_DEFAULT_REGION", + "AWS_BEDROCK_MODEL_ID", + "AWS_ROLE_ARN", + "AWS_WEB_IDENTITY_TOKEN_FILE", + "AWS_PROFILE", + "AWS_SHARED_CREDENTIALS_FILE", + "AWS_CONFIG_FILE", ]) { const v = process.env[k]; if (v) out[k] = v;