Skip to content

Commit f91d254

Browse files
authored
Merge pull request #14 from open-gitagent/fix/engine-bedrock-env-passthrough
fix: 3 regressions from PR #10 merge — Bedrock env passthrough + health route
2 parents 3f2e0a6 + d6063f0 commit f91d254

2 files changed

Lines changed: 19 additions & 3 deletions

File tree

examples/agentos-api.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,9 @@ export function createAgentOSApp(opts: AgentOSOptions): Hono {
274274
return c.json({ user: null }, 401);
275275
});
276276

277+
// Health check stays public so liveness probes can poll it without creds.
278+
app.get("/agentos/api/health", (c) => c.json({ ok: true, agents: opts.agents.map((a) => a.name) }));
279+
277280
// Everything else under /agentos/api/* requires auth.
278281
app.use("/agentos/api/*", requireAuth);
279282

@@ -917,8 +920,6 @@ export function createAgentOSApp(opts: AgentOSOptions): Hono {
917920
return c.json({ ok: true });
918921
});
919922

920-
app.get("/agentos/api/health", (c) => c.json({ ok: true, agents: opts.agents.map((a) => a.name) }));
921-
922923
// ── Policies stubs ─────────────────────────────────────────────────────────
923924
// The Policies tab is wired against an external SRS (Security/Runtime/Safety)
924925
// service in the upstream design. In this deployment SRS isn't running, so

packages/engine-claude-agent-sdk/src/engine.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,11 @@ function signalToController(signal: AbortSignal): AbortController {
269269
*
270270
* Caller envs (api keys, etc.) override these on conflict.
271271
*/
272-
function inheritEssentialHostEnv(): Record<string, string> {
272+
export function inheritEssentialHostEnv(): Record<string, string> {
273273
const out: Record<string, string> = {};
274274
for (const k of [
275+
// POSIX + XDG basics — required for the SDK to resolve $HOME, $PATH, etc.
276+
// Without these, transcript-mirror writes silently drop.
275277
"HOME",
276278
"PATH",
277279
"USER",
@@ -281,6 +283,19 @@ function inheritEssentialHostEnv(): Record<string, string> {
281283
"CLAUDE_CONFIG_DIR",
282284
"XDG_CONFIG_HOME",
283285
"XDG_DATA_HOME",
286+
// Bedrock + AWS IRSA passthrough (task #68 Phase 2a) — when the caller
287+
// routes the agent via Bedrock, the AWS SDK's default credential chain
288+
// needs these. Picked up automatically from the pod env (IRSA injects
289+
// AWS_ROLE_ARN + AWS_WEB_IDENTITY_TOKEN_FILE) or developer shell.
290+
"CLAUDE_CODE_USE_BEDROCK",
291+
"AWS_REGION",
292+
"AWS_DEFAULT_REGION",
293+
"AWS_BEDROCK_MODEL_ID",
294+
"AWS_ROLE_ARN",
295+
"AWS_WEB_IDENTITY_TOKEN_FILE",
296+
"AWS_PROFILE",
297+
"AWS_SHARED_CREDENTIALS_FILE",
298+
"AWS_CONFIG_FILE",
284299
]) {
285300
const v = process.env[k];
286301
if (v) out[k] = v;

0 commit comments

Comments
 (0)