Skip to content

feat(bedrock): add OpenAI GPT-5.6 family (Sol/Terra/Luna) to Mantle Responses routing - #65076

Open
vinayshah1998 wants to merge 5 commits into
NousResearch:mainfrom
vinayshah1998:feat/bedrock-gpt-5.6-mantle
Open

feat(bedrock): add OpenAI GPT-5.6 family (Sol/Terra/Luna) to Mantle Responses routing#65076
vinayshah1998 wants to merge 5 commits into
NousResearch:mainfrom
vinayshah1998:feat/bedrock-gpt-5.6-mantle

Conversation

@vinayshah1998

Copy link
Copy Markdown

Summary

GPT-5.6 Sol, Terra, and Luna went GA on Amazon Bedrock on July 13, 2026. Like GPT-5.5, they are served exclusively from the Bedrock Mantle OpenAI-compatible Responses endpoint (https://bedrock-mantle.<region>.api.aws/openai/v1) — the AWS model cards list bedrock-runtime/Converse as unsupported for all three.

This PR builds directly on #53880 (natebransc's Mantle/Responses routing for GPT-5.5) and extends the allowlist to the 5.6 family. The first two commits here are #53880 unchanged (authorship preserved); the third commit is the 5.6 addition. If #53880 merges first, this rebases down to the one commit.

  • Add openai.gpt-5.6-sol, openai.gpt-5.6-terra, openai.gpt-5.6-luna to BEDROCK_OPENAI_RESPONSES_MODEL_IDS, so runtime resolution, auxiliary calls, and MoA slots all take the SigV4/bearer Mantle Responses path automatically.
  • Surface the family in the curated Bedrock picker list.
  • Record the 272K context window from the AWS model cards for all four Mantle OpenAI models (previously these fell back to the 128K BEDROCK_DEFAULT_CONTEXT_LENGTH).
  • Generalize the picker tests from hardcoded openai.gpt-5.5 checks to iterate BEDROCK_OPENAI_RESPONSES_MODEL_IDS, so the next Mantle-only model addition is a one-line allowlist change with zero test surgery.

Docs: OpenAI models on Bedrock / GPT-5.6 Sol model card

Why

Bedrock's control-plane discovery (ListFoundationModels/ListInferenceProfiles) does not enumerate Mantle-only models, and the Mantle route is not Converse-compatible, so without the allowlist entry the 5.6 models are neither selectable nor callable from the Bedrock provider. GPT-OSS models remain intentionally excluded — they are Converse-capable and stay on the native path.

Testing

  • scripts/run_tests.sh tests/agent/test_bedrock_integration.py tests/hermes_cli/test_bedrock_model_picker.py tests/run_agent/test_moa_loop_mode.py — 100 passed, 0 failed
  • python -m py_compile on all touched files; scripts/check-windows-footguns.py — clean (4 files); git diff --check — clean
  • Live smoke test against real Bedrock (bearer-token auth, us-east-1):
    • Direct Responses API: openai.gpt-5.6-terra returned bedrock-gpt56-ok
    • End-to-end through the CLI: hermes chat -q ... --provider bedrock -m openai.gpt-5.6-terra returned hermes-gpt56-e2e-ok
    • End-to-end openai.gpt-5.6-sol returned sol-ok
  • New tests: Mantle routing for all three 5.6 variants, picker membership, and 272K context-length assertions

Notes

  • Depends on / includes feat(bedrock): support OpenAI Responses models #53880. Happy to rebase once that lands.
  • Pricing rows for the 5.6 family are not included: aws.amazon.com/bedrock/pricing does not yet publish per-token numbers for Sol/Terra/Luna and usage_pricing.py guidance is to only add rows with a verifiable source. Can follow up when AWS publishes them.

@vinayshah1998
vinayshah1998 force-pushed the feat/bedrock-gpt-5.6-mantle branch from 0fa4fd6 to 87f7837 Compare July 15, 2026 16:13
@alt-glitch alt-glitch added type/feature New feature or request comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard provider/bedrock AWS Bedrock (boto3, IAM) P3 Low — cosmetic, nice to have labels Jul 15, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for extending the Mantle routing work to the GPT-5.6 family. The premise is still present on current main: hermes_cli/runtime_provider.py:1975-2008 routes every non-Claude Bedrock model to Converse, and hermes_cli/models.py:532-544 does not surface Mantle IDs.

Problems

  • The inherited Mantle auxiliary path from 83482bf7 derives its region independently with resolve_bedrock_region(). That disagrees with the main runtime, which prioritizes bedrock.region at hermes_cli/runtime_provider.py:1958-1962; auxiliary calls can therefore leave the primary runtime's configured region. This was also identified in the linked feat(bedrock): support OpenAI Responses models #53880 review.
  • website/docs/guides/aws-bedrock.md:9 currently says Hermes does not use the OpenAI-compatible endpoint, but no documentation file is changed here.

Suggested changes

  • Preserve the resolved Mantle endpoint/region through auxiliary resolution and cover a bedrock.region versus AWS_REGION mismatch.
  • Update the Bedrock guide for the Converse and Mantle routes.

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 16, 2026
@vinayshah1998

Copy link
Copy Markdown
Author

Both review problems addressed in ab2a229ea + 57c7d3758:

1. Auxiliary region resolution now matches the main runtime. Added resolve_bedrock_runtime_region() to agent/bedrock_adapter.py — the canonical implementation of the runtime's region priority (bedrock.region in config.yaml, then AWS_REGION/AWS_DEFAULT_REGION/botocore profile/us-east-1). The auxiliary aws_sdk branch in agent/auxiliary_client.py now uses it, so auxiliary calls (compression, memory, vision) can no longer leave the primary runtime's configured region — for both the AnthropicBedrock/Converse path and the new Mantle OpenAI Responses path. The runtime provider resolver, model validation (hermes_cli/models.py), live discovery (bedrock_model_ids_or_none), and the Mantle URL/SigV4 region fallbacks all route through the same helper, so the priority exists in exactly one place.

Regression tests cover the bedrock.region-vs-AWS_REGION mismatch for both auxiliary paths (test_bedrock_config_region_beats_env_region, test_bedrock_mantle_config_region_beats_env_region in tests/agent/test_bedrock_integration.py) — config region pinned to us-west-2 with ambient env at eu-central-1, asserting the resolved endpoint lands on us-west-2.

2. Bedrock guide updated. website/docs/guides/aws-bedrock.md no longer claims Hermes avoids the OpenAI-compatible endpoint. It now documents the triple routing (Claude via AnthropicBedrock SDK, GPT-5.5/5.6 via the Bedrock Mantle OpenAI Responses endpoint, everything else via Converse), the Mantle auth model (AWS_BEARER_TOKEN_BEDROCK or SigV4 via the boto3 chain), and lists the four openai.* model IDs in the Available Models table with a note that Mantle IDs don't use inference-profile prefixes.

Also folded in a small structural cleanup (57c7d3758): agent_init.py's if "client_kwargs" in locals() guard replaced by unconditional initialization, and the three hand-rolled region-priority copies collapsed into the single helper.

Bedrock-related suites pass locally: test_bedrock_integration.py, test_bedrock_adapter.py, test_bedrock_model_picker.py, test_runtime_provider_resolution.py, test_moa_loop_mode.py — 407 passed, 0 failed via scripts/run_tests.sh.

Nathaniel Branscum and others added 5 commits July 17, 2026 12:58
Route Bedrock-hosted OpenAI GPT-5.5 through the Bedrock Mantle OpenAI Responses endpoint with SigV4 request signing. Keep native Bedrock Converse and Claude Bedrock routing unchanged, and add picker/runtime regression coverage.
Preserve the Bedrock provider identity for MoA reference and aggregator slots so Bedrock OpenAI Responses models use the aws_sdk/SigV4 runtime instead of being downgraded to a generic custom endpoint. Add regression coverage for Bedrock GPT-5.5 MoA slots.
…esponses routing

GPT-5.6 Sol, Terra, and Luna went GA on Amazon Bedrock on 2026-07-13.
Like GPT-5.5, they are served exclusively from the Bedrock Mantle
OpenAI-compatible Responses endpoint (the model cards list
bedrock-runtime/Converse as unsupported), so they ride the allowlist
routing introduced for GPT-5.5:

- Add openai.gpt-5.6-{sol,terra,luna} to BEDROCK_OPENAI_RESPONSES_MODEL_IDS
  so runtime resolution, auxiliary calls, and MoA slots all take the
  SigV4/bearer Mantle Responses path.
- Surface the family in the curated Bedrock picker list.
- Record the 272K context window from the AWS model cards for all four
  Mantle OpenAI models (previously fell back to the 128K default).
- Generalize picker tests from the hardcoded single-model checks to the
  BEDROCK_OPENAI_RESPONSES_MODEL_IDS allowlist so future Mantle model
  additions do not require test surgery; add routing, picker, and
  context-length coverage for the 5.6 family.

Docs: https://docs.aws.amazon.com/bedrock/latest/userguide/model-cards-openai.html
…nt Mantle route

Address review feedback on NousResearch#65076:

- Add resolve_bedrock_runtime_region() to agent/bedrock_adapter.py: the
  config-first region resolution (bedrock.region in config.yaml, then
  AWS_REGION/AWS_DEFAULT_REGION/botocore profile/us-east-1) that the main
  runtime resolver uses, exposed as a shared helper.
- Switch auxiliary client resolution (agent/auxiliary_client.py aws_sdk
  branch) to the new helper. Previously it derived its region with bare
  resolve_bedrock_region() (env-first), so when config.yaml pinned
  bedrock.region to a different region than the ambient AWS env, auxiliary
  calls (compression, memory, vision) left the primary runtime's region.
  Both the AnthropicBedrock/Converse path and the new Mantle OpenAI
  Responses path now resolve identically to the main runtime.
- Add regression tests covering the bedrock.region-vs-AWS_REGION mismatch
  for both the Claude auxiliary path and the Mantle auxiliary path.
- Update website/docs/guides/aws-bedrock.md: the guide claimed Hermes never
  uses the OpenAI-compatible endpoint, which the Mantle route made stale.
  Document the triple routing (AnthropicBedrock / Mantle OpenAI Responses /
  Converse), the Mantle auth model (bearer token or SigV4), and add the
  GPT-5.5/5.6 model IDs to the models table.
…ion chokepoint

Follow-up structural pass on the review fix:

- Runtime provider, auxiliary resolution, model validation
  (hermes_cli/models.py), live discovery (bedrock_model_ids_or_none),
  and the Mantle URL/SigV4 fallbacks all resolve their region through
  resolve_bedrock_runtime_region() — one canonical implementation of the
  config-first priority instead of three hand-rolled copies.
- agent_init: drop the 'if "client_kwargs" in locals()' guard by
  initializing client_kwargs unconditionally at the top of the else
  branch; the Mantle kwargs hook is a documented no-op for non-Mantle
  base URLs.
@vinayshah1998
vinayshah1998 force-pushed the feat/bedrock-gpt-5.6-mantle branch from 57c7d37 to 3bce1be Compare July 17, 2026 20:01
@vinayshah1998

Copy link
Copy Markdown
Author

Gentle ping @teknium1 - both review concerns are resolved in ab2a229ea + 57c7d3758 (auxiliary region resolution now shares resolve_bedrock_runtime with the main runtime, plus E2E coverage against a temp HERMES_HOME). Happy to rebase if anything has drifted on main since. Ready for re-review whenever convenient.

@GottZ

GottZ commented Aug 3, 2026

Copy link
Copy Markdown

This was generated by AI during triage.

Summary

Two open PRs address Bedrock Mantle/OpenAI Responses routing: #53880 introduces GPT-5.5 routing, SigV4 authentication, picker exposure, auxiliary-client support, and MoA provider preservation, while #65076 incorporates that foundation, extends it to GPT-5.6 Sol/Terra/Luna, centralizes region resolution, adds context metadata and regression coverage, and updates the Bedrock guide.

Related pull requests

Duplicates

#53880 and #65076 implement the same core GPT-5.5 Mantle routing; #65076 is the broader successor and additionally carries the GPT-5.6 family and the documented review fixes.

Suggested consolidation

Keep #65076 open with a salvage path focused on the shared Mantle routing, centralized region handling, regression tests, and documentation; close #53880 as a duplicate of #65076 because its core implementation is incorporated there and its contributor-review concerns are addressed in the successor's visible diff.

Complex graph

flowchart LR
    classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
    classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
    classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
    classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
    classDef best stroke-width:3px,stroke:#b45309
    classDef target stroke-width:3px,stroke:#4338ca
    subgraph Dup53880 ["PRs duplicating each other"]
        P53880["PR #53880 (open)"]
        P65076["PR #65076 (open)"]
    end
    class P53880 open
    class P65076 open
    class P65076 target
    click P53880 "https://github.com/NousResearch/hermes-agent/pull/53880"
    click P65076 "https://github.com/NousResearch/hermes-agent/pull/65076"
Loading

Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed (state tag in the node label).

Cross-PR triage: Reviewed 2 pull requests and 0 issues in this complex. Each diff was read against this issue; Assessment working set: 73 kB of PR diffs, 7 kB of issue/PR text, 5 kB of discussion (5 comments), 0 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.

@vinayshah1998

Copy link
Copy Markdown
Author

@teknium1 Following up now that the Aug 3 cross-PR triage has run: it marked this PR as the consolidation target for the Mantle Responses routing work and recommends closing #53880 as a duplicate, noting the earlier review concerns (auxiliary region resolution, picker test brittleness, docs) are addressed in the current diff. Happy to rebase on latest main if anything has drifted. Ready for re-review whenever you have bandwidth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have provider/bedrock AWS Bedrock (boto3, IAM) sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants