Skip to content

fix: 3 regressions from PR #10 merge — Bedrock env passthrough + health route#14

Merged
shreyas-lyzr merged 2 commits into
mainfrom
fix/engine-bedrock-env-passthrough
May 31, 2026
Merged

fix: 3 regressions from PR #10 merge — Bedrock env passthrough + health route#14
shreyas-lyzr merged 2 commits into
mainfrom
fix/engine-bedrock-env-passthrough

Conversation

@shreyas-lyzr
Copy link
Copy Markdown
Contributor

@shreyas-lyzr shreyas-lyzr commented May 31, 2026

Summary

Three regressions caught by running pnpm -r test across the whole workspace after the cleanup-merge. All three came from PR #10 (policy guardrails) branching off an older base + my --theirs resolution during the merge picking up the older code.

# Where What broke Fix
1 engine-claude-agent-sdk/src/engine.ts:272 inheritEssentialHostEnv declared but not exported; test imports it as a named export added export
2 same file, allow-list array 9 Bedrock + AWS-IRSA env keys lost (regresses task #68 Phase 2a — Bedrock env passthrough). Without these, EKS pods with IRSA-injected creds can't reach Bedrock. restored 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
3 examples/agentos-api.ts:920 GET /agentos/api/health was mounted AFTER app.use('/agentos/api/*', requireAuth) → became 401-gated. Breaks k8s/ALB liveness probes. hoisted the route to before the auth middleware, symmetric to /login, /logout, /me

Workspace test sweep — full coverage

Bucket Result
SDK (sdk, protocol, cli) ✅ 103 passed, 8 skipped (offline live-API matrix)
Engines (claude-agent-sdk, deepagents, gitagent) ✅ 29 passed
Substrates / VMs (local, bwrap, e2b, vzvm) ✅ 13 passed
Memory (session-store-mongo, sqlite, agent-registry-mongo) ✅ 22 passed, 32 skipped (offline Mongo)
Harness + plumbing (harness-server, identity, observability, testing) ✅ 255 passed
examples (agentos-api integration) ✅ 1 passed, 17 skipped (offline)
Grand total 423 passing, 114 skipped, 0 failures

The 114 skipped are deliberate offline-gates: substrate × source matrix tests gated on ANTHROPIC_API_KEY + E2B_API_KEY, Mongo tests gated on MONGO_URL, etc. They run live in the spike.

Verification

pnpm -r test
# Workspace total: 423 passed, 114 skipped, 0 failed

…e Bedrock/AWS allow-list

Two regressions caught by running the full workspace test suite (`pnpm
-r test`):

  1. `inheritEssentialHostEnv` was declared but not exported. The test
     in src/engine.test.ts imports it as a named export, so the suite
     threw 'inheritEssentialHostEnv is not a function' at three tests.
     Added 'export' to the declaration at line 272.

  2. The function's allow-list had been trimmed back to just POSIX/XDG
     basics (HOME, PATH, USER, …). This regressed task #68 (Phase 2a:
     OSS PR — Bedrock env passthrough), which is the contract that lets
     a worker pod with IRSA-injected AWS_ROLE_ARN +
     AWS_WEB_IDENTITY_TOKEN_FILE actually invoke Bedrock. Restored the
     9 keys the test (and reality) require:
       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

After the fix: 10/10 engine-claude-agent-sdk tests pass (was 7/10).
Full workspace suite: 422 passing, 40 skipped (offline, gated on env),
0 failures across all 22 packages with tests.

How the regression got in: PR #10 (policy guardrails) was authored on
a branch that started before the Bedrock-env work in task #68 landed;
when it merged to main + I --theirs-resolved engine.ts during the
chore/oss-cleanup-public merge, the older smaller allow-list won.
The cookie-session auth middleware mounts at /agentos/api/* (line 278)
and gates everything that comes AFTER it. The health route at line 920
was therefore being 401'd, breaking k8s/ALB liveness probes and the
examples/agentos-api.test.ts smoke check.

Hoisted the GET /agentos/api/health route to before the
app.use('/agentos/api/*', requireAuth) line so it stays public.
Symmetric to /agentos/api/login, /logout, /me which were already
hoisted for the same reason.

After: examples test suite 1/18 passing (17 skipped offline, none
failing — was 1 failed before).

Full workspace sweep: 423 passing, 114 skipped, 0 failed.
@shreyas-lyzr shreyas-lyzr changed the title fix(engine-claude-agent-sdk): export inheritEssentialHostEnv + restore Bedrock/AWS allow-list fix: 3 regressions from PR #10 merge — Bedrock env passthrough + health route May 31, 2026
@shreyas-lyzr shreyas-lyzr merged commit f91d254 into main May 31, 2026
2 checks passed
@shreyas-lyzr shreyas-lyzr deleted the fix/engine-bedrock-env-passthrough branch May 31, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant