Skip to content

fix(inference): send max_completion_tokens for GPT-5 and o-series models - #6643

Merged
cv merged 10 commits into
NVIDIA:mainfrom
gregmercer:fix/gpt-5.4-max-completion-tokens
Jul 11, 2026
Merged

fix(inference): send max_completion_tokens for GPT-5 and o-series models#6643
cv merged 10 commits into
NVIDIA:mainfrom
gregmercer:fix/gpt-5.4-max-completion-tokens

Conversation

@gregmercer

@gregmercer gregmercer commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

GPT-5-family models and the o1/o3/o4 reasoning series (including Azure OpenAI deployments) reject the legacy max_tokens parameter on /chat/completions with HTTP 400: Unsupported parameter: 'max_tokens' ... Use 'max_completion_tokens' instead. As a result, onboarding and agent turns against gpt-5.4 on a custom OpenAI-compatible provider fail out of the box. This routes the reply-budget field to max_completion_tokens for those model families.

Related Issue

Fixes #6642

Changes

  • Add a shared resolveMaxTokensField() resolver (src/lib/inference/max-tokens-field.ts) that returns max_completion_tokens for GPT-5 and o-series (o1/o3/o4) models and max_tokens otherwise. Prefix-matched so provider-prefixed and Azure-suffixed ids (azure/gpt-5.4, gpt-5.4-turbo) resolve correctly.
  • Use the resolver in the host onboarding probes (onboard-probes.ts, both the compatible-endpoint payload and the strict tool-call probe) and the in-sandbox compatible-endpoint smoke script (compatible-endpoint-smoke.ts), so host and sandbox agree on the field name.
  • Expand the declarative OpenClaw model setup to bounded GPT-5 and o1/o3/o4 family prefixes, including provider-prefixed and suffixed model IDs, while preserving exact-match behavior for existing manifests.
  • Add unit and integration coverage for resolver, probe, smoke retry, schema, and OpenClaw/Hermes config-generation behavior.
  • Document the automatic GPT-5/o-series reply-budget field selection in the compatible-endpoint guide.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • Docs updated for user-facing behavior changes
  • Docs not applicable — justification:
  • Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging)
  • Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: requesting maintainer sensitive-path review (inference/onboarding); contributor cannot self-approve.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

Verification

  • PR description includes the DCO sign-off declaration and every commit appears as Verified in GitHub
  • Normal pre-commit, commit-msg, and pre-push hooks passed, or npm run check:diff passed when hooks were skipped or unavailable
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — command/result: affected Vitest slice → 384 passed; focused post-hook generator slice → 142 passed; npm run typecheck:cli, npm run validate:configs, npm run test:titles:check, and the normal commit/push hooks passed.
  • Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — command/result: not applicable (scoped inference-probe change, no test-harness or repo-wide validation changes).
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed
  • npm run docs builds without errors (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Signed-off-by: Greg Mercer gmercer@stanford.edu

Summary by CodeRabbit

  • New Features
    • Added automatic token-budget compatibility for GPT-5 and o-series models, switching between max_tokens and max_completion_tokens as needed.
    • Added model-family matching via bounded prefixes (including provider-prefixed model IDs) and updated generated OpenClaw/Hermes configs accordingly.
    • Added a new managed inference blueprint for GPT-5 and o-series routing.
  • Bug Fixes
    • Improved tool-calling and strict probe payloads to consistently use the correct token field.
    • Enhanced reasoning retries to preserve the correct token budget.
  • Documentation
    • Updated guidance on reply-budget handling for supported model families.
  • Tests
    • Expanded coverage for token-field selection, prefix matching, and config validation/schema rules.

GPT-5-family models and the o1/o3/o4 reasoning series (including Azure
OpenAI deployments) reject the legacy `max_tokens` parameter on
/chat/completions with HTTP 400 and require `max_completion_tokens`
instead, so onboarding and agent turns against gpt-5.4 on a custom
OpenAI-compatible provider fail out of the box.

Add a shared resolveMaxTokensField() resolver and use it in the host
onboarding probes and the in-sandbox compatible-endpoint smoke check so
both agree on the field name. Add an openclaw gpt-5.4 model-specific
setup manifest that routes the reply budget to max_completion_tokens on
the managed inference route.

Fixes NVIDIA#6642

Signed-off-by: Greg Mercer <gmercer@stanford.edu>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR adds model-aware selection between max_tokens and max_completion_tokens, integrates it into inference and smoke probes, and adds bounded model-prefix matching for OpenClaw and Hermes configurations with validation and tests.

Changes

Reply-budget compatibility

Layer / File(s) Summary
Model field resolver
src/lib/inference/max-tokens-field.ts, src/lib/inference/max-tokens-field.test.ts
Resolves the token field for GPT-5 and o-series models, including provider-prefixed identifiers, while preserving max_tokens for other models.
Onboarding request paths
src/lib/inference/*, src/lib/onboard/*, docs/inference/choose-compatible-inference-api.mdx
Applies the resolved field to inference probes, validation requests, retries, compatible-endpoint smoke payloads, and documentation.
Model-family manifest contract
agents/hermes/config/model-specific-setup.ts, nemoclaw-blueprint/model-specific-setup/*, test/generate-hermes-config.test.ts, test/validate-config-schemas.test.ts
Adds bounded modelIdPrefixes matching, validation rules, mutual exclusivity with exact IDs, and a managed GPT-5/o-series configuration.
OpenClaw configuration generation
scripts/generate-openclaw-config.mts, test/generate-openclaw-config-gpt5-compat.test.ts
Validates and matches model prefixes during config generation and verifies generated compatibility fields and rejection cases.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ModelSelector
  participant MaxTokensResolver
  participant OpenClawConfig
  participant CompatibleEndpoint
  ModelSelector->>MaxTokensResolver: provide model identifier
  MaxTokensResolver-->>ModelSelector: return max_completion_tokens or max_tokens
  ModelSelector->>OpenClawConfig: configure provider compatibility field
  OpenClawConfig->>CompatibleEndpoint: generate model-specific request payload
  CompatibleEndpoint->>CompatibleEndpoint: send selected token field
Loading

Suggested labels: bug-fix, area: onboarding, area: providers

Suggested reviewers: ericksoa, brandonpelfrey, sandl99

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: switching GPT-5 and o-series inference requests to max_completion_tokens.
Linked Issues check ✅ Passed The changes implement the requested resolver and apply it to onboarding probes, smoke checks, and managed inference setup for GPT-5/o-series models.
Out of Scope Changes check ✅ Passed The added tests, schema updates, and docs all support the GPT-5/o-series token-field fix and managed inference routing.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@prekshivyas

prekshivyas commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

E2E Advisor Recommendation

Required E2E: inference-routing, network-policy, onboard-repair, onboard-resume, cloud-onboard
Optional E2E: None

Dispatch hint: inference-routing,network-policy,onboard-repair,onboard-resume

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: target/main
Head: HEAD
Confidence: high

Required E2E

  • inference-routing: Required by the deterministic risk plan for inference-policy changes. This validates real route selection and endpoint reachability behavior at the host-to-sandbox inference boundary after changing OpenAI-compatible probe payloads and managed inference setup.
  • network-policy: Required by the deterministic risk plan for inference-policy changes. The new managed inference manifest and inference.local routing behavior must still permit intended provider traffic and deny unintended egress at the real sandbox boundary.
  • onboard-repair: Required by the deterministic risk plan for lifecycle-state changes. The compatible endpoint sandbox smoke path participates in onboarding convergence and repair must still reconcile persisted metadata, gateway status, and live sandbox state.
  • onboard-resume: Required by the deterministic risk plan for lifecycle-state changes. This verifies interrupted onboarding can resume without stale state or ghost resources after changes to sandbox-side compatible endpoint smoke behavior.
  • cloud-onboard (high): Changed onboard, trace timing, scorecard, or E2E workflow code can affect cloud onboard wall-clock behavior and should refresh the trusted cloud-onboard trace timing signal.

Optional E2E

  • None.

New E2E recommendations

  • GPT-5/o-series compatible endpoint request shape (high): Existing required E2E jobs validate route reachability, policy, and lifecycle convergence, but this PR adds payload-level max_completion_tokens compatibility across host probes, generated OpenClaw config, and the sandbox smoke script. A fake-provider E2E should assert the actual inference.local request body for a provider-prefixed GPT-5/o-series model.
    • Suggested test: Add a live fake-compatible-endpoint E2E target that onboards OpenClaw with a provider-prefixed GPT-5 model and fails if inference.local receives max_tokens or temperature instead of max_completion_tokens during sandbox smoke or an assistant turn.

Dispatch hint

  • Workflow: .github/workflows/e2e.yaml
  • jobs input: inference-routing,network-policy,onboard-repair,onboard-resume

@prekshivyas

prekshivyas commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

E2E Target Recommendation

Required E2E targets: inference-routing, network-policy, onboard-repair, onboard-resume
Optional E2E targets: None

Dispatch required E2E targets:

  • gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=inference-routing
  • gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=network-policy
  • gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=onboard-repair
  • gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=onboard-resume

Workflow run

Full E2E target advisor summary

E2E Target Advisor

Base: target/main
Head: HEAD
Confidence: high

Required E2E targets

  • inference-routing: Inference selection, reachability, and network policy must agree at the real host-to-sandbox boundary.
    • Dispatch: gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=inference-routing
  • network-policy: Inference selection, reachability, and network policy must agree at the real host-to-sandbox boundary.
    • Dispatch: gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=network-policy
  • onboard-repair: Onboarding and sandbox state must converge across persisted metadata, reported status, and the live runtime.
    • Dispatch: gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=onboard-repair
  • onboard-resume: Onboarding and sandbox state must converge across persisted metadata, reported status, and the live runtime.
    • Dispatch: gh workflow run e2e.yaml --ref <pr-head-ref> --field jobs=onboard-resume

Optional E2E targets

  • None.

Relevant changed files

  • agents/hermes/config/model-specific-setup.ts
  • nemoclaw-blueprint/model-specific-setup/openclaw/gpt-5-o-series-managed-inference.json
  • nemoclaw-blueprint/model-specific-setup/schema.json
  • scripts/generate-openclaw-config.mts
  • src/lib/inference/max-tokens-field.ts
  • src/lib/inference/onboard-probes.ts
  • src/lib/onboard/compatible-endpoint-smoke.ts

cv added 2 commits July 11, 2026 04:22
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@github-actions

Copy link
Copy Markdown
Contributor

E2E Target Results — ⚠️ Some jobs cancelled — partial pass

Run: 29150880186
Workflow ref: tmp/e2e/pr-6643-gpt5-b019b593
Requested targets: inference-routing,network-policy,onboard-repair,onboard-resume,cloud-onboard,kimi-inference-compat
Requested jobs: (default — all default-enabled free-standing jobs; explicit-only jobs openshell-gateway-auth-contract, mcp-bridge-dev, hermes-gpu-startup, sandbox-rlimits-connect, and jetson-nvmap-gpu are skipped unless selected)
Summary: 1 passed, 0 failed, 5 cancelled, 0 skipped

Job Result
cloud-onboard ⚠️ cancelled
inference-routing ✅ success
kimi-inference-compat ⚠️ cancelled
network-policy ⚠️ cancelled
onboard-repair ⚠️ cancelled
onboard-resume ⚠️ cancelled

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (2)
test/generate-hermes-config.test.ts (1)

1100-1128: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Exercise the Hermes generation boundary.

This test calls discoverModelSpecificSetups directly and checks only match counts, so a regression in registry wiring or effect serialization could pass. Add one case through the public Hermes generation path and assert the resulting configuration effect, or move this case to a focused matcher test and add that integration assertion separately.

As per path instructions, tests should prefer observable outcomes through the public boundary over internal implementation checks.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/generate-hermes-config.test.ts` around lines 1100 - 1128, Extend the
Hermes test beyond direct discoverModelSpecificSetups match counts by exercising
the public Hermes generation path for the bounded model-prefix case. Assert the
generated configuration contains the expected hermesCompat effect, while
preserving the existing non-matching boundary cases; use the public generation
API rather than adding further internal matcher assertions.

Source: Path instructions

docs/inference/local-compatible-inference-setup.mdx (1)

41-42: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use second-person wording in the new documentation.

Rewrite these sentences as direct instructions to the reader.

Proposed wording
-For GPT-5 and the `o1`, `o3`, and `o4` model families, NemoClaw configures OpenClaw to send the maximum reply token limit as `max_completion_tokens` instead of the legacy `max_tokens`.
-This automatic compatibility handling recognizes provider-prefixed and suffixed model IDs, such as `azure/gpt-5.4`, `gpt-5.4-turbo`, and `openai/o3-mini`.
+When you use GPT-5 or the `o1`, `o3`, and `o4` model families, NemoClaw configures OpenClaw to send the maximum reply token limit as `max_completion_tokens` instead of the legacy `max_tokens`.
+You can use provider-prefixed and suffixed model IDs, such as `azure/gpt-5.4`, `gpt-5.4-turbo`, and `openai/o3-mini`.

As per coding guidelines, documentation must use active voice, second person, present tense, and direct language.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/inference/local-compatible-inference-setup.mdx` around lines 41 - 42,
Rewrite the new documentation sentences using active, second-person,
present-tense instructions that address the reader directly. Preserve the
existing details about max_completion_tokens, legacy max_tokens, and supported
provider-prefixed or suffixed model IDs.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@docs/inference/local-compatible-inference-setup.mdx`:
- Around line 41-42: Rewrite the new documentation sentences using active,
second-person, present-tense instructions that address the reader directly.
Preserve the existing details about max_completion_tokens, legacy max_tokens,
and supported provider-prefixed or suffixed model IDs.

In `@test/generate-hermes-config.test.ts`:
- Around line 1100-1128: Extend the Hermes test beyond direct
discoverModelSpecificSetups match counts by exercising the public Hermes
generation path for the bounded model-prefix case. Assert the generated
configuration contains the expected hermesCompat effect, while preserving the
existing non-matching boundary cases; use the public generation API rather than
adding further internal matcher assertions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: cd3d5975-0def-4841-8ed8-5c26bcee3725

📥 Commits

Reviewing files that changed from the base of the PR and between 4fc9e30 and b019b59.

📒 Files selected for processing (9)
  • agents/hermes/config/model-specific-setup.ts
  • docs/inference/local-compatible-inference-setup.mdx
  • nemoclaw-blueprint/model-specific-setup/openclaw/gpt-5-o-series-managed-inference.json
  • nemoclaw-blueprint/model-specific-setup/schema.json
  • scripts/generate-openclaw-config.mts
  • src/lib/onboard/compatible-endpoint-smoke.test.ts
  • test/generate-hermes-config.test.ts
  • test/generate-openclaw-config-gpt5-compat.test.ts
  • test/validate-config-schemas.test.ts

@github-actions

Copy link
Copy Markdown
Contributor

E2E Target Results — ✅ All selected jobs passed

Run: 29150997910
Workflow ref: tmp/e2e/pr-6643-gpt5-ff799655
Requested targets: inference-routing,network-policy,onboard-repair,onboard-resume,cloud-onboard,kimi-inference-compat
Requested jobs: (default — all default-enabled free-standing jobs; explicit-only jobs openshell-gateway-auth-contract, mcp-bridge-dev, hermes-gpu-startup, sandbox-rlimits-connect, and jetson-nvmap-gpu are skipped unless selected)
Summary: 6 passed, 0 failed, 0 cancelled, 0 skipped

Job Result
cloud-onboard ✅ success
inference-routing ✅ success
kimi-inference-compat ✅ success
network-policy ✅ success
onboard-repair ✅ success
onboard-resume ✅ success

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@github-actions

Copy link
Copy Markdown
Contributor

E2E Target Results — ✅ All selected jobs passed

Run: 29151359546
Workflow ref: tmp/e2e/pr-6643-gpt5-bc9bc4c5
Requested targets: inference-routing,network-policy,onboard-repair,onboard-resume,cloud-onboard,kimi-inference-compat
Requested jobs: (default — all default-enabled free-standing jobs; explicit-only jobs openshell-gateway-auth-contract, mcp-bridge-dev, hermes-gpu-startup, sandbox-rlimits-connect, and jetson-nvmap-gpu are skipped unless selected)
Summary: 6 passed, 0 failed, 0 cancelled, 0 skipped

Job Result
cloud-onboard ✅ success
inference-routing ✅ success
kimi-inference-compat ✅ success
network-policy ✅ success
onboard-repair ✅ success
onboard-resume ✅ success

@cv cv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Exact-head maintainer gate passed at bc9bc4c: required CI and CodeRabbit are green, all commits are Verified, six targeted live E2Es passed, and the trusted GPT advisor found no issues. The remaining Nemotron coverage suggestions are already materially exercised across resolver/config/smoke and Hermes boundary tests and are non-blocking.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/lib/inference/openai-validation-session.ts`:
- Around line 82-144: Update chatToolPayload so reasoning models identified by
the existing resolveMaxTokensField model logic do not receive the hardcoded
temperature: 0 parameter. Omit temperature for GPT-5/o1/o3/o4 models, while
preserving temperature: 0 for models that support it.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 11f7e12c-5d70-40bb-bc4c-18ba4078804e

📥 Commits

Reviewing files that changed from the base of the PR and between bc9bc4c and 91b73e9.

📒 Files selected for processing (4)
  • src/lib/inference/onboard-probes.ts
  • src/lib/inference/openai-probe-models.ts
  • src/lib/inference/openai-validation-session.test.ts
  • src/lib/inference/openai-validation-session.ts

Comment thread src/lib/inference/openai-validation-session.ts
@cv
cv merged commit d6ac21b into NVIDIA:main Jul 11, 2026
39 checks passed
@cv cv mentioned this pull request Jul 12, 2026
21 tasks
cv added a commit that referenced this pull request Jul 12, 2026
<!-- markdownlint-disable MD041 -->
## Summary

Release-prep documentation for v0.0.81 now summarizes user-facing
changes merged since v0.0.80.
It also closes the Hermes dashboard-profile backup gap and distinguishes
direct blueprint-runner actions from public host CLI commands.

## Changes

- Add the `v0.0.81` section to `docs/about/release-notes.mdx` with links
to the detailed user guides.
- Document that Hermes rebuilds preserve `.hermes/dashboard-home/`,
including Dashboard `MEMORY.md` and `USER.md`.
- Update Hermes manual backup and restore examples to transfer those two
profile files without copying generated configuration or the
secret-bearing dashboard `.env`.
- Explain the new per-item backup failure causes.
- Clarify that migration snapshot retention fragments are direct-runner
arguments and are not exposed by the host `nemoclaw` CLI.

### Source summary

- #6445 -> `docs/about/release-notes.mdx`,
`docs/manage-sandboxes/backup-restore.mdx`, and
`docs/manage-sandboxes/workspace-files.mdx`: Summarize manifest-owned
key-level restore and current-config authority.
- #6617 -> `docs/about/release-notes.mdx` and
`docs/manage-sandboxes/backup-restore.mdx`: Record the fail-closed
`/proc` fallback used to verify an idle Deep Agents runtime before
snapshot creation.
- #6685 -> `docs/about/release-notes.mdx`,
`docs/manage-sandboxes/backup-restore.mdx`, and
`docs/manage-sandboxes/workspace-files.mdx`: Document Hermes Web
Dashboard profile persistence and safe manual transfer.
- #6649 -> `docs/about/release-notes.mdx`: Summarize host-validated
loopback compatible-endpoint routing through the sandbox gateway.
- #6643 -> `docs/about/release-notes.mdx`: Summarize automatic
`max_completion_tokens` handling for GPT-5 and o-series models.
- #6661 -> `docs/about/release-notes.mdx`: Summarize bounded connection
reuse for eligible provider-validation probes.
- #6704 -> `docs/about/release-notes.mdx`: Record that direct blueprint
apply stops instead of persisting incomplete state after provider or
inference setup fails.
- #6677 -> `docs/about/release-notes.mdx`: Summarize transactional
recovery for legacy Docker containers whose managed supervisor
disappeared after restart.
- #6625 -> `docs/about/release-notes.mdx`: Record Hermes managed-startup
persistence across direct Docker restarts.
- #6597 -> `docs/about/release-notes.mdx`: Record final-sandbox gateway
cleanup on macOS.
- #6680 -> `docs/about/release-notes.mdx`: Summarize managed Deep Agents
first-run and process-tree cleanup improvements.
- #6647 -> `docs/about/release-notes.mdx`: Record fail-closed validation
for the managed Deep Agents fetch CA bundle.
- #6645 -> `docs/about/release-notes.mdx`: Summarize WhatsApp loopback
pairing and trusted npm plugin provenance.
- #6673 -> `docs/about/release-notes.mdx` and
`docs/manage-sandboxes/backup-restore.mdx`: Document stopped-sandbox
backup remediation.
- #6631 -> `docs/about/release-notes.mdx` and
`docs/manage-sandboxes/backup-restore.mdx`: Document per-item backup
failure causes.
- #6620 -> `docs/about/release-notes.mdx`: Record the
created-but-not-ready sandbox lifecycle receipt.
- #6664 -> `docs/about/release-notes.mdx`: Record prompt-aware
onboarding progress output.
- #6598 -> `docs/about/release-notes.mdx`: Summarize stale replay-result
invalidation during resumed onboarding.
- #6593 -> `docs/about/release-notes.mdx`: Summarize contextual OpenClaw
audit findings for managed dashboard compatibility settings.
- #6650 -> `docs/about/release-notes.mdx`: Record redaction of
token-shaped URL query values.
- #6638 -> `docs/about/release-notes.mdx`: Record the exact-path MCP
`DELETE` policy recipe for session termination.
- #5453 -> `docs/reference/host-files-and-state.mdx`: Clarify that
snapshot retention actions belong to direct runner integrations and are
not standalone host CLI commands.

### Skipped from docs-skip

- #6633 matched the `openclaw-sandbox-permissive.yaml` path in
`docs/.docs-skip` and produced no documentation in this update.

## Type of Change

- [ ] Code change (feature, bug fix, or refactor)
- [ ] Code change with doc updates
- [ ] Doc only (prose changes, no code sample modifications)
- [x] Doc only (includes code sample changes)

## Quality Gates

- [ ] Tests added or updated for changed behavior
- [ ] Existing tests cover changed behavior — justification:
- [x] Tests not applicable — justification: This is a documentation-only
release-prep update; behavior is protected by the merged source PRs, and
the documentation build validates the changed examples and routes.
- [x] Docs updated for user-facing behavior changes
- [ ] Docs not applicable — justification:
- [ ] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [ ] Sensitive-path review completed or maintainer-approved waiver
recorded — reviewer/approval link/justification:
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## Verification

- [x] PR description includes the DCO sign-off declaration and every
commit appears as `Verified` in GitHub
- [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or
`npm run check:diff` passed when hooks were skipped or unavailable
- [x] Targeted behavior tests pass for the current change set, or tests
are marked not applicable above — tests are not applicable for this
documentation-only change; `npm run docs` completed successfully.
- [ ] Applicable broad gate passed — `npm test` for broad
runtime/test-harness changes; `npm run check` for repo-wide
validation/coverage changes — command/result: not run for this
documentation-only change.
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [ ] `npm run docs` builds without warnings (doc changes only) — 0
errors; two existing Fern warnings remain.
- [x] Doc pages follow the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)
— no new pages.

---
Signed-off-by: Carlos Villela <cvillela@nvidia.com>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Documentation**
- Added release notes for v0.0.81 covering state preservation, inference
setup, sandbox recovery, session setup, pairing, diagnostics, and
security policy updates.
- Expanded backup and restore guidance to include dashboard profile
files and clarify files that must not be copied.
- Added dashboard profile persistence details to workspace and rebuild
documentation.
- Clarified snapshot retention guidance and the distinction between host
CLI capabilities and direct runner actions.
  - Added more detailed backup failure reporting information.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Hadar301 pushed a commit to Hadar301/NemoClaw-OpenShift that referenced this pull request Jul 12, 2026
…els (NVIDIA#6643)

## Summary

GPT-5-family models and the o1/o3/o4 reasoning series (including Azure
OpenAI deployments) reject the legacy `max_tokens` parameter on
`/chat/completions` with `HTTP 400: Unsupported parameter: 'max_tokens'
... Use 'max_completion_tokens' instead`. As a result, onboarding and
agent turns against `gpt-5.4` on a custom OpenAI-compatible provider
fail out of the box. This routes the reply-budget field to
`max_completion_tokens` for those model families.

## Related Issue

Fixes NVIDIA#6642

## Changes

- Add a shared `resolveMaxTokensField()` resolver
(`src/lib/inference/max-tokens-field.ts`) that returns
`max_completion_tokens` for GPT-5 and o-series (`o1`/`o3`/`o4`) models
and `max_tokens` otherwise. Prefix-matched so provider-prefixed and
Azure-suffixed ids (`azure/gpt-5.4`, `gpt-5.4-turbo`) resolve correctly.
- Use the resolver in the host onboarding probes (`onboard-probes.ts`,
both the compatible-endpoint payload and the strict tool-call probe) and
the in-sandbox compatible-endpoint smoke script
(`compatible-endpoint-smoke.ts`), so host and sandbox agree on the field
name.
- Expand the declarative OpenClaw model setup to bounded GPT-5 and
o1/o3/o4 family prefixes, including provider-prefixed and suffixed model
IDs, while preserving exact-match behavior for existing manifests.
- Add unit and integration coverage for resolver, probe, smoke retry,
schema, and OpenClaw/Hermes config-generation behavior.
- Document the automatic GPT-5/o-series reply-budget field selection in
the compatible-endpoint guide.

## Type of Change

- [ ] Code change (feature, bug fix, or refactor)
- [x] Code change with doc updates
- [ ] Doc only (prose changes, no code sample modifications)
- [ ] Doc only (includes code sample changes)

## Quality Gates
- [x] Tests added or updated for changed behavior
- [ ] Existing tests cover changed behavior — justification:
- [ ] Tests not applicable — justification:
- [x] Docs updated for user-facing behavior changes
- [ ] Docs not applicable — justification:
- [x] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [ ] Sensitive-path review completed or maintainer-approved waiver
recorded — reviewer/approval link/justification: requesting maintainer
sensitive-path review (inference/onboarding); contributor cannot
self-approve.
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## Verification
- [x] PR description includes the DCO sign-off declaration and every
commit appears as `Verified` in GitHub
- [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or
`npm run check:diff` passed when hooks were skipped or unavailable
- [x] Targeted behavior tests pass for the current change set, or tests
are marked not applicable above — command/result: affected Vitest slice
→ 384 passed; focused post-hook generator slice → 142 passed; `npm run
typecheck:cli`, `npm run validate:configs`, `npm run test:titles:check`,
and the normal commit/push hooks passed.
- [ ] Applicable broad gate passed — `npm test` for broad
runtime/test-harness changes; `npm run check` for repo-wide
validation/coverage changes — command/result: not applicable (scoped
inference-probe change, no test-harness or repo-wide validation
changes).
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [x] `npm run docs` builds without errors (doc changes only)
- [x] Doc pages follow the style guide (doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)

---
Signed-off-by: Greg Mercer <gmercer@stanford.edu>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added automatic token-budget compatibility for GPT-5 and o-series
models, switching between `max_tokens` and `max_completion_tokens` as
needed.
* Added model-family matching via bounded prefixes (including
provider-prefixed model IDs) and updated generated OpenClaw/Hermes
configs accordingly.
* Added a new managed inference blueprint for GPT-5 and o-series
routing.
* **Bug Fixes**
* Improved tool-calling and strict probe payloads to consistently use
the correct token field.
  * Enhanced reasoning retries to preserve the correct token budget.
* **Documentation**
* Updated guidance on reply-budget handling for supported model
families.
* **Tests**
* Expanded coverage for token-field selection, prefix matching, and
config validation/schema rules.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Greg Mercer <gmercer@stanford.edu>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Carlos Villela <cvillela@nvidia.com>
Hadar301 pushed a commit to Hadar301/NemoClaw-OpenShift that referenced this pull request Jul 12, 2026
<!-- markdownlint-disable MD041 -->
## Summary

Release-prep documentation for v0.0.81 now summarizes user-facing
changes merged since v0.0.80.
It also closes the Hermes dashboard-profile backup gap and distinguishes
direct blueprint-runner actions from public host CLI commands.

## Changes

- Add the `v0.0.81` section to `docs/about/release-notes.mdx` with links
to the detailed user guides.
- Document that Hermes rebuilds preserve `.hermes/dashboard-home/`,
including Dashboard `MEMORY.md` and `USER.md`.
- Update Hermes manual backup and restore examples to transfer those two
profile files without copying generated configuration or the
secret-bearing dashboard `.env`.
- Explain the new per-item backup failure causes.
- Clarify that migration snapshot retention fragments are direct-runner
arguments and are not exposed by the host `nemoclaw` CLI.

### Source summary

- NVIDIA#6445 -> `docs/about/release-notes.mdx`,
`docs/manage-sandboxes/backup-restore.mdx`, and
`docs/manage-sandboxes/workspace-files.mdx`: Summarize manifest-owned
key-level restore and current-config authority.
- NVIDIA#6617 -> `docs/about/release-notes.mdx` and
`docs/manage-sandboxes/backup-restore.mdx`: Record the fail-closed
`/proc` fallback used to verify an idle Deep Agents runtime before
snapshot creation.
- NVIDIA#6685 -> `docs/about/release-notes.mdx`,
`docs/manage-sandboxes/backup-restore.mdx`, and
`docs/manage-sandboxes/workspace-files.mdx`: Document Hermes Web
Dashboard profile persistence and safe manual transfer.
- NVIDIA#6649 -> `docs/about/release-notes.mdx`: Summarize host-validated
loopback compatible-endpoint routing through the sandbox gateway.
- NVIDIA#6643 -> `docs/about/release-notes.mdx`: Summarize automatic
`max_completion_tokens` handling for GPT-5 and o-series models.
- NVIDIA#6661 -> `docs/about/release-notes.mdx`: Summarize bounded connection
reuse for eligible provider-validation probes.
- NVIDIA#6704 -> `docs/about/release-notes.mdx`: Record that direct blueprint
apply stops instead of persisting incomplete state after provider or
inference setup fails.
- NVIDIA#6677 -> `docs/about/release-notes.mdx`: Summarize transactional
recovery for legacy Docker containers whose managed supervisor
disappeared after restart.
- NVIDIA#6625 -> `docs/about/release-notes.mdx`: Record Hermes managed-startup
persistence across direct Docker restarts.
- NVIDIA#6597 -> `docs/about/release-notes.mdx`: Record final-sandbox gateway
cleanup on macOS.
- NVIDIA#6680 -> `docs/about/release-notes.mdx`: Summarize managed Deep Agents
first-run and process-tree cleanup improvements.
- NVIDIA#6647 -> `docs/about/release-notes.mdx`: Record fail-closed validation
for the managed Deep Agents fetch CA bundle.
- NVIDIA#6645 -> `docs/about/release-notes.mdx`: Summarize WhatsApp loopback
pairing and trusted npm plugin provenance.
- NVIDIA#6673 -> `docs/about/release-notes.mdx` and
`docs/manage-sandboxes/backup-restore.mdx`: Document stopped-sandbox
backup remediation.
- NVIDIA#6631 -> `docs/about/release-notes.mdx` and
`docs/manage-sandboxes/backup-restore.mdx`: Document per-item backup
failure causes.
- NVIDIA#6620 -> `docs/about/release-notes.mdx`: Record the
created-but-not-ready sandbox lifecycle receipt.
- NVIDIA#6664 -> `docs/about/release-notes.mdx`: Record prompt-aware
onboarding progress output.
- NVIDIA#6598 -> `docs/about/release-notes.mdx`: Summarize stale replay-result
invalidation during resumed onboarding.
- NVIDIA#6593 -> `docs/about/release-notes.mdx`: Summarize contextual OpenClaw
audit findings for managed dashboard compatibility settings.
- NVIDIA#6650 -> `docs/about/release-notes.mdx`: Record redaction of
token-shaped URL query values.
- NVIDIA#6638 -> `docs/about/release-notes.mdx`: Record the exact-path MCP
`DELETE` policy recipe for session termination.
- NVIDIA#5453 -> `docs/reference/host-files-and-state.mdx`: Clarify that
snapshot retention actions belong to direct runner integrations and are
not standalone host CLI commands.

### Skipped from docs-skip

- NVIDIA#6633 matched the `openclaw-sandbox-permissive.yaml` path in
`docs/.docs-skip` and produced no documentation in this update.

## Type of Change

- [ ] Code change (feature, bug fix, or refactor)
- [ ] Code change with doc updates
- [ ] Doc only (prose changes, no code sample modifications)
- [x] Doc only (includes code sample changes)

## Quality Gates

- [ ] Tests added or updated for changed behavior
- [ ] Existing tests cover changed behavior — justification:
- [x] Tests not applicable — justification: This is a documentation-only
release-prep update; behavior is protected by the merged source PRs, and
the documentation build validates the changed examples and routes.
- [x] Docs updated for user-facing behavior changes
- [ ] Docs not applicable — justification:
- [ ] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [ ] Sensitive-path review completed or maintainer-approved waiver
recorded — reviewer/approval link/justification:
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## Verification

- [x] PR description includes the DCO sign-off declaration and every
commit appears as `Verified` in GitHub
- [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or
`npm run check:diff` passed when hooks were skipped or unavailable
- [x] Targeted behavior tests pass for the current change set, or tests
are marked not applicable above — tests are not applicable for this
documentation-only change; `npm run docs` completed successfully.
- [ ] Applicable broad gate passed — `npm test` for broad
runtime/test-harness changes; `npm run check` for repo-wide
validation/coverage changes — command/result: not run for this
documentation-only change.
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [ ] `npm run docs` builds without warnings (doc changes only) — 0
errors; two existing Fern warnings remain.
- [x] Doc pages follow the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)
— no new pages.

---
Signed-off-by: Carlos Villela <cvillela@nvidia.com>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Documentation**
- Added release notes for v0.0.81 covering state preservation, inference
setup, sandbox recovery, session setup, pairing, diagnostics, and
security policy updates.
- Expanded backup and restore guidance to include dashboard profile
files and clarify files that must not be copied.
- Added dashboard profile persistence details to workspace and rebuild
documentation.
- Clarified snapshot retention guidance and the distinction between host
CLI capabilities and direct runner actions.
  - Added more detailed backup failure reporting information.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@wscurran wscurran added area: inference Inference routing, serving, model selection, or outputs area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow area: providers Inference provider integrations and provider behavior bug-fix PR fixes a bug or regression labels Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: inference Inference routing, serving, model selection, or outputs area: onboarding Onboarding FSM, provider setup, sandbox launch, or first-run flow area: providers Inference provider integrations and provider behavior bug-fix PR fixes a bug or regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gpt-5.4 on a custom OpenAI-compatible provider fails: chat/completions rejects max_tokens (needs max_completion_tokens)

4 participants