Skip to content

fix(dcode): route fetch_url through managed proxy - #6495

Merged
cv merged 38 commits into
mainfrom
ericksoa/fix-dcode-fetch-proxy
Jul 9, 2026
Merged

fix(dcode): route fetch_url through managed proxy#6495
cv merged 38 commits into
mainfrom
ericksoa/fix-dcode-fetch-proxy

Conversation

@ericksoa

@ericksoa ericksoa commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Route managed Deep Agents Code fetch_url requests through NemoClaw's policy
proxy instead of the package's direct DNS-pinning transport. The direct
transport is valid outside the sandbox, but it cannot resolve destinations in
the managed proxy-only network path and produces misleading DNS failures while
proxy-aware tools continue to work.

The adapter is limited to the pinned deepagents-code==0.1.34 managed image.
Unmanaged imports retain the upstream transport.

Source boundary and lifecycle

  • Invalid state: DCode 0.1.34 disables ambient proxies and performs local DNS
    pinning for fetch_url; managed NemoClaw egress and destination resolution
    must instead pass through the policy proxy.
  • Source boundary: NemoClaw owns the image, launchers, and policy contract, but
    not the hash-locked third-party fetch_url implementation.
  • Integrity boundary: the runtime independently reconstructs the proxy URL from
    root-owned, mode-0444 host/port files and requires the explicit managed and
    conventional proxy variables to match. Requests ambient proxy discovery and
    NO_PROXY bypass remain disabled on every redirect hop.
  • Removal condition: delete the exact-version adapter when a pinned DCode
    release provides a supported policy-proxy transport with equivalent redirect
    validation and fail-closed behavior.

Changes

  • Patch the exact DCode 0.1.34 fetch_url redirect path only in managed launches.
  • Fail closed on forged proxy environments, unsafe root-owned proxy files,
    malformed targets/proxies, credentialed redirects, and redirect-limit drift.
  • Open the configured CA bundle with no-follow and metadata checks, pin that
    validated file descriptor for the whole redirect chain, and rewind per hop;
    concurrent path mutation can yield only the original trust bytes or a generic
    validation failure.
  • Normalize initial and redirect target validation to generic non-reflecting
    errors, including IDNA failures.
  • Allow raw.githubusercontent.com only for GET/HEAD so DCode can follow GitHub
    file links and read repository source; repository/ref/path segments vary by
    task, so the host route is constrained by method and managed binary.
  • Require the live egress check to receive a nonempty 2xx body, and explicitly
    deny an unapproved host, cloud metadata, and loopback.
  • Recognize a strictly validated managed-policy denial when curl interleaves the
    proxy JSON body with its own stderr text; keep the existing size bound, exact
    error code, and structured denial-detail checks.
  • Preserve the credential-free observability enable bit across environment-
    less policy restarts, with explicit 1/0 on create/rebuild/clone paths.
  • Document the managed network-policy behavior and adapter lifecycle.

Automated advisor dispositions

  • PRA-1 — justified as intentional. Underscores are accepted only for
    controlled internal/container proxy aliases, preserving parity with the
    host-side validator. The value is reconstructed from canonical root-owned
    mode-0444 files and selects the managed proxy endpoint, not a fetch
    destination. Cross-boundary tests cover proxy_name and the full port range.
  • PRA-2 — justified per RFC 3986. Userinfo exists only in the URI authority;
    @ and : after the authority are ordinary path characters and can occur
    in repository paths. Every hop still rejects authority userinfo, requires
    HTTPS, validates host and port, uses the explicit policy proxy as the
    destination/SSRF authority, and returns validation errors without reflecting
    the candidate URL. Tests cover allowed path data and rejected authority
    credentials.
  • PRA-2 (final 204 finding) — intentionally retained. This is a GET/read
    acceptance check for the approved raw GitHub README, not a generic HTTP
    reachability check. A 204 or zero-length body cannot satisfy the repository-
    source reading use case and would mask an empty fetch; HEAD is not used. The
    dependency review and change summary document the nonempty 2xx contract, and
    deterministic success/denial self-tests cover classifier behavior.
  • Runtime follow-up — satisfied on final head: all four required targets
    (DCode, cloud-onboard, network-policy, and snapshot) passed in
    run 28985313040, attempt 2.
    The failed first cloud-onboard attempt was a GitHub HTTP 429 before NemoClaw
    ran; an isolated exact-head retry
    also passed.

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: pending maintainer review
  • 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 — initial combined suites passed 169/169 and the post-hook subset passed 43/43; the final current-main focused suite passed 308 tests with 1 intentional skip; npm run check:diff and npm run build:cli passed
  • Applicable broad gate passed — final exact-head regular CI completed with 42 passes and 2 expected skips; DCode, cloud-onboard, network-policy, and snapshot all passed in run 28985313040, attempt 2
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed
  • npm run docs builds without warnings (doc changes only) — 0 errors and 2 pre-existing Fern warnings
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Signed-off-by: Aaron Erickson aerickson@nvidia.com

Summary by CodeRabbit

  • New Features

    • Added managed fetch support for Deep Agents Code, including trusted proxy handling, redirect-aware fetching, and stricter network policy controls.
    • Expanded network access to allow read-only access to raw.githubusercontent.com for repository file retrieval.
    • Improved observability marker handling so state is preserved more reliably across restarts.
  • Bug Fixes

    • Strengthened protection against malformed redirects, unsafe proxy overrides, and unexpected network destinations.
    • Improved policy denial detection so mixed or interleaved error output is classified more accurately.

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
@ericksoa ericksoa self-assigned this Jul 8, 2026
@copy-pr-bot

copy-pr-bot Bot commented Jul 8, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Jul 8, 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

This PR adds a NemoClaw-managed trusted-proxy fetch_url adapter for Deep Agents Code: a validated proxy URL is exported by launcher/start scripts, verified and enforced via redirect-following logic in the managed runtime, and wired into tools.py via patching. It also expands raw GitHub network policy access, moves the observability marker to a durable sandbox path with hardened validation, tightens structured JSON denial parsing, and extends unit/e2e/documentation coverage accordingly.

Changes

Managed Deep Agents Code updates

Layer / File(s) Summary
Launcher and observability marker wiring
agents/langchain-deepagents-code/dcode-launcher.sh, agents/langchain-deepagents-code/start.sh, test/helpers/langchain-deepagents-code-headless.ts, test/langchain-deepagents-code-proxy-launcher.test.ts
Exports DEEPAGENTS_CODE_FETCH_URL_TRUSTED_PROXY_URL, moves the observability marker to /sandbox/.deepagents with symlink/filesystem safety checks and atomic rewrite, and updates test fixtures/assertions for marker paths and proxy propagation.
Managed fetch runtime and patching
agents/langchain-deepagents-code/managed-dcode-runtime.py, agents/langchain-deepagents-code/patch-managed-deepagents-code.py, test/helpers/langchain-deepagents-code-patch-fixture.ts, test/langchain-deepagents-code-direct-module-patch.test.ts, test/langchain-deepagents-code-progressive-tool-disclosure.test.ts, test/langchain-deepagents-code-fetch-proxy.test.ts
Adds managed_fetch_proxy_url() and managed_fetch_with_redirects() for proxy validation, CA-pinned TLS trust, and bounded redirect-following; patches tools.py to delegate _fetch_with_redirects; extends drift/verification checks and fixtures.
Policy and fetch probes
agents/langchain-deepagents-code/policy-additions.yaml, docs/reference/network-policies.mdx, agents/langchain-deepagents-code/dependency-review.md, test/e2e/e2e-cloud-experimental/checks/06-deepagents-code-python-egress.sh, test/e2e/support/platform-parity-cloud-experimental.test.ts, test/langchain-deepagents-code-image.test.ts
Adds a read-only raw.githubusercontent.com policy endpoint, documents the managed fetch adapter, and adds fetch_url probe wiring/tests for reachable vs. blocked destinations.
Structured denial JSON extraction
src/lib/actions/sandbox/exec-policy-hint-detection.ts, src/lib/actions/sandbox/exec-policy-hint-detection.test.ts, test/e2e/support/deepagents-observability-contract.test.ts
Adds firstJsonObject() to bound JSON extraction from mixed log lines and updates isStructuredJsonPolicyDenial() accordingly, with new interleaved-input test coverage.
Observability cleanup sequencing tests
test/e2e/support/platform-parity-cloud-experimental.test.ts
Extends Tavily opt-in marker test cases and switches final marker validation to a per-case regex assertion.

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

Sequence Diagram(s)

sequenceDiagram
  participant start.sh
  participant managed-dcode-runtime.py
  participant tools.py
  participant requests
  participant CA bundle
  start.sh->>managed-dcode-runtime.py: export trusted proxy URL
  managed-dcode-runtime.py->>managed-dcode-runtime.py: managed_fetch_proxy_url()
  managed-dcode-runtime.py->>tools.py: managed_fetch_with_redirects(url)
  tools.py->>CA bundle: validate managed trust path
  tools.py->>requests: Session(trust_env=False)
  requests-->>tools.py: response / redirect
  tools.py->>tools.py: validate hop URL and follow redirects
Loading

Suggested labels: area: architecture, area: docs

Suggested reviewers: jyaunches, cv

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: routing fetch_url through the managed proxy.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ericksoa/fix-dcode-fetch-proxy

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

@github-code-quality

github-code-quality Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage remains at 96%, unchanged from the main branch.

TypeScript / code-coverage/cli

The overall coverage in the ericksoa/fix-dcode-f... branch remains at 76%, unchanged from the main branch.

Show a code coverage summary of the most impacted files.
File main a226b08 ericksoa/fix-dcode-f... 0222e28 +/-
src/lib/sandbox...rsion-scheme.ts 100% 73% -27%
src/lib/securit...ntial-filter.ts 99% 87% -12%
src/lib/runner.ts 80% 73% -7%
src/lib/sandbox...vileged-exec.ts 89% 82% -7%
src/lib/actions...-add-restart.ts 19% 14% -5%
src/lib/actions...ridge-policy.ts 62% 64% +2%
src/lib/state/config-io.ts 93% 96% +3%
src/lib/actions...lution-probe.ts 88% 94% +6%
src/lib/actions...e-validation.ts 81% 90% +9%
src/lib/actions...x/mcp-bridge.ts 35% 44% +9%

Updated July 09, 2026 02:37 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: ubuntu-repo-cloud-langchain-deepagents-code
Optional E2E: network-policy

Dispatch hint: targets=ubuntu-repo-cloud-langchain-deepagents-code

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • ubuntu-repo-cloud-langchain-deepagents-code (high): Required because the PR changes the Deep Agents Code managed image/runtime, launcher proxy contract, fetch_url transport, and agent-specific network policy. This live target onboards a real langchain-deepagents-code sandbox and runs the cloud-experimental Deep Agents checks, including the updated 06-deepagents-code-python-egress.sh coverage for raw.githubusercontent.com fetch_url success and policy-denied unapproved/metadata/loopback egress.

Optional E2E

  • network-policy (high): Useful adjacent confidence for the changed policy-denial hint parsing and network-policy documentation. This job exercises live OpenShell policy add/deny behavior and proxy-enforced egress on a real sandbox, though it does not specifically cover the Deep Agents fetch_url transport.

