Skip to content

fix(runtime): default omitted invoke user ID - #2187

Merged
aidandaly24 merged 3 commits into
aws:refactorfrom
aidandaly24:fix/runtime-invoke-default-user
Sep 3, 2026
Merged

fix(runtime): default omitted invoke user ID#2187
aidandaly24 merged 3 commits into
aws:refactorfrom
aidandaly24:fix/runtime-invoke-default-user

Conversation

@aidandaly24

Copy link
Copy Markdown
Contributor

Summary

  • default omitted Runtime invoke user IDs to default
  • apply the fallback through the shared Runtime request normalizer used by direct, project, and TUI invocation
  • document the default in direct and project invoke help

Testing

  • bun test src/handlers/runtime/invoke/request.test.ts src/handlers/runtime/invoke/invoke.test.tsx src/handlers/runtime/invoke/invoke.screen.test.tsx src/handlers/project/invoke/index.test.tsx (83 pass)
  • bun test src (2804 pass)
  • bun run typecheck
  • bun run lint:check
  • bun run format:check
  • bun run build
  • live AWS invocation against Issue686_Echo returned HTTP 200 without --user-id
  • wire capture verified the signed request sends x-amzn-bedrock-agentcore-runtime-user-id: default, while an explicit --user-id overrides it

@github-actions github-actions Bot added the size/xs PR size: XS label Sep 3, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added agentcore-harness-reviewing AgentCore Harness review in progress claude-security-reviewing Claude Code /security-review in progress labels Sep 3, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Sep 3, 2026

@agentcore-devx-automation agentcore-devx-automation Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AgentCore Harness Review

Verdict: Looks good

Small, focused fix that centralizes a "default" fallback for runtimeUserId in normalizeRuntimeInvokeRequest (src/handlers/runtime/invoke/request.ts), with matching help-text updates and test coverage.

Verified:

  • All user-facing invoke entry points (runtime invoke headless + TUI screen, project invoke runtime) route through normalizeRuntimeInvokeRequest, so the default reaches both the CUSTOM_JWT header path and the IAM/SDK path in src/core/invokeRuntime.ts.
  • src/core/eval.tsx intentionally builds its own RuntimeInvokeRequest and still forwards input.userId (potentially undefined). That's not covered by this change; since eval has its own userId semantics (per-example), leaving it out looks deliberate — worth confirming that's intended.
  • Override test in request.test.ts still passes an explicit runtimeUserId through unchanged, and the screen test at invoke.screen.test.tsx:811 was updated correctly.

One thing to double-check (not a blocker): this is a behavior change — invocations that previously omitted X-Amzn-Bedrock-AgentCore-Runtime-User-Id will now always send default. Make sure that matches the server-side default and doesn't affect existing sessions/metrics that were keyed on "no user id".

Nothing else that requires changes before merging.

@agentcore-devx-automation agentcore-devx-automation Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Sep 3, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.08%. Comparing base (16db5b4) to head (2791048).

Additional details and impacted files
@@            Coverage Diff            @@
##           refactor    #2187   +/-   ##
=========================================
  Coverage     97.08%   97.08%           
=========================================
  Files           536      536           
  Lines         36979    36981    +2     
=========================================
+ Hits          35901    35903    +2     
  Misses         1078     1078           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

flag("accept", "the accepted response content type", z.string().optional()),
flag("session-id", "the Runtime session ID", z.string().optional()),
flag("user-id", "the Runtime user ID", z.string().optional()),
flag("user-id", 'the Runtime user ID (default: "default")', z.string().optional()),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: should be get this from DEFAULT_RUNTIME_USER_ID.

@aidandaly24
aidandaly24 merged commit a665955 into aws:refactor Sep 3, 2026
22 of 28 checks passed
This was referenced Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/xs PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants