fix(dcode): apply the compatible-endpoint reasoning effort at runtime - #7971
Conversation
Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThe change adds managed reasoning-effort configuration for LangChain Deep Agents Code. DCode profiles resolve ChangesManaged DCode reasoning effort
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant StartupProfile
participant ImageBuild
participant GenerateConfig
participant ManagedRuntime
participant ProviderPatch
participant OpenAIEndpoint
StartupProfile->>ImageBuild: Provide NEMOCLAW_REASONING_EFFORT
ImageBuild->>ImageBuild: Validate and record reasoning effort
GenerateConfig->>GenerateConfig: Read and validate NEMOCLAW_REASONING_EFFORT
ManagedRuntime->>ManagedRuntime: Read managed_reasoning_effort()
ProviderPatch->>ProviderPatch: Add extra_body.reasoning_effort
ProviderPatch->>OpenAIEndpoint: Send request with reasoning_effort
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in commit 0a71152 in the TypeScript / code-coverage/cliThe overall coverage in commit 0a71152 in the Show a code coverage summary of the most impacted files.
Updated |
|
🌿 Preview your docs: https://nvidia-preview-pr-7971.docs.buildwithfern.com/nemoclaw |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 `@agents/langchain-deepagents-code/managed-dcode-runtime.py`:
- Around line 1333-1338: Extend the reasoning-effort negative-path tests around
managed_reasoning_effort() to replace the fixture capability path with a
symbolic link, then assert the function returns None and generated OpenAI kwargs
omit extra_body. Ensure the test also verifies the rejection does not expose
sensitive capability-path details through errors, logs, state, or process
arguments.
In `@docs/inference/configure-model-capabilities.mdx`:
- Line 92: Update the reasoning-effort instruction associated with the page’s
agent-variants metadata to refer only to OpenClaw, removing the Hermes reference
from this OpenClaw-only page. Do not add Hermes guidance here; place it on a
page published for Hermes if needed, and ensure rendered navigation remains
scoped to the correct agent variant.
In `@test/langchain-deepagents-code-reasoning-effort.test.ts`:
- Around line 81-91: Remove the contents-based conditional from the
parameterized test using writeManagedReasoningEffort. Move the null “missing
capability file” case into a separate it block, and keep the remaining
parameterized cases limited to inputs that write a capability file.
🪄 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: 0dad58f5-7144-4d7b-bfd4-74bfda096843
📒 Files selected for processing (10)
agents/langchain-deepagents-code/Dockerfileagents/langchain-deepagents-code/generate-config.tsagents/langchain-deepagents-code/managed-dcode-runtime.pyagents/langchain-deepagents-code/patch-managed-deepagents-code.pydocs/get-started/quickstart-langchain-deepagents-code.mdxdocs/inference/configure-model-capabilities.mdxscripts/check-dcode-profile-import-gate.shtest/helpers/langchain-deepagents-code-patch-fixture.tstest/langchain-deepagents-code-config.test.tstest/langchain-deepagents-code-reasoning-effort.test.ts
PR Review Advisor — No blocking findings reportedAdvisor assessment: No blocking advisor findings reported Model lanes
Nemotron output stays in workflow artifacts and does not change the assessment above. E2E guidanceAdvisory only. E2E / PR Gate selects and runs jobs independently. Recommended E2E: This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge. |
…onal Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
The managed startup profile requires every stock Docker input to map to a versioned startup field or a declared build-only exclusion, and the new reasoning-effort build argument had neither. It now maps to the same tuning field OpenClaw uses, and the DCode mapper emits the root-owned capability file the sandbox runtime reads, matching the auto-approval input it sits beside. Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
jyaunches
left a comment
There was a problem hiding this comment.
Approved after exact-revision merge gate: current head/base CI and selected E2E evidence pass, the linked supported regression is covered by tests and documentation, contributor requirements pass, and no unresolved correctness or security findings remain.
<!-- markdownlint-disable MD041 --> ## Summary Adds the canonical dated changelog entry for `v0.0.100` so the maintainer release plan can verify the pre-tag documentation prerequisite. The entry summarizes the user-facing changes merged since `v0.0.99` and links to the relevant guides. ## Changes - Add `docs/changelog/2026-07-31.mdx` with the exact `## v0.0.100` heading. - Cover restored OpenClaw pairing, transactional replacement, Deep Agents Code, onboarding recovery, lifecycle cleanup, Hermes builds, host provenance, documentation, and trusted E2E evidence. - Distinguish active Docker and Kubernetes runtime-bundle enforcement from the still-inactive managed shared-state transaction foundation. ## Source Coverage The release entry maps the doc-impacting merged PRs in the `v0.0.99..main` release range to `docs/changelog/2026-07-31.mdx`: #8021, #8024, #7973, #8028, #7947, #7788, #7884, #8023, #7969, #8020, #7989, #8000, #7907, #7942, #7567, #8013, #7955, #8017, #8014, #8015, #7629, #7644, #7821, #7971, and #7991. PR #7974 was reviewed after the final rebase and excluded because it changes internal maintainer-skill attribution policy and tests only; it does not change a user-facing product or documentation surface. ## Type of Change - [ ] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [x] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Quality Gates - [ ] Tests added or updated for changed behavior - [x] Existing tests cover changed behavior — justification: the changelog contract test validates the dated entry, version heading, SPDX form, and route constraints. - [ ] Tests not applicable — justification: - [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: ## Documentation Writer Review - [x] Documentation writer subagent reviewed the completed changes - Result: `docs-updated` - Evidence: `docs/changelog/2026-07-31.mdx`; exact-head review passed for `6093f44f`; writing rules and documentation style reviewed; `npx vitest run test/changelog-docs.test.ts` passed 6/6; `npm run docs` passed with zero Fern errors and two generic Fern upgrade notices. - Agent: Codex Desktop <!-- docs-review-head-sha: 6093f44 --> <!-- docs-review-agents-blob-sha: 3dd7c24 --> ## DGX Station Hardware Evidence - [ ] Tested on DGX Station - Tested commit: Not applicable; no DGX Station host script changed. - Station profile/scenario: Not applicable. - Result: Not applicable. - Supporting evidence: Not applicable. ## Verification - [x] PR description includes a `Signed-off-by:` line and every commit appears as `Verified` in GitHub - [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or `npm run validate:pr` passed after refreshing `origin/main` 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 or justification: `npx vitest run test/changelog-docs.test.ts` passed 6/6 at `6093f44f`. - [ ] 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 to a dated prose-only release entry. - [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) — validation passed with zero errors; Fern emitted two generic upgrade notices. - [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) — the changelog entry has the required parser-safe MDX SPDX header; dated changelog entries intentionally do not use page frontmatter. --- Signed-off-by: Senthil Ravichandran <senthilr@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Added release notes for v0.0.100. * Documented improvements to restore pairing, sandbox replacement, onboarding recovery, lifecycle cleanup, runtime handling, build support, host readiness, and end-to-end validation. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Senthil Ravichandran <senthilr@nvidia.com>
Summary
A NemoClaw-managed Deep Agents Code sandbox recorded a compatible-endpoint reasoning effort in registry state but sent every model request without it, so the endpoint default applied instead. The managed image now bakes the recorded effort into a root-owned file, and the managed provider resolver supplies it as an
extra_body.reasoning_effortrequest parameter.Related Issue
Fixes #7938
Changes
agents/langchain-deepagents-code/DockerfiledeclaresARG NEMOCLAW_REASONING_EFFORT, validates it as empty,low,medium, orhighat build time, and writes it to root-owned0444/usr/local/share/nemoclaw/dcode-reasoning-effort. The staged-Dockerfile patcher already rewrote this ARG name for OpenClaw; with no matching declaration here the rewrite was a silent no-op.agents/langchain-deepagents-code/managed-dcode-runtime.pyaddsmanaged_reasoning_effort(). It repeats the fail-closed shape ofmanaged_auto_approval_mode()because both read image state that runtime must not trust: ownership, mode, exact size,O_NOFOLLOW, and a read-race check. An unsafe or unrecognized file returnsNone, which keeps the endpoint default. Direct-module cases intest/langchain-deepagents-code-reasoning-effort.test.tspin the rejected shapes.agents/langchain-deepagents-code/patch-managed-deepagents-code.pysetsextra_body.reasoning_efforton the managed OpenAI adapter. The hardened resolver never consumes the mutableconfig.tomlparams table, so a generator-only change cannot reach the request. The same file adds the new function to the stale-helper guard, which now covers every managed capability rather than auto-approval alone.agents/langchain-deepagents-code/generate-config.tsrecords the effort in the generated per-model params table.extra_bodynow merges the Ultra template argument and the reasoning effort into one table; an unset effort produces byte-identical output to before.scripts/check-dcode-profile-import-gate.shallows the new ARG name. The gate refuses any unlisted ARG, so the build fails without this entry.inference setcould change the effort on a Deep Agents Code sandbox.Type of Change
Quality Gates
Documentation Writer Review
blockeddocs/get-started/quickstart-langchain-deepagents-code.mdx,docs/inference/configure-model-capabilities.mdx. The authoring host ran with subagents disabled, so no documentation writer subagent reviewed the change.npm run docsreports 0 errors, including the route check that rejected an earlier cross-variant link.DGX Station Hardware Evidence
Verification
Signed-off-by:line and every commit appears asVerifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passed, ornpm run validate:prpassed after refreshingorigin/mainwhen hooks were skipped or unavailablenpx vitest run --project integration test/langchain-deepagents-code-config.test.ts test/langchain-deepagents-code-reasoning-effort.test.ts test/langchain-deepagents-code-direct-module-patch.test.ts test/langchain-deepagents-code-nemotron-profile-plugin.test.ts test/langchain-deepagents-code-image.test.ts test/langchain-deepagents-code-auto-approval-image.test.ts test/langchain-deepagents-code-profile-build-gate.test.ts— 7 files, 150 tests passed.npm run typecheck:clireports 0 errors.npm testfor broad runtime/test-harness changes;npm run checkfor repo-wide validation/coverage changes — command/result:npm run docsbuilds without warnings (doc changes only)Signed-off-by: Tinson Lai tinsonl@nvidia.com
Summary by CodeRabbit
New Features
Documentation
Tests