fix(e2e): avoid multiline Deep Agents Python probe - #5899
Conversation
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
📝 WalkthroughWalkthroughThe Python egress probe now builds a base64-decoded ChangesPython egress probe command shape
Sequence Diagram(s)sequenceDiagram
participant Test as platform-parity-cloud-experimental.test.ts
participant Script as 06-deepagents-code-python-egress.sh
participant Sandbox as sandbox_exec
participant Python as python_bin
Test->>Script: spawnSync with probe-command-shape
Script->>Sandbox: run python_probe
Sandbox->>Python: execute base64-decoded probe via -c
Python-->>Sandbox: exit status
Sandbox-->>Script: return probe result
Script-->>Test: stdout NO_NEWLINE_IN_COMMAND
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in the Show a code coverage summary of the most covered files.
TypeScript / code-coverage/cliThe overall coverage in the Show a code coverage summary of the most covered files.
Updated |
PR Review Advisor (Nemotron Ultra) — BlockedMerge posture: Do not merge until addressed Action checklist
Findings index
🚨 Required before mergeAddress these before merging unless a maintainer explicitly overrides the advisor with rationale.
|
E2E Advisor RecommendationRequired E2E: None Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
|
Vitest E2E Scenario RecommendationRequired Vitest E2E scenarios: Dispatch required Vitest E2E scenarios:
Full Vitest E2E advisor summaryVitest E2E Scenario AdvisorBase: Required Vitest E2E scenarios
Optional Vitest E2E scenarios
Relevant changed files
|
PR Review Advisor — No blocking findingsMerge posture: No blocking advisor findings 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: Carlos Villela <cvillela@nvidia.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
test/langchain-deepagents-code-image.test.ts (1)
405-409: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winPrefer the script’s self-test outcome over source-text assertions.
These checks hard-code the current shell implementation (
base64,mktemp,${python_bin@Q}, etc.), so the test will fail on harmless refactors even if the real contract still holds. The support test already exercises the public boundary by running the script and assertingNO_NEWLINE_IN_COMMAND; this file should lean on that behavior instead of pinning internal command construction details. As per path instructions, "**/*.test.{ts,js,mts,mjs,cts,cjs}: Review tests for behavioral confidence rather than implementation lock-in" and "Prefer observable outcomes through the public boundary over source-text... assertions."🤖 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-image.test.ts` around lines 405 - 409, The test in pythonEgressCheck is over-specifying the shell implementation by asserting internal script text like base64, mktemp, ${python_bin@Q}, and ${url@Q}; replace these source-text checks with assertions on the script’s observable behavior. Use the existing public-boundary execution pattern from the support test and verify the expected NO_NEWLINE_IN_COMMAND outcome instead, keeping the test tied to the behavior of the relevant test helper rather than the current command construction details.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-image.test.ts`:
- Around line 405-409: The test in pythonEgressCheck is over-specifying the
shell implementation by asserting internal script text like base64, mktemp,
${python_bin@Q}, and ${url@Q}; replace these source-text checks with assertions
on the script’s observable behavior. Use the existing public-boundary execution
pattern from the support test and verify the expected NO_NEWLINE_IN_COMMAND
outcome instead, keeping the test tied to the behavior of the relevant test
helper rather than the current command construction details.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: e149a32d-5a24-48d6-9f24-1282bd7b1dab
📒 Files selected for processing (2)
test/e2e/e2e-cloud-experimental/checks/06-deepagents-code-python-egress.shtest/langchain-deepagents-code-image.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- test/e2e/e2e-cloud-experimental/checks/06-deepagents-code-python-egress.sh
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
test/langchain-deepagents-code-image.test.ts (1)
407-409: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAvoid source-text assertions for the probe transport.
Line 407-409 locks this test to the current
base64 -d/${python_bin@Q} -cimplementation details. This PR already adds aprobe-command-shapepath, so the more durable check is that the probe succeeds and emits the expected sentinel through that public boundary. As per path instructions, "Prefer observable outcomes through the public boundary over source-text, private-shape, or mock-call assertions."🤖 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-image.test.ts` around lines 407 - 409, The test in langchain-deepagents-code-image.test.ts is asserting internal probe command text instead of observable behavior. Update the check around pythonEgressCheck to verify the public probe-command-shape path succeeds and emits the expected sentinel, and remove the brittle source-text assertions for mktemp, base64 -d, and ${python_bin@Q} -c. Use the probe command helper/flow already introduced so the test validates the transport through its public boundary rather than implementation details.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-image.test.ts`:
- Around line 407-409: The test in langchain-deepagents-code-image.test.ts is
asserting internal probe command text instead of observable behavior. Update the
check around pythonEgressCheck to verify the public probe-command-shape path
succeeds and emits the expected sentinel, and remove the brittle source-text
assertions for mktemp, base64 -d, and ${python_bin@Q} -c. Use the probe command
helper/flow already introduced so the test validates the transport through its
public boundary rather than implementation details.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 84a5bcec-c108-4b87-a7ad-9b63fd4f9180
📒 Files selected for processing (2)
test/e2e/e2e-cloud-experimental/checks/06-deepagents-code-python-egress.shtest/langchain-deepagents-code-image.test.ts
<!-- markdownlint-disable MD041 --> ## Summary Fixes the Deep Agents Code secret-boundary check so its `dcode_secret_probe` no longer sends a multi-line shell snippet as a single OpenShell exec argument. The post-#5899 rerun showed OpenShell now rejects those newline-bearing command arguments before the secret-boundary assertions can run. ## Changes - Compacts `dcode_secret_probe` into a single-line remote shell command while preserving stdout/stderr capture and `DCODE_EXIT` reporting. - Updates the Deep Agents image contract test to assert the compact remote command shape. ## Type of Change - [x] 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 - [x] Tests added or updated for changed behavior - [ ] Existing tests cover changed behavior — justification: - [ ] Tests not applicable — justification: - [ ] Docs updated for user-facing behavior changes - [x] Docs not applicable — justification: live E2E harness behavior only. - [x] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [x] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: self-review; command-shape-only change preserves existing secret-boundary assertions. - [ ] 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 - [ ] Git hooks passed during commit and push, or `npx prek run --from-ref main --to-ref HEAD` passes - [x] Targeted tests pass for changed behavior - [ ] Full `npm test` passes (broad runtime changes only) - [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) - [ ] 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) Targeted verification: ```bash bash -n test/e2e/e2e-cloud-experimental/checks/08-deepagents-code-secret-boundary.sh npm test -- --run test/langchain-deepagents-code-image.test.ts npm run typecheck:cli ``` --- Signed-off-by: Carlos Villela <cvillela@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Strengthened secret-boundary end-to-end checks with additional stdout assertions, including formatted command output and explicit captured exit-status markers. * Added/extended an opt-in self-test mode that validates the probe execution argument contains no newline characters and verifies the expected “no newline” marker. * Added a new cloud-experimental end-to-end scenario that runs the secret-boundary check in self-test mode, confirms successful execution, and checks for the new stdout marker. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Carlos Villela <cvillela@nvidia.com>
<!-- markdownlint-disable MD041 --> ## Summary Fixes the Deep Agents Code Python egress check so its OpenShell sandbox exec call no longer passes a multi-line heredoc as a command argument. The post-NVIDIA#5897 rerun showed OpenShell rejects that argument shape before the policy checks can run. ## Changes - Encodes the Python egress probe source locally with base64 and decodes it to a temp file inside the sandbox. - Executes the temp probe file with the requested Python interpreter and URL argument, then removes it. - Adds a self-test/support test proving the command sent through `sandbox_exec` is single-line. ## Type of Change - [x] 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 - [x] Tests added or updated for changed behavior - [ ] Existing tests cover changed behavior — justification: - [ ] Tests not applicable — justification: - [ ] Docs updated for user-facing behavior changes - [x] Docs not applicable — justification: live E2E harness behavior only. - [x] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [x] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: self-review; command-shape fix keeps the same in-sandbox probe source and policy assertions. - [ ] 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 - [ ] Git hooks passed during commit and push, or `npx prek run --from-ref main --to-ref HEAD` passes - [x] Targeted tests pass for changed behavior - [ ] Full `npm test` passes (broad runtime changes only) - [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) - [ ] 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) Targeted verification: ```bash bash -n test/e2e/e2e-cloud-experimental/checks/06-deepagents-code-python-egress.sh NEMOCLAW_E2E_PYTHON_EGRESS_SELF_TEST=probe-command-shape bash test/e2e/e2e-cloud-experimental/checks/06-deepagents-code-python-egress.sh npm test -- --run test/e2e-scenario/support-tests/platform-parity-cloud-experimental.test.ts npm run typecheck:cli ``` --- Signed-off-by: Carlos Villela <cvillela@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Strengthened the cloud-experimental end-to-end check for the Python egress probe to ensure it completes successfully. * Added a self-test mode that validates the generated probe command is strictly single-line (no newline characters) and emits the expected sentinel output. * Updated Deep Agents Code policy behavior checks to match the revised probe construction/execution flow using an encoded probe payload, and to explicitly confirm the implementation does not rely on temporary file creation. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Carlos Villela <cvillela@nvidia.com>
<!-- markdownlint-disable MD041 --> ## Summary Fixes the Deep Agents Code secret-boundary check so its `dcode_secret_probe` no longer sends a multi-line shell snippet as a single OpenShell exec argument. The post-NVIDIA#5899 rerun showed OpenShell now rejects those newline-bearing command arguments before the secret-boundary assertions can run. ## Changes - Compacts `dcode_secret_probe` into a single-line remote shell command while preserving stdout/stderr capture and `DCODE_EXIT` reporting. - Updates the Deep Agents image contract test to assert the compact remote command shape. ## Type of Change - [x] 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 - [x] Tests added or updated for changed behavior - [ ] Existing tests cover changed behavior — justification: - [ ] Tests not applicable — justification: - [ ] Docs updated for user-facing behavior changes - [x] Docs not applicable — justification: live E2E harness behavior only. - [x] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [x] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: self-review; command-shape-only change preserves existing secret-boundary assertions. - [ ] 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 - [ ] Git hooks passed during commit and push, or `npx prek run --from-ref main --to-ref HEAD` passes - [x] Targeted tests pass for changed behavior - [ ] Full `npm test` passes (broad runtime changes only) - [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) - [ ] 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) Targeted verification: ```bash bash -n test/e2e/e2e-cloud-experimental/checks/08-deepagents-code-secret-boundary.sh npm test -- --run test/langchain-deepagents-code-image.test.ts npm run typecheck:cli ``` --- Signed-off-by: Carlos Villela <cvillela@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Strengthened secret-boundary end-to-end checks with additional stdout assertions, including formatted command output and explicit captured exit-status markers. * Added/extended an opt-in self-test mode that validates the probe execution argument contains no newline characters and verifies the expected “no newline” marker. * Added a new cloud-experimental end-to-end scenario that runs the secret-boundary check in self-test mode, confirms successful execution, and checks for the new stdout marker. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Summary
Fixes the Deep Agents Code Python egress check so its OpenShell sandbox exec call no longer passes a multi-line heredoc as a command argument. The post-#5897 rerun showed OpenShell rejects that argument shape before the policy checks can run.
Changes
sandbox_execis single-line.Type of Change
Quality Gates
Verification
Verifiedin GitHubnpx prek run --from-ref main --to-ref HEADpassesnpm testpasses (broad runtime changes only)npm run docsbuilds without warnings (doc changes only)Targeted verification:
bash -n test/e2e/e2e-cloud-experimental/checks/06-deepagents-code-python-egress.sh NEMOCLAW_E2E_PYTHON_EGRESS_SELF_TEST=probe-command-shape bash test/e2e/e2e-cloud-experimental/checks/06-deepagents-code-python-egress.sh npm test -- --run test/e2e-scenario/support-tests/platform-parity-cloud-experimental.test.ts npm run typecheck:cliSigned-off-by: Carlos Villela cvillela@nvidia.com
Summary by CodeRabbit