New E2E recommendations

  • Sandbox exec policy-denial hints (medium): Existing unit coverage pins interleaved proxy JSON parsing, and the optional network-policy E2E exercises live denials, but no live E2E appears to assert that an actual interleaved curl/proxy response produces the NemoClaw exec policy-denial breadcrumb.
    • Suggested test: Add a live network-policy or sandbox-operations scenario that runs a policy-denied curl through nemoclaw <sandbox> exec and asserts the rendered recent network policy denial hint when structured proxy JSON is interleaved with stderr.
  • Deep Agents Code fetch_url redirect handling (low): The updated live check validates direct approved and denied fetch_url destinations, while redirect credential/userinfo handling is covered by focused tests. A live redirect-chain check would add confidence that every hop stays behind the managed proxy and policy boundary.
    • Suggested test: Extend the Deep Agents Code cloud-experimental egress checks with a controlled approved redirect fixture and a credential-bearing redirect rejection case, if a stable approved fixture endpoint is available.

Dispatch hint

  • Workflow: .github/workflows/e2e.yaml
  • jobs input: targets=ubuntu-repo-cloud-langchain-deepagents-code

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

E2E Target Recommendation

Required E2E targets: ubuntu-repo-cloud-langchain-deepagents-code
Optional E2E targets: None

Dispatch required E2E targets:

  • gh workflow run e2e.yaml --ref <pr-head-ref> --field targets=ubuntu-repo-cloud-langchain-deepagents-code

Workflow run

Full E2E target advisor summary

E2E Target Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E targets

  • ubuntu-repo-cloud-langchain-deepagents-code: The PR changes the managed LangChain Deep Agents Code launchers/runtime patching, baseline policy additions, and the wired live Deep Agents Python egress check. The live-supported Deep Agents Code target exercises the affected managed proxy/fetch_url egress path, raw.githubusercontent.com policy route, and policy-denial behavior through the registered cloud-experimental checks.
    • Dispatch: gh workflow run e2e.yaml --ref <pr-head-ref> --field targets=ubuntu-repo-cloud-langchain-deepagents-code

Optional E2E targets

  • None.

Relevant changed files

  • agents/langchain-deepagents-code/dcode-launcher.sh
  • agents/langchain-deepagents-code/managed-dcode-runtime.py
  • agents/langchain-deepagents-code/patch-managed-deepagents-code.py
  • agents/langchain-deepagents-code/policy-additions.yaml
  • agents/langchain-deepagents-code/start.sh
  • test/e2e/e2e-cloud-experimental/checks/06-deepagents-code-python-egress.sh
  • test/e2e/support/deepagents-observability-contract.test.ts
  • test/e2e/support/platform-parity-cloud-experimental.test.ts

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — No blocking findings

Merge posture: No blocking advisor findings
Primary next action: Add or justify PRA-T1 and any related test follow-ups.
Open items: 0 required · 0 warnings · 0 suggestions · 5 test follow-ups
Since last review: 0 prior items resolved · 0 still apply · 0 new items found

Action checklist

  • PRA-T1 Add or justify test follow-up: Runtime validation
  • PRA-T2 Add or justify test follow-up: Runtime validation
  • PRA-T3 Add or justify test follow-up: Runtime validation
  • PRA-T4 Add or justify test follow-up: Acceptance clause
  • PRA-T5 Add or justify test follow-up: Acceptance clause
Test follow-ups to resolve or justify

If these cover changed behavior, prefer adding them in this PR; otherwise state why existing coverage is enough or link the follow-up.

  • PRA-T1 Runtime validation — Run the live managed Deep Agents Code fetch_url sandbox validation that proves https://raw.githubusercontent.com/NVIDIA/NemoClaw/main/README.md returns a nonempty 2xx response through the managed proxy and https://example.com/, https://169.254.169.254/latest/meta-data/, and https://127.0.0.1/ are reported as policy denials.. Static and fixture coverage is strong, but the changed behavior crosses the built managed image, third-party package patching, launchers, root-owned image files, CA mount, OpenShell network policy, and live proxy routing. Read-only review cannot prove the deployed sandbox observes those runtime contracts.
  • PRA-T2 Runtime validation — Run built-image installed-package validation against the managed deepagents-code==0.1.34 image proving tools.py contains the NemoClaw managed fetch_url patch exactly once and an unmanaged import without DEEPAGENTS_CODE_FETCH_URL_TRUSTED_PROXY_URL retains the upstream direct transport.. Static and fixture coverage is strong, but the changed behavior crosses the built managed image, third-party package patching, launchers, root-owned image files, CA mount, OpenShell network policy, and live proxy routing. Read-only review cannot prove the deployed sandbox observes those runtime contracts.
  • PRA-T3 Runtime validation — Run launcher/start live sandbox validation proving NEMOCLAW_OBSERVABILITY=1 creates and preserves the durable marker across an environment-less policy restart, explicit NEMOCLAW_OBSERVABILITY=0 removes it, and symlink or non-regular marker paths do not enable observability.. Static and fixture coverage is strong, but the changed behavior crosses the built managed image, third-party package patching, launchers, root-owned image files, CA mount, OpenShell network policy, and live proxy routing. Read-only review cannot prove the deployed sandbox observes those runtime contracts.
  • PRA-T4 Acceptance clause — No linked issue acceptance clauses were present in the deterministic review context. — add test evidence or identify existing coverage. The validation context reported linkedIssues: [] for this PR, so there were no issue clauses or issue comments to map literally.
  • PRA-T5 Acceptance clause — Require the live egress check to receive a nonempty 2xx body, and explicitly deny an unapproved host, cloud metadata, and loopback. — add test evidence or identify existing coverage. test/e2e/e2e-cloud-experimental/checks/06-deepagents-code-python-egress.sh now checks FETCH_SUCCESS:2xx:nonzero for the raw GitHub README and FETCH_BLOCKED for example.com, 169.254.169.254, and 127.0.0.1. Read-only review confirms the script wiring but cannot prove the live sandbox runtime executed those paths.

Workflow run details

This is an automated, non-binding review; it still expects maintainers and agents to respond to each required or warning item. Treat suggestions as current-PR improvements when they touch changed code; defer only with maintainer rationale or a linked follow-up. A human maintainer must make the final merge decision.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor (Nemotron Ultra) — Changes requested

Merge posture: Do not merge yet
Primary next action: Fix PRA-2: FETCH_SUCCESS regex excludes 204 No Content responses; then add or justify PRA-T1.
Open items: 1 required · 6 warnings · 4 suggestions · 8 test follow-ups
Since last review: 0 prior items resolved · 9 still apply · 2 new items found

Action checklist

  • PRA-2 Fix: FETCH_SUCCESS regex excludes 204 No Content responses in test/e2e/e2e-cloud-experimental/checks/06-deepagents-code-python-egress.sh:201
  • PRA-1 Resolve or justify: Source-of-truth review needed: firstJsonObject() parser for interleaved proxy JSON
  • PRA-3 Resolve or justify: firstJsonObject() fallback for missing typed OpenShell exec-denial lacks edge case coverage in src/lib/actions/sandbox/exec-policy-hint-detection.ts:48
  • PRA-4 Resolve or justify: max_redirects not asserted against upstream _MAX_FETCH_REDIRECTS constant in agents/langchain-deepagents-code/managed-dcode-runtime.py:1160
  • PRA-5 Resolve or justify: Live E2E fetch_url success test depends on external GitHub availability in test/e2e/e2e-cloud-experimental/checks/06-deepagents-code-python-egress.sh:340
  • PRA-6 Resolve or justify: Inconsistent exception context suppression in validation_error wraps in agents/langchain-deepagents-code/managed-dcode-runtime.py:1105
  • PRA-7 Resolve or justify: firstJsonObject() fallback lacks OpenShell release tracking for typed denial API in src/lib/actions/sandbox/exec-policy-hint-detection.ts:48
  • PRA-T1 Add or justify test follow-up: Runtime validation
  • PRA-T2 Add or justify test follow-up: Runtime validation
  • PRA-T3 Add or justify test follow-up: Runtime validation
  • PRA-T4 Add or justify test follow-up: Runtime validation
  • PRA-T5 Add or justify test follow-up: Runtime validation
  • PRA-T6 Add or justify test follow-up: Add 204 No Content classification test to fetch-proxy test suite
  • PRA-T7 Add or justify test follow-up: Verify CA bundle symlink replacement race window coverage
  • PRA-T8 Add or justify test follow-up: Acceptance clause
  • PRA-8 In-scope improvement: prepare_runtime_env export asymmetry for DEEPAGENTS_CODE_FETCH_URL_TRUSTED_PROXY_URL in agents/langchain-deepagents-code/start.sh:195
  • PRA-9 In-scope improvement: Managed fetch_url proxy adapter lacks upstream tracking reference in agents/langchain-deepagents-code/dependency-review.md:35
  • PRA-10 In-scope improvement: Add 204 No Content classification test to fetch-proxy test suite in test/langchain-deepagents-code-fetch-proxy.test.ts:161
  • PRA-11 In-scope improvement: Verify CA bundle symlink replacement race window coverage in test/langchain-deepagents-code-fetch-proxy.test.ts:350

Findings index

