fix(e2e): avoid multiline Deep Agents secret probe - #5902
Conversation
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
📝 WalkthroughWalkthroughThe secret-boundary probe now uses separate helpers for runtime-env and env-file execution, adds a self-test that rejects newline-bearing commands, and updates the related tests to check the new output markers. ChangesDeep Agents Secret Boundary Probe
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 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 |
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 (Nemotron Ultra) — No blocking findingsMerge posture: No blocking advisor findings Action checklist
Findings index
Review findings by urgency: 0 required fixes, 0 items to resolve/justify, 1 in-scope improvement
|
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. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/langchain-deepagents-code-image.test.ts`:
- Around line 436-437: The test is asserting shell-script implementation details
instead of observable behavior. Update the checks in the relevant
`secretBoundaryCheck` expectation so they verify the emitted `DCODE_EXIT:<n>`
output or the newline-free execution contract, and remove assertions tied to the
internal `remote_cmd` variable name or the exact `printf` template. Keep the
test focused on the public boundary in `langchain-deepagents-code-image.test.ts`
rather than source-text internals.
🪄 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: bfa5b4a9-a84a-4ddf-b569-9f480aefa27b
📒 Files selected for processing (2)
test/e2e/e2e-cloud-experimental/checks/08-deepagents-code-secret-boundary.shtest/langchain-deepagents-code-image.test.ts
| expect(secretBoundaryCheck).toContain("remote_cmd="); | ||
| expect(secretBoundaryCheck).toContain("DCODE_EXIT:%s\\\\n"); |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Avoid asserting shell implementation text here.
These checks lock the test to the script’s internal variable name and exact printf template instead of the public behavior. Assert the emitted DCODE_EXIT:<n> line or the newline-free execution contract instead. 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 436 - 437, The
test is asserting shell-script implementation details instead of observable
behavior. Update the checks in the relevant `secretBoundaryCheck` expectation so
they verify the emitted `DCODE_EXIT:<n>` output or the newline-free execution
contract, and remove assertions tied to the internal `remote_cmd` variable name
or the exact `printf` template. Keep the test focused on the public boundary in
`langchain-deepagents-code-image.test.ts` rather than source-text internals.
Source: Path instructions
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@test/e2e/e2e-cloud-experimental/checks/08-deepagents-code-secret-boundary.sh`:
- Line 207: The command-shape self-test currently only exercises
dcode_secret_probe_runtime_env, so a newline regression in
dcode_secret_probe_env_file can slip past the lightweight OpenShell-boundary
check. Update the self-test around dcode_secret_probe_runtime_env to also invoke
dcode_secret_probe_env_file, or refactor both checks through a shared helper so
the command-shape validation covers both helpers consistently.
🪄 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: ab607c11-535a-4a05-baf4-3cd669362f71
📒 Files selected for processing (2)
test/e2e/e2e-cloud-experimental/checks/08-deepagents-code-secret-boundary.shtest/langchain-deepagents-code-image.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- test/langchain-deepagents-code-image.test.ts
| ;; | ||
| esac | ||
| } | ||
| dcode_secret_probe_runtime_env |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
Exercise both helpers in the command-shape self-test.
Line 207 only probes dcode_secret_probe_runtime_env, so a future newline regression in dcode_secret_probe_env_file will bypass the lightweight OpenShell-boundary check and surface only in the heavier secret-boundary path. Add the env-file helper here too, or route both through one shared self-test helper.
Suggested change
- dcode_secret_probe_runtime_env
+ dcode_secret_probe_runtime_env
+ dcode_secret_probe_env_file📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| dcode_secret_probe_runtime_env | |
| dcode_secret_probe_runtime_env | |
| dcode_secret_probe_env_file |
🤖 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/e2e-cloud-experimental/checks/08-deepagents-code-secret-boundary.sh`
at line 207, The command-shape self-test currently only exercises
dcode_secret_probe_runtime_env, so a newline regression in
dcode_secret_probe_env_file can slip past the lightweight OpenShell-boundary
check. Update the self-test around dcode_secret_probe_runtime_env to also invoke
dcode_secret_probe_env_file, or refactor both checks through a shared helper so
the command-shape validation covers both helpers consistently.
Source: Path instructions
<!-- markdownlint-disable MD041 --> ## Summary Compacts the remaining Deep Agents Code secret-boundary log marker probes into single-line OpenShell exec commands. The post-#5902 rerun showed the dcode probes now pass, but the log-marker helpers still used newline-bearing sandbox exec arguments and were rejected by OpenShell. ## Changes - Converts `mark_sandbox_logs` to build and run a single-line remote command. - Converts `sandbox_logs_since_marker` to build and run a single-line remote command. - Updates the Deep Agents image contract test to assert the log marker output remains present. ## 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 log 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 * **Bug Fixes** * Improved handling of sandbox log marker checks so secret-boundary detection is more reliable. * **Tests** * Updated end-to-end coverage to verify the expected `LOG_MARKER_FOUND` output in deep agent policy checks. <!-- 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>
<!-- markdownlint-disable MD041 --> ## Summary Compacts the remaining Deep Agents Code secret-boundary log marker probes into single-line OpenShell exec commands. The post-NVIDIA#5902 rerun showed the dcode probes now pass, but the log-marker helpers still used newline-bearing sandbox exec arguments and were rejected by OpenShell. ## Changes - Converts `mark_sandbox_logs` to build and run a single-line remote command. - Converts `sandbox_logs_since_marker` to build and run a single-line remote command. - Updates the Deep Agents image contract test to assert the log marker output remains present. ## 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 log 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 * **Bug Fixes** * Improved handling of sandbox log marker checks so secret-boundary detection is more reliable. * **Tests** * Updated end-to-end coverage to verify the expected `LOG_MARKER_FOUND` output in deep agent policy checks. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Summary
Fixes the Deep Agents Code secret-boundary check so its
dcode_secret_probeno 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
dcode_secret_probeinto a single-line remote shell command while preserving stdout/stderr capture andDCODE_EXITreporting.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/08-deepagents-code-secret-boundary.sh npm test -- --run test/langchain-deepagents-code-image.test.ts npm run typecheck:cliSigned-off-by: Carlos Villela cvillela@nvidia.com
Summary by CodeRabbit