Skip to content

feat(hyperion): multi-tenant DynamoDB runtime + AgentCore/Hyperion extensions - #1

Merged
adhajar-amzn merged 1 commit into
mainfrom
feat/hyperion-multi-tenant
Mar 11, 2026
Merged

feat(hyperion): multi-tenant DynamoDB runtime + AgentCore/Hyperion extensions#1
adhajar-amzn merged 1 commit into
mainfrom
feat/hyperion-multi-tenant

Conversation

@adhajar-amzn

Copy link
Copy Markdown

Summary

Adds the multi-tenant infrastructure layer for the Nova Personal Assistant Platform. Replaces filesystem-based config with DynamoDB-backed tenant resolution, enabling 10K+ users on a shared OC Gateway deployment.

  • src/hyperion/ — Core runtime layer: DynamoDB client (4 tables), tenant config loader with LRU cache, channel identity resolver, session manager with composite keys (tenant_{userId}:{agentId}:{rest}), KMS-encrypted credential store with per-agent + __shared__ fallback, pairing code generation/redemption
  • extensions/agentcore/ — ACP runtime plugin for Bedrock AgentCore: session management, agent turn dispatch, memory namespace isolation (tenant_{userId}:{agentId})
  • extensions/hyperion/ — Gateway plugin that initializes the multi-tenant runtime at startup from HYPERION_STAGE env var
  • extensions/nova/src/monitor.ts — Integrates per-tenant config loading in message handler; loads from DynamoDB in multi-tenant mode, falls back to static config + allowlist in single-tenant mode
  • config/openclaw.json5 — Base gateway config for ECS deployment (bind, auth, trustedProxies, ACP backend, JSON logging)

Multi-instance agents

Each user can run multiple independent agent instances (e.g., "Work Assistant", "Personal"). Default agent_id = "main" for single-instance backwards compatibility. Composite keys (user_id + agent_id) are threaded through all data access, session keys, and memory namespaces.

Data flow

Portal message → OC Gateway → Hyperion plugin (tenant config from DDB)
                             → AgentCore extension (session + memory)
                             → Bedrock AgentCore (Firecracker VM)
                             → response streams back

Test plan

  • npx tsc --noEmit passes (type-check)
  • Existing tests unaffected (pnpm test)
  • Manual: deploy to beta ECS, send portal message, verify tenant config loads from DynamoDB
  • Manual: verify credential fallback (agent-specific → __shared__)
  • Unit tests for src/hyperion/ are tracked as follow-up (TASK-25)

🤖 Generated with Claude Code

@adhajar-amzn
adhajar-amzn force-pushed the feat/hyperion-multi-tenant branch from 8de8cc6 to 81ed699 Compare March 11, 2026 16:54
…and unit tests

Multi-tenant DynamoDB integration layer (src/hyperion/):
- TenantConfigLoader: loads tenant_config + channel links + credentials, assembles OpenClawConfig
- HyperionDynamoDBClient: DDB operations for all 4 tables with multi-agent composite keys
- HyperionPairingStore: pairing code CRUD with 5-min TTL and retry logic
- SessionManager: session key parsing, tenant/agent ID extraction, memory namespacing
- UserCredentialStore: KMS envelope encryption for per-user API keys

AgentCore ACP extension (extensions/agentcore/):
- AgentCoreRuntime: implements OC AcpRuntime interface (ensureSession, runTurn, cancel, close)
- Pre-turn: loads tenant context + retrieves memory in parallel
- Post-turn: fires memory extraction job (fire-and-forget)
- Error classification: throttling, resource not found, service unavailable
- Config loader: SSM parameter-based configuration with local override support

Hyperion gateway plugin (extensions/hyperion/):
- Plugin entry that registers createHyperionPluginService()
- Creates AWS SDK clients, calls createHyperionRuntime(), stores as global singleton
- Stage resolution from plugin config / HYPERION_STAGE / STACK_NAME

Nova channel integration:
- monitor.ts loads per-tenant config via getHyperionRuntime() on each inbound message

Unit tests (158 tests across 6 files):
- Vitest 4.x compatible mocks (regular functions for constructors)
- Properly typed test helpers, zero as-any casts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@adhajar-amzn
adhajar-amzn force-pushed the feat/hyperion-multi-tenant branch from 81ed699 to 7edb5c3 Compare March 11, 2026 17:00
@adhajar-amzn
adhajar-amzn merged this pull request into main Mar 11, 2026
2 of 9 checks passed
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