ID Severity Category Location Required action
PRA-1 Resolve/justify architecture Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
PRA-2 Required correctness test/e2e/e2e-cloud-experimental/checks/06-deepagents-code-python-egress.sh:201 Relax the regex to allow content_length 0: change '[1-9][0-9]*' to '[0-9][0-9]*' in both the E2E check (line 201) and the corresponding test expectation in test/langchain-deepagents-code-fetch-proxy.test.ts:161.
PRA-3 Resolve/justify architecture src/lib/actions/sandbox/exec-policy-hint-detection.ts:48 Add test cases in exec-policy-hint-detection.test.ts for: escaped quotes (\"), Unicode escapes (\u0041), deeply nested objects (depth > 10), trailing non-JSON text after valid JSON, and incomplete/truncated JSON. Verify the parser rejects incomplete JSON objects rather than returning partial matches.
PRA-4 Resolve/justify correctness agents/langchain-deepagents-code/managed-dcode-runtime.py:1160 Add an assertion at the start of managed_fetch_with_redirects: assert max_redirects <= 5 (or import and compare against the actual upstream constant via the patcher's validated symbol).
PRA-5 Resolve/justify correctness test/e2e/e2e-cloud-experimental/checks/06-deepagents-code-python-egress.sh:340 Add a local HTTP test fixture/server for the success path, or explicitly document this as an intentional live integration test with accepted external dependency. The self-test modes (fetch-success-classification, fetch-blocked-classification) already cover the classification logic without external dependencies.
PRA-6 Resolve/justify security agents/langchain-deepagents-code/managed-dcode-runtime.py:1105 Standardize on 'from None' for all validation_error wraps to consistently suppress internal exception context, matching the pattern used for ImportError and CA bundle errors. Set exc.__suppress_context__ = True explicitly where needed.
PRA-7 Resolve/justify security src/lib/actions/sandbox/exec-policy-hint-detection.ts:48 Add edge case tests for firstJsonObject() (PRA-5). Track OpenShell releases for typed denial API. Document the removal condition explicitly in the PR or link to a tracking issue.
PRA-8 Improvement correctness agents/langchain-deepagents-code/start.sh:195 Add a comment in dcode-launcher.sh clarifying that it always exports because it runs only in managed mode where root-owned proxy files are authoritative. Or refactor to a shared helper that both launchers use.
PRA-9 Improvement architecture agents/langchain-deepagents-code/dependency-review.md:35 Add a tracking reference (upstream issue number or target release) to the dependency-review.md documentation. Consider filing an upstream issue or tracking Deep Agents Code releases for native policy-proxy transport support.
PRA-10 Improvement tests test/langchain-deepagents-code-fetch-proxy.test.ts:161 Add a test case for FETCH_SUCCESS:204:0 classification to verify 204 responses are handled correctly once the regex is fixed.
PRA-11 Improvement tests test/langchain-deepagents-code-fetch-proxy.test.ts:350 Review the 'pins concurrent CA bundle mutation' test in fetch-proxy.test.ts for symlink replacement coverage. Add explicit test for symlink-to-attacker replacement during fd-backed read race window.

🚨 Required before merge

Address these before merging unless a maintainer explicitly overrides the advisor with rationale.

PRA-2 Required — FETCH_SUCCESS regex excludes 204 No Content responses

  • Location: test/e2e/e2e-cloud-experimental/checks/06-deepagents-code-python-egress.sh:201
  • Category: correctness
  • Problem: The FETCH_SUCCESS classification regex 'FETCH_SUCCESS:2[0-9]{2}:[1-9][0-9]*' requires content_length >= 1, which incorrectly rejects valid 204 No Content responses (content_length: 0). HTTP 204 is a valid success status for empty responses.
  • Impact: False negatives in self-test and potentially live checks when fetch_url returns 204 No Content. The success classification would fail even though the request reached the destination successfully.
  • Required action: Relax the regex to allow content_length 0: change '[1-9][0-9]*' to '[0-9][0-9]*' in both the E2E check (line 201) and the corresponding test expectation in test/langchain-deepagents-code-fetch-proxy.test.ts:161.
  • Expected follow-up: Fix before merge or get explicit maintainer override.
  • Verification: Check line 201 in 06-deepagents-code-python-egress.sh and line 161 in fetch-proxy.test.ts for the regex pattern 'FETCH_SUCCESS:2[0-9]{2}:[1-9][0-9]*'
  • Missing regression test: test_fetch_url_204_no_content_handling — verify fetch_url behavior on 204 responses and that expect_fetch_reached classification matches after regex fix
  • Done when: The required change is committed and verification passes: Check line 201 in 06-deepagents-code-python-egress.sh and line 161 in fetch-proxy.test.ts for the regex pattern 'FETCH_SUCCESS:2[0-9]{2}:[1-9][0-9]*'.
  • Evidence: 06-deepagents-code-python-egress.sh line 201: regex 'FETCH_SUCCESS:2[0-9]{2}:[1-9][0-9]*' requires content_length >= 1; fetch-proxy.test.ts line 161 expects same pattern
Review findings by urgency: 1 required fix, 6 items to resolve/justify, 4 in-scope improvements

⚠️ Resolve or justify before merge

Investigate these in the current review; either fix them, explain why they are not applicable, or document the accepted risk.

PRA-1 Resolve/justify — Source-of-truth review needed: firstJsonObject() parser for interleaved proxy JSON

  • Location: not file-specific
  • Category: architecture
  • Problem: The advisor marked localized patch analysis as needs_followup.
  • Impact: A localized workaround can preserve or hide an invalid state when the source boundary is unclear.
  • Recommended action: Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Missing regression test: exec-policy-hint-detection.test.ts: 30+ cases covering prefixed/suffixed/unprefixed/malformed/near-miss JSON, oversized lines, extra fields, invalid endpoints. Gap: No edge cases for escaped quotes, Unicode escapes, deeply nested objects, trailing non-JSON text, truncated JSON.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Evidence: exec-policy-hint-detection.ts lines 48-76 implements firstJsonObject; comment at lines 88-96 documents source boundary and removal condition; test file has 30+ cases but none for the 5 edge cases

PRA-3 Resolve/justify — firstJsonObject() fallback for missing typed OpenShell exec-denial lacks edge case coverage

  • Location: src/lib/actions/sandbox/exec-policy-hint-detection.ts:48
  • Category: architecture
  • Problem: The firstJsonObject() parser is a localized fallback for missing typed exec-denial from OpenShell. It handles interleaved proxy JSON in curl stderr but lacks tests for escaped quotes, Unicode escapes, deeply nested objects, trailing non-JSON text, and incomplete/truncated JSON rejection.
  • Impact: Parser could accept malformed JSON or miss denials when curl stderr interleaves with proxy response in edge cases not covered by current tests.
  • Recommended action: Add test cases in exec-policy-hint-detection.test.ts for: escaped quotes (\"), Unicode escapes (\u0041), deeply nested objects (depth > 10), trailing non-JSON text after valid JSON, and incomplete/truncated JSON. Verify the parser rejects incomplete JSON objects rather than returning partial matches.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Search exec-policy-hint-detection.test.ts for test cases covering escaped quotes, Unicode escapes, deeply nested objects, trailing non-JSON text, and incomplete/truncated JSON
  • Missing regression test: exec-policy-hint-detection.test.ts edge cases: escaped quotes, Unicode escapes, deeply nested objects, trailing non-JSON text after valid JSON, incomplete/truncated JSON rejection
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Search exec-policy-hint-detection.test.ts for test cases covering escaped quotes, Unicode escapes, deeply nested objects, trailing non-JSON text, and incomplete/truncated JSON.
  • Evidence: exec-policy-hint-detection.ts lines 48-76 implements firstJsonObject; comment at lines 88-96 documents source boundary and removal condition; test file has 30+ cases but none for the 5 edge cases

PRA-4 Resolve/justify — max_redirects not asserted against upstream _MAX_FETCH_REDIRECTS constant

  • Location: agents/langchain-deepagents-code/managed-dcode-runtime.py:1160
  • Category: correctness
  • Problem: managed_fetch_with_redirects accepts max_redirects as a parameter but does not assert it matches or is less than the upstream _MAX_FETCH_REDIRECTS constant (value 5 in 0.1.34). If upstream increases this constant, the managed fetch could allow more redirects than security-reviewed, expanding SSRF attack surface for redirect chains.
  • Impact: If upstream Deep Agents Code increases _MAX_FETCH_REDIRECTS, the managed fetch would silently allow more redirect hops than reviewed, potentially enabling longer redirect chains for SSRF attacks.
  • Recommended action: Add an assertion at the start of managed_fetch_with_redirects: assert max_redirects <= 5 (or import and compare against the actual upstream constant via the patcher's validated symbol).
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Check managed-dcode-runtime.py line 1160 where max_redirects is used. The test at fetch-proxy.test.ts sets tools._MAX_FETCH_REDIRECTS = 0 and verifies it's respected, but production code lacks an assertion against the reviewed constant.
  • Missing regression test: test_fetch_url_redirect_max_assertion — verify managed_fetch_with_redirects asserts max_redirects <= reviewed upstream constant
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Check managed-dcode-runtime.py line 1160 where max_redirects is used. The test at fetch-proxy.test.ts sets tools._MAX_FETCH_REDIRECTS = 0 and verifies it's respected, but production code lacks an assertion against the reviewed constant.
  • Evidence: managed-dcode-runtime.py line 1160 uses max_redirects parameter without asserting against _MAX_FETCH_REDIRECTS; fetch-proxy.test.ts line 596 tests _MAX_FETCH_REDIRECTS = 0

PRA-5 Resolve/justify — Live E2E fetch_url success test depends on external GitHub availability

  • Location: test/e2e/e2e-cloud-experimental/checks/06-deepagents-code-python-egress.sh:340
  • Category: correctness
  • Problem: The live E2E fetch_url success test calls expect_fetch_reached with https://raw.githubusercontent.com/NVIDIA/NemoClaw/main/README.md, creating an external dependency on GitHub availability.
  • Impact: Test flakiness due to external network dependency; CI failures when GitHub is unreachable or rate-limited.
  • Recommended action: Add a local HTTP test fixture/server for the success path, or explicitly document this as an intentional live integration test with accepted external dependency. The self-test modes (fetch-success-classification, fetch-blocked-classification) already cover the classification logic without external dependencies.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Check the E2E check file around line 340 for the expect_fetch_reached call to raw.githubusercontent.com
  • Missing regression test: Local HTTP test fixture for fetch_url success path, or explicit documentation of accepted external dependency
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Check the E2E check file around line 340 for the expect_fetch_reached call to raw.githubusercontent.com.
  • Evidence: 06-deepagents-code-python-egress.sh line 340 calls expect_fetch_reached with raw.githubusercontent.com URL

PRA-6 Resolve/justify — Inconsistent exception context suppression in validation_error wraps

  • Location: agents/langchain-deepagents-code/managed-dcode-runtime.py:1105
  • Category: security
  • Problem: Line 1105 uses 'raise validation_error(str(exc)) from exc' (preserves context) while lines 1109, 1137, 1154 use 'from None' (suppresses context). This leaks internal exception details inconsistently.
  • Impact: Internal exception details (file paths, stack traces) could leak through validation_error in some code paths but not others, creating inconsistent error sanitization.
  • Recommended action: Standardize on 'from None' for all validation_error wraps to consistently suppress internal exception context, matching the pattern used for ImportError and CA bundle errors. Set exc.__suppress_context__ = True explicitly where needed.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Check managed-dcode-runtime.py lines 1105, 1109, 1137, 1154 for 'from exc' vs 'from None' inconsistency
  • Missing regression test: Validation error context suppression test — verify no internal paths/stack details leak in fetch_url validation errors across all error paths
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Check managed-dcode-runtime.py lines 1105, 1109, 1137, 1154 for 'from exc' vs 'from None' inconsistency.
  • Evidence: Line 1105: 'raise validation_error(str(exc)) from exc'; Lines 1109, 1137, 1154: 'raise validation_error(...) from None'

PRA-7 Resolve/justify — firstJsonObject() fallback lacks OpenShell release tracking for typed denial API

  • Location: src/lib/actions/sandbox/exec-policy-hint-detection.ts:48
  • Category: security
  • Problem: The firstJsonObject() parser is a fallback for missing typed exec-denial from OpenShell. Without edge case coverage (PRA-5) and without a tracked OpenShell release for typed denial API, this fallback could accept malformed JSON or miss denials indefinitely.
  • Impact: Workaround persists without a clear removal timeline, risking bitrot or incomplete coverage as OpenShell evolves.
  • Recommended action: Add edge case tests for firstJsonObject() (PRA-5). Track OpenShell releases for typed denial API. Document the removal condition explicitly in the PR or link to a tracking issue.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Inspect exec-policy-hint-detection.ts comment at lines 88-96 for removal condition; check test file for edge case coverage; verify if any OpenShell issue/PR is referenced
  • Missing regression test: exec-policy-hint-detection.test.ts edge cases (PRA-5); OpenShell release tracking issue or documentation
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Inspect exec-policy-hint-detection.ts comment at lines 88-96 for removal condition; check test file for edge case coverage; verify if any OpenShell issue/PR is referenced.
  • Evidence: Comment at lines 88-96 states 'Removal condition: delete this fallback when OpenShell provides a typed exec-denial result' but no tracking reference exists

💡 In-scope improvements

These are lower-risk, not throwaway. Prefer fixing them in this PR when they are local to changed code; defer only with rationale or a linked follow-up.

PRA-8 Improvement — prepare_runtime_env export asymmetry for DEEPAGENTS_CODE_FETCH_URL_TRUSTED_PROXY_URL

  • Location: agents/langchain-deepagents-code/start.sh:195
  • Category: correctness
  • Problem: prepare_runtime_env uses write_export_if_set for DEEPAGENTS_CODE_FETCH_URL_TRUSTED_PROXY_URL (conditionally exports only if set), while dcode-launcher.sh always exports it. This asymmetry could cause divergence between launch paths.
  • Impact: Inconsistent proxy environment between login-shell (start.sh) and direct exec (dcode-launcher.sh) paths, potentially leading to different fetch_url behavior.
  • Suggested action: Add a comment in dcode-launcher.sh clarifying that it always exports because it runs only in managed mode where root-owned proxy files are authoritative. Or refactor to a shared helper that both launchers use.
  • Expected follow-up: Prefer a current-PR fix when local to changed code; defer only with rationale or linked follow-up.
  • Verification: Compare start.sh prepare_runtime_env (line 195) write_export_if_set usage vs dcode-launcher.sh line 104 unconditional export
  • Missing regression test: Proxy env parity test between start.sh and dcode-launcher.sh for DEEPAGENTS_CODE_FETCH_URL_TRUSTED_PROXY_URL
  • Done when: The local improvement is applied, or the PR notes why it should be deferred.
  • Evidence: start.sh:195 uses write_export_if_set; dcode-launcher.sh:104 exports unconditionally

PRA-9 Improvement — Managed fetch_url proxy adapter lacks upstream tracking reference

  • Location: agents/langchain-deepagents-code/dependency-review.md:35
  • Category: architecture
  • Problem: The managed fetch_url proxy adapter documentation states 'Remove this adapter rather than refreshing it when a pinned Deep Agents Code release exposes a supported policy-proxy transport' but lacks an upstream issue number or target release for tracking.
  • Impact: No actionable trigger to remove the adapter; risk of maintaining stale adapter indefinitely.
  • Suggested action: Add a tracking reference (upstream issue number or target release) to the dependency-review.md documentation. Consider filing an upstream issue or tracking Deep Agents Code releases for native policy-proxy transport support.
  • Expected follow-up: Prefer a current-PR fix when local to changed code; defer only with rationale or linked follow-up.
  • Verification: Check dependency-review.md around line 35-49 for upstream tracking reference
  • Missing regression test: None — documentation/tracking item
  • Done when: The local improvement is applied, or the PR notes why it should be deferred.
  • Evidence: dependency-review.md lines 35-49 describe removal condition but no upstream issue number or release target

PRA-10 Improvement — Add 204 No Content classification test to fetch-proxy test suite

  • Location: test/langchain-deepagents-code-fetch-proxy.test.ts:161
  • Category: tests
  • Problem: The new fetch-proxy test file provides excellent coverage but could add a test for the 204 No Content case to verify the classification regex handles content_length: 0 correctly (related to PRA-2).
  • Impact: Regression risk if 204 handling changes without test coverage.
  • Suggested action: Add a test case for FETCH_SUCCESS:204:0 classification to verify 204 responses are handled correctly once the regex is fixed.
  • Expected follow-up: Prefer a current-PR fix when local to changed code; defer only with rationale or linked follow-up.
  • Verification: Check fetch-proxy.test.ts for 204 test case after regex fix
  • Missing regression test: test_fetch_url_204_no_content_classification — verify FETCH_SUCCESS regex matches 204 with content_length 0
  • Done when: The local improvement is applied, or the PR notes why it should be deferred.
  • Evidence: fetch-proxy.test.ts has 8 test blocks but none for 204 No Content

PRA-11 Improvement — Verify CA bundle symlink replacement race window coverage

  • Location: test/langchain-deepagents-code-fetch-proxy.test.ts:350
  • Category: tests
  • Problem: The concurrent CA bundle mutation test covers symlink replacement but should explicitly verify the race window where fd-backed read occurs during atomic symlink swap.
  • Impact: Potential TOCTOU if CA bundle validation doesn't fully pin original trust bytes during concurrent mutation.
  • Suggested action: Review the 'pins concurrent CA bundle mutation' test in fetch-proxy.test.ts for symlink replacement coverage. Add explicit test for symlink-to-attacker replacement during fd-backed read race window.
  • Expected follow-up: Prefer a current-PR fix when local to changed code; defer only with rationale or linked follow-up.
  • Verification: Review the 'pins concurrent CA bundle mutation' test in fetch-proxy.test.ts for symlink replacement coverage
  • Missing regression test: CA bundle symlink replacement during fd read race window test
  • Done when: The local improvement is applied, or the PR notes why it should be deferred.
  • Evidence: fetch-proxy.test.ts lines 200-350 test concurrent CA bundle mutation with atomic symlink swap
Test follow-ups to resolve or justify

If these cover changed behavior, prefer adding them in this PR; otherwise state why existing coverage is enough or link the follow-up.

  • PRA-T1 Runtime validation — test_fetch_url_204_no_content_classification — verify FETCH_SUCCESS regex matches 204 with content_length 0 after regex fix. Runtime/sandbox/infrastructure paths need behavioral runtime validation: managed-dcode-runtime.py fetch proxy, exec-policy-hint-detection.ts denial parser, E2E checks with external deps. Unit tests cover logic but runtime integration with OpenShell proxy, CA bundle fd handling, and redirect chains need validation.
  • PRA-T2 Runtime validation — test_fetch_url_redirect_max_assertion — assert max_redirects <= 5 at start of managed_fetch_with_redirects. Runtime/sandbox/infrastructure paths need behavioral runtime validation: managed-dcode-runtime.py fetch proxy, exec-policy-hint-detection.ts denial parser, E2E checks with external deps. Unit tests cover logic but runtime integration with OpenShell proxy, CA bundle fd handling, and redirect chains need validation.
  • PRA-T3 Runtime validation — test_firstJsonObject_escaped_quotes — parser handles \" inside JSON strings. Runtime/sandbox/infrastructure paths need behavioral runtime validation: managed-dcode-runtime.py fetch proxy, exec-policy-hint-detection.ts denial parser, E2E checks with external deps. Unit tests cover logic but runtime integration with OpenShell proxy, CA bundle fd handling, and redirect chains need validation.
  • PRA-T4 Runtime validation — test_firstJsonObject_unicode_escapes — parser handles \u0041 Unicode escapes. Runtime/sandbox/infrastructure paths need behavioral runtime validation: managed-dcode-runtime.py fetch proxy, exec-policy-hint-detection.ts denial parser, E2E checks with external deps. Unit tests cover logic but runtime integration with OpenShell proxy, CA bundle fd handling, and redirect chains need validation.
  • PRA-T5 Runtime validation — test_firstJsonObject_deep_nesting — parser handles deeply nested objects (depth > 10). Runtime/sandbox/infrastructure paths need behavioral runtime validation: managed-dcode-runtime.py fetch proxy, exec-policy-hint-detection.ts denial parser, E2E checks with external deps. Unit tests cover logic but runtime integration with OpenShell proxy, CA bundle fd handling, and redirect chains need validation.
  • PRA-T6 Add 204 No Content classification test to fetch-proxy test suite — Add a test case for FETCH_SUCCESS:204:0 classification to verify 204 responses are handled correctly once the regex is fixed.
  • PRA-T7 Verify CA bundle symlink replacement race window coverage — Review the 'pins concurrent CA bundle mutation' test in fetch-proxy.test.ts for symlink replacement coverage. Add explicit test for symlink-to-attacker replacement during fd-backed read race window.
  • PRA-T8 Acceptance clause — Close proxy review gaps — add test evidence or identify existing coverage. Major gaps closed (proxy delegation, CA bundle, redirect validation, credential non-reflection). Remaining: max_redirects assertion (PRA-3), 204 classification (PRA-2), live E2E external dependency (PRA-4), firstJsonObject edge cases (PRA-5/9), exception context consistency (PRA-6)
Since last review details

Current findings, using the urgency labels above:

PRA-1 Resolve/justify — Source-of-truth review needed: firstJsonObject() parser for interleaved proxy JSON

  • Location: not file-specific
  • Category: architecture
  • Problem: The advisor marked localized patch analysis as needs_followup.
  • Impact: A localized workaround can preserve or hide an invalid state when the source boundary is unclear.
  • Recommended action: Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Missing regression test: exec-policy-hint-detection.test.ts: 30+ cases covering prefixed/suffixed/unprefixed/malformed/near-miss JSON, oversized lines, extra fields, invalid endpoints. Gap: No edge cases for escaped quotes, Unicode escapes, deeply nested objects, trailing non-JSON text, truncated JSON.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Inspect the localized patch and source-of-truth review fields for a concrete invalid state, source boundary, source-fix constraint, regression test, and removal condition.
  • Evidence: exec-policy-hint-detection.ts lines 48-76 implements firstJsonObject; comment at lines 88-96 documents source boundary and removal condition; test file has 30+ cases but none for the 5 edge cases

PRA-2 Required — FETCH_SUCCESS regex excludes 204 No Content responses

  • Location: test/e2e/e2e-cloud-experimental/checks/06-deepagents-code-python-egress.sh:201
  • Category: correctness
  • Problem: The FETCH_SUCCESS classification regex 'FETCH_SUCCESS:2[0-9]{2}:[1-9][0-9]*' requires content_length >= 1, which incorrectly rejects valid 204 No Content responses (content_length: 0). HTTP 204 is a valid success status for empty responses.
  • Impact: False negatives in self-test and potentially live checks when fetch_url returns 204 No Content. The success classification would fail even though the request reached the destination successfully.
  • Required action: Relax the regex to allow content_length 0: change '[1-9][0-9]*' to '[0-9][0-9]*' in both the E2E check (line 201) and the corresponding test expectation in test/langchain-deepagents-code-fetch-proxy.test.ts:161.
  • Expected follow-up: Fix before merge or get explicit maintainer override.
  • Verification: Check line 201 in 06-deepagents-code-python-egress.sh and line 161 in fetch-proxy.test.ts for the regex pattern 'FETCH_SUCCESS:2[0-9]{2}:[1-9][0-9]*'
  • Missing regression test: test_fetch_url_204_no_content_handling — verify fetch_url behavior on 204 responses and that expect_fetch_reached classification matches after regex fix
  • Done when: The required change is committed and verification passes: Check line 201 in 06-deepagents-code-python-egress.sh and line 161 in fetch-proxy.test.ts for the regex pattern 'FETCH_SUCCESS:2[0-9]{2}:[1-9][0-9]*'.
  • Evidence: 06-deepagents-code-python-egress.sh line 201: regex 'FETCH_SUCCESS:2[0-9]{2}:[1-9][0-9]*' requires content_length >= 1; fetch-proxy.test.ts line 161 expects same pattern

PRA-3 Resolve/justify — firstJsonObject() fallback for missing typed OpenShell exec-denial lacks edge case coverage

  • Location: src/lib/actions/sandbox/exec-policy-hint-detection.ts:48
  • Category: architecture
  • Problem: The firstJsonObject() parser is a localized fallback for missing typed exec-denial from OpenShell. It handles interleaved proxy JSON in curl stderr but lacks tests for escaped quotes, Unicode escapes, deeply nested objects, trailing non-JSON text, and incomplete/truncated JSON rejection.
  • Impact: Parser could accept malformed JSON or miss denials when curl stderr interleaves with proxy response in edge cases not covered by current tests.
  • Recommended action: Add test cases in exec-policy-hint-detection.test.ts for: escaped quotes (\"), Unicode escapes (\u0041), deeply nested objects (depth > 10), trailing non-JSON text after valid JSON, and incomplete/truncated JSON. Verify the parser rejects incomplete JSON objects rather than returning partial matches.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Search exec-policy-hint-detection.test.ts for test cases covering escaped quotes, Unicode escapes, deeply nested objects, trailing non-JSON text, and incomplete/truncated JSON
  • Missing regression test: exec-policy-hint-detection.test.ts edge cases: escaped quotes, Unicode escapes, deeply nested objects, trailing non-JSON text after valid JSON, incomplete/truncated JSON rejection
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Search exec-policy-hint-detection.test.ts for test cases covering escaped quotes, Unicode escapes, deeply nested objects, trailing non-JSON text, and incomplete/truncated JSON.
  • Evidence: exec-policy-hint-detection.ts lines 48-76 implements firstJsonObject; comment at lines 88-96 documents source boundary and removal condition; test file has 30+ cases but none for the 5 edge cases

PRA-4 Resolve/justify — max_redirects not asserted against upstream _MAX_FETCH_REDIRECTS constant

  • Location: agents/langchain-deepagents-code/managed-dcode-runtime.py:1160
  • Category: correctness
  • Problem: managed_fetch_with_redirects accepts max_redirects as a parameter but does not assert it matches or is less than the upstream _MAX_FETCH_REDIRECTS constant (value 5 in 0.1.34). If upstream increases this constant, the managed fetch could allow more redirects than security-reviewed, expanding SSRF attack surface for redirect chains.
  • Impact: If upstream Deep Agents Code increases _MAX_FETCH_REDIRECTS, the managed fetch would silently allow more redirect hops than reviewed, potentially enabling longer redirect chains for SSRF attacks.
  • Recommended action: Add an assertion at the start of managed_fetch_with_redirects: assert max_redirects <= 5 (or import and compare against the actual upstream constant via the patcher's validated symbol).
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Check managed-dcode-runtime.py line 1160 where max_redirects is used. The test at fetch-proxy.test.ts sets tools._MAX_FETCH_REDIRECTS = 0 and verifies it's respected, but production code lacks an assertion against the reviewed constant.
  • Missing regression test: test_fetch_url_redirect_max_assertion — verify managed_fetch_with_redirects asserts max_redirects <= reviewed upstream constant
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Check managed-dcode-runtime.py line 1160 where max_redirects is used. The test at fetch-proxy.test.ts sets tools._MAX_FETCH_REDIRECTS = 0 and verifies it's respected, but production code lacks an assertion against the reviewed constant.
  • Evidence: managed-dcode-runtime.py line 1160 uses max_redirects parameter without asserting against _MAX_FETCH_REDIRECTS; fetch-proxy.test.ts line 596 tests _MAX_FETCH_REDIRECTS = 0

PRA-5 Resolve/justify — Live E2E fetch_url success test depends on external GitHub availability

  • Location: test/e2e/e2e-cloud-experimental/checks/06-deepagents-code-python-egress.sh:340
  • Category: correctness
  • Problem: The live E2E fetch_url success test calls expect_fetch_reached with https://raw.githubusercontent.com/NVIDIA/NemoClaw/main/README.md, creating an external dependency on GitHub availability.
  • Impact: Test flakiness due to external network dependency; CI failures when GitHub is unreachable or rate-limited.
  • Recommended action: Add a local HTTP test fixture/server for the success path, or explicitly document this as an intentional live integration test with accepted external dependency. The self-test modes (fetch-success-classification, fetch-blocked-classification) already cover the classification logic without external dependencies.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Check the E2E check file around line 340 for the expect_fetch_reached call to raw.githubusercontent.com
  • Missing regression test: Local HTTP test fixture for fetch_url success path, or explicit documentation of accepted external dependency
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Check the E2E check file around line 340 for the expect_fetch_reached call to raw.githubusercontent.com.
  • Evidence: 06-deepagents-code-python-egress.sh line 340 calls expect_fetch_reached with raw.githubusercontent.com URL

PRA-6 Resolve/justify — Inconsistent exception context suppression in validation_error wraps

  • Location: agents/langchain-deepagents-code/managed-dcode-runtime.py:1105
  • Category: security
  • Problem: Line 1105 uses 'raise validation_error(str(exc)) from exc' (preserves context) while lines 1109, 1137, 1154 use 'from None' (suppresses context). This leaks internal exception details inconsistently.
  • Impact: Internal exception details (file paths, stack traces) could leak through validation_error in some code paths but not others, creating inconsistent error sanitization.
  • Recommended action: Standardize on 'from None' for all validation_error wraps to consistently suppress internal exception context, matching the pattern used for ImportError and CA bundle errors. Set exc.__suppress_context__ = True explicitly where needed.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Check managed-dcode-runtime.py lines 1105, 1109, 1137, 1154 for 'from exc' vs 'from None' inconsistency
  • Missing regression test: Validation error context suppression test — verify no internal paths/stack details leak in fetch_url validation errors across all error paths
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Check managed-dcode-runtime.py lines 1105, 1109, 1137, 1154 for 'from exc' vs 'from None' inconsistency.
  • Evidence: Line 1105: 'raise validation_error(str(exc)) from exc'; Lines 1109, 1137, 1154: 'raise validation_error(...) from None'

PRA-7 Resolve/justify — firstJsonObject() fallback lacks OpenShell release tracking for typed denial API

  • Location: src/lib/actions/sandbox/exec-policy-hint-detection.ts:48
  • Category: security
  • Problem: The firstJsonObject() parser is a fallback for missing typed exec-denial from OpenShell. Without edge case coverage (PRA-5) and without a tracked OpenShell release for typed denial API, this fallback could accept malformed JSON or miss denials indefinitely.
  • Impact: Workaround persists without a clear removal timeline, risking bitrot or incomplete coverage as OpenShell evolves.
  • Recommended action: Add edge case tests for firstJsonObject() (PRA-5). Track OpenShell releases for typed denial API. Document the removal condition explicitly in the PR or link to a tracking issue.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Inspect exec-policy-hint-detection.ts comment at lines 88-96 for removal condition; check test file for edge case coverage; verify if any OpenShell issue/PR is referenced
  • Missing regression test: exec-policy-hint-detection.test.ts edge cases (PRA-5); OpenShell release tracking issue or documentation
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Inspect exec-policy-hint-detection.ts comment at lines 88-96 for removal condition; check test file for edge case coverage; verify if any OpenShell issue/PR is referenced.
  • Evidence: Comment at lines 88-96 states 'Removal condition: delete this fallback when OpenShell provides a typed exec-denial result' but no tracking reference exists

PRA-8 Improvement — prepare_runtime_env export asymmetry for DEEPAGENTS_CODE_FETCH_URL_TRUSTED_PROXY_URL

  • Location: agents/langchain-deepagents-code/start.sh:195
  • Category: correctness
  • Problem: prepare_runtime_env uses write_export_if_set for DEEPAGENTS_CODE_FETCH_URL_TRUSTED_PROXY_URL (conditionally exports only if set), while dcode-launcher.sh always exports it. This asymmetry could cause divergence between launch paths.
  • Impact: Inconsistent proxy environment between login-shell (start.sh) and direct exec (dcode-launcher.sh) paths, potentially leading to different fetch_url behavior.
  • Suggested action: Add a comment in dcode-launcher.sh clarifying that it always exports because it runs only in managed mode where root-owned proxy files are authoritative. Or refactor to a shared helper that both launchers use.
  • Expected follow-up: Prefer a current-PR fix when local to changed code; defer only with rationale or linked follow-up.
  • Verification: Compare start.sh prepare_runtime_env (line 195) write_export_if_set usage vs dcode-launcher.sh line 104 unconditional export
  • Missing regression test: Proxy env parity test between start.sh and dcode-launcher.sh for DEEPAGENTS_CODE_FETCH_URL_TRUSTED_PROXY_URL
  • Done when: The local improvement is applied, or the PR notes why it should be deferred.
  • Evidence: start.sh:195 uses write_export_if_set; dcode-launcher.sh:104 exports unconditionally

PRA-9 Improvement — Managed fetch_url proxy adapter lacks upstream tracking reference

  • Location: agents/langchain-deepagents-code/dependency-review.md:35
  • Category: architecture
  • Problem: The managed fetch_url proxy adapter documentation states 'Remove this adapter rather than refreshing it when a pinned Deep Agents Code release exposes a supported policy-proxy transport' but lacks an upstream issue number or target release for tracking.
  • Impact: No actionable trigger to remove the adapter; risk of maintaining stale adapter indefinitely.
  • Suggested action: Add a tracking reference (upstream issue number or target release) to the dependency-review.md documentation. Consider filing an upstream issue or tracking Deep Agents Code releases for native policy-proxy transport support.
  • Expected follow-up: Prefer a current-PR fix when local to changed code; defer only with rationale or linked follow-up.
  • Verification: Check dependency-review.md around line 35-49 for upstream tracking reference
  • Missing regression test: None — documentation/tracking item
  • Done when: The local improvement is applied, or the PR notes why it should be deferred.
  • Evidence: dependency-review.md lines 35-49 describe removal condition but no upstream issue number or release target

PRA-10 Improvement — Add 204 No Content classification test to fetch-proxy test suite

  • Location: test/langchain-deepagents-code-fetch-proxy.test.ts:161
  • Category: tests
  • Problem: The new fetch-proxy test file provides excellent coverage but could add a test for the 204 No Content case to verify the classification regex handles content_length: 0 correctly (related to PRA-2).
  • Impact: Regression risk if 204 handling changes without test coverage.
  • Suggested action: Add a test case for FETCH_SUCCESS:204:0 classification to verify 204 responses are handled correctly once the regex is fixed.
  • Expected follow-up: Prefer a current-PR fix when local to changed code; defer only with rationale or linked follow-up.
  • Verification: Check fetch-proxy.test.ts for 204 test case after regex fix
  • Missing regression test: test_fetch_url_204_no_content_classification — verify FETCH_SUCCESS regex matches 204 with content_length 0
  • Done when: The local improvement is applied, or the PR notes why it should be deferred.
  • Evidence: fetch-proxy.test.ts has 8 test blocks but none for 204 No Content

PRA-11 Improvement — Verify CA bundle symlink replacement race window coverage

  • Location: test/langchain-deepagents-code-fetch-proxy.test.ts:350
  • Category: tests
  • Problem: The concurrent CA bundle mutation test covers symlink replacement but should explicitly verify the race window where fd-backed read occurs during atomic symlink swap.
  • Impact: Potential TOCTOU if CA bundle validation doesn't fully pin original trust bytes during concurrent mutation.
  • Suggested action: Review the 'pins concurrent CA bundle mutation' test in fetch-proxy.test.ts for symlink replacement coverage. Add explicit test for symlink-to-attacker replacement during fd-backed read race window.
  • Expected follow-up: Prefer a current-PR fix when local to changed code; defer only with rationale or linked follow-up.
  • Verification: Review the 'pins concurrent CA bundle mutation' test in fetch-proxy.test.ts for symlink replacement coverage
  • Missing regression test: CA bundle symlink replacement during fd read race window test
  • Done when: The local improvement is applied, or the PR notes why it should be deferred.
  • Evidence: fetch-proxy.test.ts lines 200-350 test concurrent CA bundle mutation with atomic symlink swap

Workflow run details

This is an automated, non-binding review; it still expects maintainers and agents to respond to each required or warning item. Treat suggestions as current-PR improvements when they touch changed code; defer only with maintainer rationale or a linked follow-up. A human maintainer must make the final merge decision.

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

E2E Target Results — ❌ Some jobs failed

Run: 28973221328
Workflow ref: ericksoa/fix-dcode-fetch-proxy
Requested targets: ubuntu-repo-cloud-langchain-deepagents-code
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: 0 passed, 1 failed, 0 cancelled, 0 skipped

Job Result
live ❌ failure

Failed jobs: live. Check run artifacts for logs.

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

E2E Target Results — ❌ Some jobs failed

Run: 28974434860
Workflow ref: ericksoa/fix-dcode-fetch-proxy
Requested targets: ubuntu-repo-cloud-langchain-deepagents-code
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: 0 passed, 1 failed, 0 cancelled, 0 skipped

Job Result
live ❌ failure

Failed jobs: live. Check run artifacts for logs.

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

E2E Target Results — ❌ Some jobs failed

Run: 28974811698
Workflow ref: ericksoa/fix-dcode-fetch-proxy
Requested targets: ubuntu-repo-cloud-langchain-deepagents-code
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: 0 passed, 1 failed, 0 cancelled, 0 skipped

Job Result
live ❌ failure

Failed jobs: live. Check run artifacts for logs.

@ericksoa ericksoa added v0.0.78 bug-fix PR fixes a bug or regression integration: dcode LangChain Deep Code integration behavior area: networking DNS, proxy, TLS, ports, host aliases, or connectivity area: policy Network policy, egress rules, presets, or sandbox policy area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery area: security Security controls, permissions, secrets, or hardening labels Jul 8, 2026
@ericksoa
ericksoa marked this pull request as ready for review July 8, 2026 21:14
@ericksoa ericksoa added the needs: review PR is conflict-free and awaiting maintainer review label Jul 8, 2026
ericksoa added 2 commits July 8, 2026 14:14
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>

@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: 3

🧹 Nitpick comments (4)
test/e2e/support/platform-parity-cloud-experimental.test.ts (1)

250-264: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Source-text assertions instead of behavioral coverage.

This test only checks that literal strings exist/don't exist in the shell script's source (toContain/not.toContain), rather than exercising actual fetch_url_probe/expect_fetch_blocked runtime behavior. It locks in implementation text and would pass even if the denial-classification logic were broken, as long as the strings remain present.

As per path instructions for **/*.test.{ts,js,mts,mjs,cts,cjs}: "Prefer observable outcomes through the public boundary over source-text, private-shape, or mock-call assertions," and "Flag copied production algorithms, broad mocks that bypass the behavior under test, and conditionals that make a test pass without exercising its claim." Consider extending the self-test harness (as done for the command-shape test above) to actually feed a mocked/fixture blocked response through fetch_url_probe/expect_fetch_blocked and assert on the classification outcome, rather than grepping script source.

Note: the static-analysis path-traversal hint on fs.readFileSync here is a false positive — the path is a hardcoded literal, not user-controlled input.

🤖 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/e2e/support/platform-parity-cloud-experimental.test.ts` around lines 250
- 264, The test is asserting shell-script source text instead of the actual
fetch blocking behavior, so it can pass without exercising the classification
logic. Update the e2e parity test around fetch_url_probe/expect_fetch_blocked to
run the behavior through the existing self-test harness with a mocked or fixture
blocked response, and assert on the resulting denial classification for the
relevant cases. Keep the focus on observable outcomes from expect_fetch_blocked
rather than checking for literal strings in 06-deepagents-code-python-egress.sh.

Source: Path instructions

test/langchain-deepagents-code-proxy-launcher.test.ts (1)

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

Duplicate env-var-name literal instead of importing the shared constant.

TRUSTED_FETCH_PROXY_ENV_NAME is redefined here as a raw string literal, duplicating the exported constant in test/helpers/langchain-deepagents-code-headless.ts:30, which test/langchain-deepagents-code-fetch-proxy.test.ts already imports directly. Two independent copies of this literal can silently drift.

♻️ Proposed fix
-const TRUSTED_FETCH_PROXY_ENV_NAME = "DEEPAGENTS_CODE_FETCH_URL_TRUSTED_PROXY_URL";
+import { TRUSTED_FETCH_PROXY_ENV_NAME } from "./helpers/langchain-deepagents-code-headless.ts";
🤖 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/langchain-deepagents-code-proxy-launcher.test.ts` at line 24, The test
is reintroducing the trusted proxy env var name as a raw string literal instead
of reusing the shared constant, which can drift from the canonical value. Update
the launcher test to import and use TRUSTED_FETCH_PROXY_ENV_NAME from the shared
helper module used by the fetch-proxy test, and remove the duplicate local
definition so the constant is defined in one place only.
test/langchain-deepagents-code-fetch-proxy.test.ts (1)

137-158: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Test title overstates coverage — this only checks source text, not runtime behavior.

The test claims to "exercise actual fetch_url success and denied-host paths," but the body only does toContain checks against the raw text of 06-deepagents-code-python-egress.sh; no probe is actually executed and no fetch_url outcome is observed here. As per path instructions, prefer observable outcomes over source-text assertions, and flag conditionals/checks that let a test pass without exercising its claim.

Consider renaming the title to reflect what is actually verified (e.g., "asserts the egress check script wires expected fetch_url probes and hosts") and rely on the e2e pipeline execution of the shell script for the actual behavioral proof.

🤖 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/langchain-deepagents-code-fetch-proxy.test.ts` around lines 137 - 158,
The test name overstates what is verified because this spec only inspects the
contents of 06-deepagents-code-python-egress.sh via string assertions and never
exercises fetch_url at runtime. Update the test title in
langchain-deepagents-code-fetch-proxy.test.ts to match the actual behavior, and
keep the assertions focused on the script wiring by referencing the existing
fetch_url_probe_source and expect_fetch_blocked checks rather than claiming
success/denial execution. If runtime coverage is intended, move that proof to
the e2e path that runs the shell script instead of this text-based test.

Source: Path instructions

agents/langchain-deepagents-code/managed-dcode-runtime.py (1)

1072-1104: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Close the requests.Session to avoid leaking connection-pool resources.

managed_fetch_with_redirects creates a fresh Session on every call but never closes it, so the underlying urllib3 connection pool (sockets/file descriptors) lingers until GC. On a long-running agent making repeated fetch_url calls this accumulates. Use a context manager.

♻️ Scope the session to a `with` block
     current_url = url
-    session = requests.Session()
-    # Disable every requests environment-derived session setting, including
-    # proxy/NO_PROXY, netrc, and CA-bundle discovery. Each request receives the
-    # sole root-verified proxy mapping explicitly below. The separately
-    # selected CA bundle establishes TLS transport trust only; it cannot choose
-    # a proxy or authorize a destination under OpenShell policy.
-    session.trust_env = False
-    proxies = {"http": proxy_url, "https": proxy_url}
-    for _hop in range(max_redirects + 1):
-        validate_url(current_url)
-        response = session.get(
-            current_url,
-            timeout=timeout,
-            headers={"User-Agent": "Mozilla/5.0 (compatible; DeepAgents/1.0)"},
-            allow_redirects=False,
-            proxies=proxies,
-            verify=ca_bundle,
-        )
-        if 300 <= response.status_code < 400:
-            location = response.headers.get("Location")
-            if not location:
-                raise validation_error(
-                    f"Redirect response (status {response.status_code}) is missing a Location header"
-                )
-            current_url = urljoin(current_url, location)
-            continue
-        response.raise_for_status()
-        return response
-
-    raise requests.exceptions.TooManyRedirects(
-        f"Exceeded {max_redirects} redirects"
-    )
+    proxies = {"http": proxy_url, "https": proxy_url}
+    with requests.Session() as session:
+        # Disable every requests environment-derived session setting, including
+        # proxy/NO_PROXY, netrc, and CA-bundle discovery. Each request receives
+        # the sole root-verified proxy mapping explicitly below. The separately
+        # selected CA bundle establishes TLS transport trust only; it cannot
+        # choose a proxy or authorize a destination under OpenShell policy.
+        session.trust_env = False
+        for _hop in range(max_redirects + 1):
+            validate_url(current_url)
+            response = session.get(
+                current_url,
+                timeout=timeout,
+                headers={"User-Agent": "Mozilla/5.0 (compatible; DeepAgents/1.0)"},
+                allow_redirects=False,
+                proxies=proxies,
+                verify=ca_bundle,
+            )
+            if 300 <= response.status_code < 400:
+                location = response.headers.get("Location")
+                if not location:
+                    raise validation_error(
+                        f"Redirect response (status {response.status_code}) is missing a Location header"
+                    )
+                current_url = urljoin(current_url, location)
+                continue
+            response.raise_for_status()
+            return response
+
+    raise requests.exceptions.TooManyRedirects(
+        f"Exceeded {max_redirects} redirects"
+    )
🤖 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 `@agents/langchain-deepagents-code/managed-dcode-runtime.py` around lines 1072
- 1104, `managed_fetch_with_redirects` creates a new `requests.Session` but
never closes it, which can leak connection-pool resources during repeated
fetches. Update the session handling in `managed_fetch_with_redirects` to scope
`session` with a context manager so it is always closed after use, while keeping
the existing redirect loop, proxy setup, and request behavior unchanged.
🤖 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/patch-managed-deepagents-code.py`:
- Around line 1292-1294: The drift check for TOOLS_PATCH is incomplete because
it only guards _fetch_with_redirects; update the _require_functions call in
patch-managed-deepagents-code.py to also require _MAX_FETCH_REDIRECTS and
_UrlValidationError from tools.py so the patch fails fast if any of those
symbols are renamed. Make the check alongside the existing _fetch_with_redirects
gate in the same helper path.

In `@docs/reference/network-policies.mdx`:
- Around line 97-101: The paragraph in the network policies MDX source is
wrapped across multiple lines in a way that splits sentences, which violates the
one-sentence-per-line guideline. Reflow the text in the affected paragraph so
each sentence in the description of the raw.githubusercontent.com route is on
its own line, keeping the content unchanged while preserving the existing
markdown structure in the network-policies document.
- Around line 94-95: The PyPI policy description is inconsistent between the
docs table and the actual policy definition. Update the `pypi` entry in
`docs/reference/network-policies.mdx` to match the methods allowed in
`agents/langchain-deepagents-code/policy-additions.yaml` by reflecting only the
permitted method(s), or adjust the YAML policy if the docs are meant to be the
source of truth. Keep the `pypi` row and its method text aligned so
`network-policies.mdx` and `policy-additions.yaml` describe the same behavior.

---

Nitpick comments:
In `@agents/langchain-deepagents-code/managed-dcode-runtime.py`:
- Around line 1072-1104: `managed_fetch_with_redirects` creates a new
`requests.Session` but never closes it, which can leak connection-pool resources
during repeated fetches. Update the session handling in
`managed_fetch_with_redirects` to scope `session` with a context manager so it
is always closed after use, while keeping the existing redirect loop, proxy
setup, and request behavior unchanged.

In `@test/e2e/support/platform-parity-cloud-experimental.test.ts`:
- Around line 250-264: The test is asserting shell-script source text instead of
the actual fetch blocking behavior, so it can pass without exercising the
classification logic. Update the e2e parity test around
fetch_url_probe/expect_fetch_blocked to run the behavior through the existing
self-test harness with a mocked or fixture blocked response, and assert on the
resulting denial classification for the relevant cases. Keep the focus on
observable outcomes from expect_fetch_blocked rather than checking for literal
strings in 06-deepagents-code-python-egress.sh.

In `@test/langchain-deepagents-code-fetch-proxy.test.ts`:
- Around line 137-158: The test name overstates what is verified because this
spec only inspects the contents of 06-deepagents-code-python-egress.sh via
string assertions and never exercises fetch_url at runtime. Update the test
title in langchain-deepagents-code-fetch-proxy.test.ts to match the actual
behavior, and keep the assertions focused on the script wiring by referencing
the existing fetch_url_probe_source and expect_fetch_blocked checks rather than
claiming success/denial execution. If runtime coverage is intended, move that
proof to the e2e path that runs the shell script instead of this text-based
test.

In `@test/langchain-deepagents-code-proxy-launcher.test.ts`:
- Line 24: The test is reintroducing the trusted proxy env var name as a raw
string literal instead of reusing the shared constant, which can drift from the
canonical value. Update the launcher test to import and use
TRUSTED_FETCH_PROXY_ENV_NAME from the shared helper module used by the
fetch-proxy test, and remove the duplicate local definition so the constant is
defined in one place only.
🪄 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: 7dd93960-0384-4d3b-82ff-c9cb7374d1a2

📥 Commits

Reviewing files that changed from the base of the PR and between 5ddf9a1 and 8a3fcb0.

📒 Files selected for processing (16)
  • agents/langchain-deepagents-code/dcode-launcher.sh
  • agents/langchain-deepagents-code/dependency-review.md
  • agents/langchain-deepagents-code/managed-dcode-runtime.py
  • agents/langchain-deepagents-code/patch-managed-deepagents-code.py
  • agents/langchain-deepagents-code/policy-additions.yaml
  • agents/langchain-deepagents-code/start.sh
  • docs/reference/network-policies.mdx
  • test/e2e/e2e-cloud-experimental/checks/06-deepagents-code-python-egress.sh
  • test/e2e/support/platform-parity-cloud-experimental.test.ts
  • test/helpers/langchain-deepagents-code-headless.ts
  • test/helpers/langchain-deepagents-code-patch-fixture.ts
  • test/langchain-deepagents-code-direct-module-patch.test.ts
  • test/langchain-deepagents-code-fetch-proxy.test.ts
  • test/langchain-deepagents-code-image.test.ts
  • test/langchain-deepagents-code-progressive-tool-disclosure.test.ts
  • test/langchain-deepagents-code-proxy-launcher.test.ts
💤 Files with no reviewable changes (1)
  • test/langchain-deepagents-code-image.test.ts

Comment thread agents/langchain-deepagents-code/patch-managed-deepagents-code.py Outdated
Comment thread docs/reference/network-policies.mdx Outdated
Comment thread docs/reference/network-policies.mdx Outdated
Signed-off-by: cjagwani <cjagwani@nvidia.com>
ericksoa added 2 commits July 8, 2026 16:32
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

E2E Target Results — ⚠️ Run cancelled — no signal

Run: 28982941346
Workflow ref: ericksoa/fix-dcode-fetch-proxy
Requested targets: ubuntu-repo-cloud-langchain-deepagents-code
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: 0 passed, 0 failed, 1 cancelled, 0 skipped

Job Result
live ⚠️ cancelled

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>

@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 (1)
test/langchain-deepagents-code-proxy-launcher.test.ts (1)

80-89: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Silent no-op risk: marker/marker_dir .replace() calls lack pre-assertions.

String.replace() no-ops silently if the target literal (MANAGED_OBSERVABILITY_MARKER=... at Line 87, local marker_dir=/sandbox/.deepagents at Line 116) drifts in dcode-launcher.sh/start.sh. If that happens, the fixture keeps the real production path instead of the test-scoped one, and the test would still "pass" without exercising the intended isolated behavior. test/helpers/langchain-deepagents-code-headless.ts (Lines 56-58, 80-83) now guards equivalent replacements with expect(original).toContain(...) — apply the same pattern here for consistency and drift detection.

As per path instructions, **/*.test.{ts,js,mts,mjs,cts,cjs}: "Flag copied production algorithms, broad mocks that bypass the behavior under test, and conditionals that make a test pass without exercising its claim."

♻️ Proposed guard additions
   const fixture = replaceManagedProxyFileConstants(
     readAgentFile("dcode-launcher.sh")
       .replace(
+        // guard: fail fast if the upstream constant literal drifted
         'readonly MANAGED_DCODE_WRAPPER="/usr/local/lib/nemoclaw/dcode-wrapper.sh"',
         `readonly MANAGED_DCODE_WRAPPER="${probePath}"`,
       )
       .replace(
         'readonly MANAGED_OBSERVABILITY_MARKER="/sandbox/.deepagents/.nemoclaw-observability-enabled"',
         `readonly MANAGED_OBSERVABILITY_MARKER="${observabilityMarkerPath(tempDir)}"`,
       ),
     tempDir,
   );
+  expect(readAgentFile("start.sh")).toContain("local marker_dir=/sandbox/.deepagents");
   const fixture = replaceManagedProxyFileConstants(readAgentFile("start.sh"), tempDir)
     .replace("local target=/tmp/nemoclaw-proxy-env.sh", `local target="${envFile}"`)
     .replace(
       'tmp="$(mktemp /tmp/nemoclaw-proxy-env.XXXXXX)"',
       `tmp="$(mktemp "${ephemeralDir}/nemoclaw-proxy-env.XXXXXX")"`,
     )
     .replace("local marker_dir=/sandbox/.deepagents", `local marker_dir="${markerDir}"`);

Also applies to: 110-116

🤖 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/langchain-deepagents-code-proxy-launcher.test.ts` around lines 80 - 89,
The fixture setup in the code proxy launcher test silently falls back if the
string replacements stop matching, so add pre-assertions before each .replace in
the dcode-launcher.sh and start.sh preparation to verify the original literals
are present. Use the same guard pattern already used in
test/helpers/langchain-deepagents-code-headless.ts by checking the source
content contains the expected MANAGED_OBSERVABILITY_MARKER and marker_dir values
before replacing them, so drift in replaceManagedProxyFileConstants and related
test fixture setup fails loudly instead of masking a real path leak.

Source: Path instructions

🤖 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 `@test/langchain-deepagents-code-proxy-launcher.test.ts`:
- Around line 80-89: The fixture setup in the code proxy launcher test silently
falls back if the string replacements stop matching, so add pre-assertions
before each .replace in the dcode-launcher.sh and start.sh preparation to verify
the original literals are present. Use the same guard pattern already used in
test/helpers/langchain-deepagents-code-headless.ts by checking the source
content contains the expected MANAGED_OBSERVABILITY_MARKER and marker_dir values
before replacing them, so drift in replaceManagedProxyFileConstants and related
test fixture setup fails loudly instead of masking a real path leak.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 501c5400-b6e7-45d1-83a8-99d60bc35d86

📥 Commits

Reviewing files that changed from the base of the PR and between 629dc8f and a790f0c.

📒 Files selected for processing (14)
  • agents/langchain-deepagents-code/dcode-launcher.sh
  • agents/langchain-deepagents-code/dependency-review.md
  • agents/langchain-deepagents-code/start.sh
  • src/lib/actions/sandbox/snapshot.test.ts
  • src/lib/actions/sandbox/snapshot.ts
  • src/lib/onboard/sandbox-create-launch-observability.test.ts
  • src/lib/onboard/sandbox-create-launch.ts
  • test/dcode-managed-exec.test.ts
  • test/e2e/e2e-cloud-experimental/checks/09-deepagents-code-tavily-opt-in.sh
  • test/e2e/e2e-cloud-experimental/checks/11-deepagents-code-observability.sh
  • test/e2e/support/platform-parity-cloud-experimental.test.ts
  • test/helpers/langchain-deepagents-code-headless.ts
  • test/langchain-deepagents-code-fetch-proxy.test.ts
  • test/langchain-deepagents-code-proxy-launcher.test.ts
✅ Files skipped from review due to trivial changes (1)
  • agents/langchain-deepagents-code/dependency-review.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • test/e2e/support/platform-parity-cloud-experimental.test.ts
  • test/langchain-deepagents-code-fetch-proxy.test.ts

@cjagwani cjagwani added v0.0.79 and removed v0.0.78 labels Jul 8, 2026
Comment thread test/langchain-deepagents-code-proxy-launcher.test.ts Fixed
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

E2E Target Results — ⚠️ Run cancelled — no signal

Run: 28983296310
Workflow ref: ericksoa/fix-dcode-fetch-proxy
Requested targets: ubuntu-repo-cloud-langchain-deepagents-code
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: 0 passed, 0 failed, 1 cancelled, 0 skipped

Job Result
live ⚠️ cancelled

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

E2E Target Results — ✅ All selected jobs passed

Run: 28983472430
Workflow ref: ericksoa/fix-dcode-fetch-proxy
Requested targets: ubuntu-repo-cloud-langchain-deepagents-code
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, 0 cancelled, 0 skipped

Job Result
live ✅ success

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

E2E Target Results — ❌ Some jobs failed

Run: 28983839955
Workflow ref: ericksoa/fix-dcode-fetch-proxy
Requested targets: ubuntu-repo-cloud-langchain-deepagents-code,cloud-onboard,network-policy,snapshot-commands
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: 3 passed, 1 failed, 0 cancelled, 0 skipped

Job Result
cloud-onboard ❌ failure
live ✅ success
network-policy ✅ success
snapshot-commands ✅ success

Failed jobs: cloud-onboard. Check run artifacts for logs.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

E2E Target Results — ❌ Some jobs failed

Run: 28984380880
Workflow ref: ericksoa/fix-dcode-fetch-proxy
Requested targets: cloud-onboard
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: 0 passed, 1 failed, 0 cancelled, 0 skipped

Job Result
cloud-onboard ❌ failure

Failed jobs: cloud-onboard. Check run artifacts for logs.

ericksoa added 2 commits July 8, 2026 17:19
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

E2E Target Results — ✅ All selected jobs passed

Run: 28985115884
Workflow ref: ericksoa/fix-dcode-fetch-proxy
Requested targets: ubuntu-repo-cloud-langchain-deepagents-code,cloud-onboard,network-policy,snapshot-commands
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: 4 passed, 0 failed, 0 cancelled, 0 skipped

Job Result
cloud-onboard ✅ success
live ✅ success
network-policy ✅ success
snapshot-commands ✅ success

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

E2E Target Results — ❌ Some jobs failed

Run: 28985313040
Workflow ref: ericksoa/fix-dcode-fetch-proxy
Requested targets: ubuntu-repo-cloud-langchain-deepagents-code,cloud-onboard,network-policy,snapshot-commands
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: 3 passed, 1 failed, 0 cancelled, 0 skipped

Job Result
cloud-onboard ❌ failure
live ✅ success
network-policy ✅ success
snapshot-commands ✅ success

Failed jobs: cloud-onboard. Check run artifacts for logs.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

E2E Target Results — ✅ All selected jobs passed

Run: 28985558470
Workflow ref: ericksoa/fix-dcode-fetch-proxy
Requested targets: cloud-onboard
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, 0 cancelled, 0 skipped

Job Result
cloud-onboard ✅ success

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

E2E Target Results — ✅ All selected jobs passed

Run: 28985313040
Workflow ref: ericksoa/fix-dcode-fetch-proxy
Requested targets: ubuntu-repo-cloud-langchain-deepagents-code,cloud-onboard,network-policy,snapshot-commands
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: 4 passed, 0 failed, 0 cancelled, 0 skipped

Job Result
cloud-onboard ✅ success
live ✅ success
network-policy ✅ success
snapshot-commands ✅ success

@ericksoa
ericksoa requested a review from cjagwani July 9, 2026 02:28
@cv
cv enabled auto-merge (squash) July 9, 2026 02:33
@cv
cv merged commit f684ce8 into main Jul 9, 2026
45 checks passed
@cv
cv deleted the ericksoa/fix-dcode-fetch-proxy branch July 9, 2026 02:37
ericksoa pushed a commit that referenced this pull request Jul 9, 2026
<!-- markdownlint-disable MD041 -->
## Summary
This follow-up keeps the v0.0.78 release notes synchronized with PR
#6495, which merged after the original release-prep docs refresh. The
deeper network-policy reference already documents the exact endpoint,
methods, and managed binaries.

## Changes
- #6495 -> `docs/about/release-notes.mdx`: Add policy-routed repository
reads to the v0.0.78 lead and explain that managed Deep Agents Code
`fetch_url` uses NemoClaw's policy proxy with read-only
`raw.githubusercontent.com` access.
- Reviewed #6534 against the existing backup/restore and lifecycle
documentation; no additional prose is needed because it restores the
documented contract.

## 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
<!-- Check exactly one tests line and one docs line. Check other lines
when applicable. Add every requested justification or approval
reference. -->
- [ ] Tests added or updated for changed behavior
- [ ] Existing tests cover changed behavior — justification:
- [x] Tests not applicable — justification: release-note prose only; no
code sample or generated behavior changed.
- [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
<!-- 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 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 to prose-only
release notes
- [ ] 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) —
completed with 0 errors and 2 pre-existing Fern warnings
- [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: Charan Jagwani <cjagwani@nvidia.com>


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

## Summary by CodeRabbit

* **Documentation**
* Updated release notes to reflect new opt-in thread-scoped
auto-approval and policy-routed repository reads.
* Added notes about sandboxed `fetch_url` handling for GitHub source
access and the allowed GitHub request types.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Hadar301 pushed a commit to Hadar301/NemoClaw-OpenShift that referenced this pull request Jul 12, 2026
## Summary

Route managed Deep Agents Code `fetch_url` requests through NemoClaw's
policy
proxy instead of the package's direct DNS-pinning transport. The direct
transport is valid outside the sandbox, but it cannot resolve
destinations in
the managed proxy-only network path and produces misleading DNS failures
while
proxy-aware tools continue to work.

The adapter is limited to the pinned `deepagents-code==0.1.34` managed
image.
Unmanaged imports retain the upstream transport.

## Source boundary and lifecycle

- Invalid state: DCode 0.1.34 disables ambient proxies and performs
local DNS
pinning for `fetch_url`; managed NemoClaw egress and destination
resolution
  must instead pass through the policy proxy.
- Source boundary: NemoClaw owns the image, launchers, and policy
contract, but
  not the hash-locked third-party `fetch_url` implementation.
- Integrity boundary: the runtime independently reconstructs the proxy
URL from
root-owned, mode-0444 host/port files and requires the explicit managed
and
conventional proxy variables to match. Requests ambient proxy discovery
and
  `NO_PROXY` bypass remain disabled on every redirect hop.
- Removal condition: delete the exact-version adapter when a pinned
DCode
release provides a supported policy-proxy transport with equivalent
redirect
  validation and fail-closed behavior.

## Changes

- Patch the exact DCode 0.1.34 `fetch_url` redirect path only in managed
launches.
- Fail closed on forged proxy environments, unsafe root-owned proxy
files,
malformed targets/proxies, credentialed redirects, and redirect-limit
drift.
- Open the configured CA bundle with no-follow and metadata checks, pin
that
validated file descriptor for the whole redirect chain, and rewind per
hop;
concurrent path mutation can yield only the original trust bytes or a
generic
  validation failure.
- Normalize initial and redirect target validation to generic
non-reflecting
  errors, including IDNA failures.
- Allow `raw.githubusercontent.com` only for GET/HEAD so DCode can
follow GitHub
file links and read repository source; repository/ref/path segments vary
by
  task, so the host route is constrained by method and managed binary.
- Require the live egress check to receive a nonempty 2xx body, and
explicitly
  deny an unapproved host, cloud metadata, and loopback.
- Recognize a strictly validated managed-policy denial when curl
interleaves the
proxy JSON body with its own stderr text; keep the existing size bound,
exact
  error code, and structured denial-detail checks.
- Preserve the credential-free observability enable bit across
environment-
less policy restarts, with explicit `1`/`0` on create/rebuild/clone
paths.
- Document the managed network-policy behavior and adapter lifecycle.

## Automated advisor dispositions

- `PRA-1` — justified as intentional. Underscores are accepted only for
controlled internal/container proxy aliases, preserving parity with the
host-side validator. The value is reconstructed from canonical
root-owned
  mode-0444 files and selects the managed proxy endpoint, not a fetch
destination. Cross-boundary tests cover `proxy_name` and the full port
range.
- `PRA-2` — justified per RFC 3986. Userinfo exists only in the URI
authority;
`@` and `:` after the authority are ordinary path characters and can
occur
in repository paths. Every hop still rejects authority userinfo,
requires
  HTTPS, validates host and port, uses the explicit policy proxy as the
destination/SSRF authority, and returns validation errors without
reflecting
the candidate URL. Tests cover allowed path data and rejected authority
  credentials.
- `PRA-2` (final 204 finding) — intentionally retained. This is a
GET/read
acceptance check for the approved raw GitHub README, not a generic HTTP
reachability check. A 204 or zero-length body cannot satisfy the
repository-
source reading use case and would mask an empty fetch; HEAD is not used.
The
dependency review and change summary document the nonempty 2xx contract,
and
  deterministic success/denial self-tests cover classifier behavior.
- Runtime follow-up — satisfied on final head: all four required targets
  (DCode, cloud-onboard, network-policy, and snapshot) passed in
[run 28985313040, attempt
2](https://github.com/NVIDIA/NemoClaw/actions/runs/28985313040).
The failed first cloud-onboard attempt was a GitHub HTTP 429 before
NemoClaw
ran; an isolated exact-head
[retry](https://github.com/NVIDIA/NemoClaw/actions/runs/28985558470)
  also passed.

## 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: pending maintainer
review
- [ ] 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 — initial combined suites passed 169/169
and the post-hook subset passed 43/43; the final current-main focused
suite passed 308 tests with 1 intentional skip; `npm run check:diff` and
`npm run build:cli` passed
- [x] Applicable broad gate passed — final exact-head regular CI
completed with 42 passes and 2 expected skips; DCode, cloud-onboard,
network-policy, and snapshot all passed in [run 28985313040, attempt
2](https://github.com/NVIDIA/NemoClaw/actions/runs/28985313040)
- [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 and 2 pre-existing Fern warnings
- [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)

---
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>


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

* **New Features**
* Added managed fetch support for Deep Agents Code, including trusted
proxy handling, redirect-aware fetching, and stricter network policy
controls.
* Expanded network access to allow read-only access to
`raw.githubusercontent.com` for repository file retrieval.
* Improved observability marker handling so state is preserved more
reliably across restarts.

* **Bug Fixes**
* Strengthened protection against malformed redirects, unsafe proxy
overrides, and unexpected network destinations.
* Improved policy denial detection so mixed or interleaved error output
is classified more accurately.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: cjagwani <cjagwani@nvidia.com>
Co-authored-by: cjagwani <cjagwani@nvidia.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
This follow-up keeps the v0.0.78 release notes synchronized with PR
NVIDIA#6495, which merged after the original release-prep docs refresh. The
deeper network-policy reference already documents the exact endpoint,
methods, and managed binaries.

## Changes
- NVIDIA#6495 -> `docs/about/release-notes.mdx`: Add policy-routed repository
reads to the v0.0.78 lead and explain that managed Deep Agents Code
`fetch_url` uses NemoClaw's policy proxy with read-only
`raw.githubusercontent.com` access.
- Reviewed NVIDIA#6534 against the existing backup/restore and lifecycle
documentation; no additional prose is needed because it restores the
documented contract.

## 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
<!-- Check exactly one tests line and one docs line. Check other lines
when applicable. Add every requested justification or approval
reference. -->
- [ ] Tests added or updated for changed behavior
- [ ] Existing tests cover changed behavior — justification:
- [x] Tests not applicable — justification: release-note prose only; no
code sample or generated behavior changed.
- [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
<!-- 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 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 to prose-only
release notes
- [ ] 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) —
completed with 0 errors and 2 pre-existing Fern warnings
- [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: Charan Jagwani <cjagwani@nvidia.com>


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

## Summary by CodeRabbit

* **Documentation**
* Updated release notes to reflect new opt-in thread-scoped
auto-approval and policy-routed repository reads.
* Added notes about sandboxed `fetch_url` handling for GitHub source
access and the allowed GitHub request types.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: networking DNS, proxy, TLS, ports, host aliases, or connectivity area: policy Network policy, egress rules, presets, or sandbox policy area: sandbox OpenShell sandbox lifecycle, runtime, config, or recovery area: security Security controls, permissions, secrets, or hardening bug-fix PR fixes a bug or regression integration: dcode LangChain Deep Code integration behavior needs: review PR is conflict-free and awaiting maintainer review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants