Commit 865e3f9
fix(dcode): apply the compatible-endpoint reasoning effort at runtime (#7971)
<!-- markdownlint-disable MD041 -->
## 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_effort` request parameter.
## Related Issue
Fixes #7938
## Changes
- `agents/langchain-deepagents-code/Dockerfile` declares `ARG
NEMOCLAW_REASONING_EFFORT`, validates it as empty, `low`, `medium`, or
`high` at build time, and writes it to root-owned `0444`
`/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.py` adds
`managed_reasoning_effort()`. It repeats the fail-closed shape of
`managed_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 returns `None`, which
keeps the endpoint default. Direct-module cases in
`test/langchain-deepagents-code-reasoning-effort.test.ts` pin the
rejected shapes.
- `agents/langchain-deepagents-code/patch-managed-deepagents-code.py`
sets `extra_body.reasoning_effort` on the managed OpenAI adapter. The
hardened resolver never consumes the mutable `config.toml` params 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.ts` records the
effort in the generated per-model params table. `extra_body` now 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.sh` allows the new ARG name.
The gate refuses any unlisted ARG, so the build fails without this
entry.
- Docs record the build-time behavior for Deep Agents Code and correct
the model-capabilities page, which previously implied `inference set`
could change the effort on a Deep Agents Code sandbox.
## 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
<!-- Check one tests line and one docs line. Check other lines when
applicable. Add every requested justification or approval reference. -->
- [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:
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:
## Documentation Writer Review
<!-- Required for code and documentation changes after the changes and
applicable validation are complete. Keep one review checkbox and one
instance of each visible or hidden field. For Evidence, list changed
documentation paths. For documentation-only changes, also state that the
writing rules and documentation style were reviewed. For other results,
explain why no documentation change is needed or why the review is
blocked. For Agent, use a consistent product and surface name, such as
Codex Desktop, Codex CLI, Claude Code, or Cursor. After committing all
review changes, put `git rev-parse --short HEAD` and `git rev-parse
--short HEAD:AGENTS.md` in the hidden metadata below. Rerun the review
and refresh that metadata after any new commit. This receipt is advisory
during the data-collection pilot. -->
- [ ] Documentation writer subagent reviewed the completed changes
- Result: `blocked`
- Evidence: `docs/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 docs` reports 0 errors, including the
route check that rejected an earlier cross-variant link.
- Agent: Claude Code
<!-- docs-review-head-sha: 2a09f90 -->
<!-- docs-review-agents-blob-sha: c052d60 -->
## DGX Station Hardware Evidence
<!-- Required only when scripts/prepare-dgx-station-host.sh changes.
Maintainers must review the linked evidence before approving or merging.
This is human-reviewed evidence, not authenticated hardware provenance.
Exceptional bypasses use existing repository governance and must be
documented on the PR. -->
- [ ] Tested on DGX Station
- Tested commit:
- Station profile/scenario:
- Result:
- Supporting evidence:
## Verification
<!-- Check each applicable item only when supported by the requested
evidence. Run targeted tests once per relevant change set and rerun
after later edits or hook autofixes that can affect the tested behavior.
Do not rerun hook-covered checks. -->
- [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 --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:cli` reports 0 errors.
- [ ] Applicable broad gate passed — `npm test` for broad
runtime/test-harness changes; `npm run check` for repo-wide
validation/coverage changes — command/result:
- [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)
- [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)
---
<!-- DCO sign-off is required in this PR description, and every commit
must appear as Verified in GitHub. Run: git config user.name && git
config user.email -->
Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Added configurable reasoning-effort levels—low, medium, or high—for
supported Deep Agents Code inference endpoints.
* Leaving the setting unset preserves the endpoint default; invalid or
unsafe values are safely ignored.
* Changes require fresh onboarding with sandbox recreation.
* **Documentation**
* Clarified supported workflows and configuration behavior.
* **Tests**
* Added coverage for valid, unset, invalid, unsafe, and
provider-specific settings.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
Co-authored-by: J. Yaunches <jyaunches@nvidia.com>1 parent 0d5c876 commit 865e3f9
17 files changed
Lines changed: 397 additions & 33 deletions
File tree
- agents/langchain-deepagents-code
- docs
- get-started
- inference
- scripts
- src/lib/onboard
- managed-startup
- test
- helpers
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
| |||
131 | 132 | | |
132 | 133 | | |
133 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
134 | 139 | | |
135 | 140 | | |
136 | 141 | | |
| |||
143 | 148 | | |
144 | 149 | | |
145 | 150 | | |
146 | | - | |
147 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
148 | 154 | | |
149 | 155 | | |
150 | 156 | | |
| |||
165 | 171 | | |
166 | 172 | | |
167 | 173 | | |
| 174 | + | |
168 | 175 | | |
169 | 176 | | |
170 | 177 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| 22 | + | |
20 | 23 | | |
21 | 24 | | |
22 | 25 | | |
| |||
63 | 66 | | |
64 | 67 | | |
65 | 68 | | |
| 69 | + | |
66 | 70 | | |
67 | 71 | | |
68 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
69 | 82 | | |
70 | 83 | | |
71 | 84 | | |
| |||
165 | 178 | | |
166 | 179 | | |
167 | 180 | | |
168 | | - | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
169 | 185 | | |
170 | 186 | | |
171 | 187 | | |
172 | 188 | | |
173 | 189 | | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
182 | 206 | | |
183 | 207 | | |
184 | 208 | | |
185 | 209 | | |
186 | 210 | | |
187 | 211 | | |
| 212 | + | |
188 | 213 | | |
189 | 214 | | |
190 | 215 | | |
| |||
199 | 224 | | |
200 | 225 | | |
201 | 226 | | |
202 | | - | |
| 227 | + | |
203 | 228 | | |
204 | 229 | | |
205 | 230 | | |
| |||
216 | 241 | | |
217 | 242 | | |
218 | 243 | | |
219 | | - | |
| 244 | + | |
220 | 245 | | |
221 | 246 | | |
222 | 247 | | |
| |||
Lines changed: 67 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
44 | 53 | | |
45 | 54 | | |
46 | 55 | | |
| |||
1309 | 1318 | | |
1310 | 1319 | | |
1311 | 1320 | | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
1312 | 1379 | | |
1313 | 1380 | | |
1314 | 1381 | | |
| |||
Lines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
511 | 511 | | |
512 | 512 | | |
513 | 513 | | |
514 | | - | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
515 | 518 | | |
516 | 519 | | |
517 | 520 | | |
| |||
527 | 530 | | |
528 | 531 | | |
529 | 532 | | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
530 | 536 | | |
531 | 537 | | |
532 | 538 | | |
| |||
1735 | 1741 | | |
1736 | 1742 | | |
1737 | 1743 | | |
1738 | | - | |
| 1744 | + | |
1739 | 1745 | | |
1740 | 1746 | | |
| 1747 | + | |
1741 | 1748 | | |
1742 | 1749 | | |
1743 | 1750 | | |
| |||
1752 | 1759 | | |
1753 | 1760 | | |
1754 | 1761 | | |
1755 | | - | |
| 1762 | + | |
1756 | 1763 | | |
1757 | 1764 | | |
1758 | 1765 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
124 | 127 | | |
125 | 128 | | |
126 | 129 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
90 | 93 | | |
91 | 94 | | |
92 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
222 | | - | |
| 222 | + | |
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| |||
526 | 526 | | |
527 | 527 | | |
528 | 528 | | |
| 529 | + | |
529 | 530 | | |
530 | 531 | | |
531 | 532 | | |
| |||
536 | 537 | | |
537 | 538 | | |
538 | 539 | | |
| 540 | + | |
539 | 541 | | |
540 | 542 | | |
541 | 543 | | |
| |||
563 | 565 | | |
564 | 566 | | |
565 | 567 | | |
| 568 | + | |
566 | 569 | | |
567 | 570 | | |
568 | 571 | | |
| |||
606 | 609 | | |
607 | 610 | | |
608 | 611 | | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
609 | 621 | | |
610 | 622 | | |
611 | 623 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
298 | | - | |
| 298 | + | |
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
| 401 | + | |
401 | 402 | | |
402 | 403 | | |
403 | 404 | | |
| |||
434 | 435 | | |
435 | 436 | | |
436 | 437 | | |
437 | | - | |
| 438 | + | |
438 | 439 | | |
439 | 440 | | |
440 | 441 | | |
| |||
0 commit comments