fix(e2e): avoid multiline Deep Agents Tavily probe - #5905
Conversation
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
📝 WalkthroughWalkthroughThe Tavily opt-in check script is refactored to emit the Python probe as a base64-encoded single-line Tavily Probe No-Newline Enforcement
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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) — 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. |
E2E Advisor RecommendationRequired E2E: 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. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
test/langchain-deepagents-code-image.test.ts (1)
500-503: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAvoid locking this test to implementation strings.
These checks assert source text rather than the observable Tavily probe contract. Since the new self-test executes the script boundary and verifies
NO_NEWLINE_IN_COMMAND, prefer relying on that behavior instead of duplicating internal implementation fragments here. As per path instructions, “Prefer observable outcomes through the public boundary over source-text, private-shape, or mock-call assertions.”Suggested simplification
- expect(tavilyOptInCheck).toContain("python_probe_source"); - expect(tavilyOptInCheck).toContain("base64 | tr -d"); - expect(tavilyOptInCheck).toContain("python3 -c"); - expect(tavilyOptInCheck).toContain("NEMOCLAW_E2E_TAVILY_SELF_TEST");🤖 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 500 - 503, The Tavily self-test in the test file is over-coupled to internal source strings instead of the public script behavior. Update the assertions around tavilyOptInCheck to validate the observable probe contract at the script boundary, especially the NO_NEWLINE_IN_COMMAND behavior, and remove checks for implementation-specific fragments like python_probe_source, base64 | tr -d, python3 -c, and NEMOCLAW_E2E_TAVILY_SELF_TEST.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 500-503: The Tavily self-test in the test file is over-coupled to
internal source strings instead of the public script behavior. Update the
assertions around tavilyOptInCheck to validate the observable probe contract at
the script boundary, especially the NO_NEWLINE_IN_COMMAND behavior, and remove
checks for implementation-specific fragments like python_probe_source, base64 |
tr -d, python3 -c, and NEMOCLAW_E2E_TAVILY_SELF_TEST.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 2836503d-a6ec-4550-8f68-733253689e54
📒 Files selected for processing (3)
test/e2e-scenario/support-tests/platform-parity-cloud-experimental.test.tstest/e2e/e2e-cloud-experimental/checks/09-deepagents-code-tavily-opt-in.shtest/langchain-deepagents-code-image.test.ts
<!-- markdownlint-disable MD041 --> ## Summary Preserves Deep Agents TUI expect harness markers in the sanitized capture file. The post-#5905 rerun showed the expect harness reached startup and observed exit, but its markers were only printed to expect stdout and did not survive into the capture file checked by the assertions. ## Changes - Adds an expect `append_marker` helper that writes readiness, timeout/EOF, and exit markers directly to the capture file. - Keeps the existing strict prompt and clean-exit assertions unchanged. - Extends the Deep Agents image contract test to assert marker preservation. ## 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; capture-marker persistence only, strict TUI assertions remain in place. - [ ] 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/10-deepagents-code-tui-startup.sh npm test -- --run test/deepagents-code-tui-startup-check.test.ts 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** * Improved Deep Agents Code TUI startup/exit-state checks by validating multiple lifecycle markers (readiness, timeout/error/EOF before readiness, and exit capture with timeout/EOF around exit) to make automation more dependable. * Added coverage to ensure startup sanitization preserves the lifecycle marker strings in the generated sanitized capture artifact. <!-- 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 Tavily opt-in check so its Python reachability probe no longer sends a multiline heredoc as a single OpenShell exec argument. The post-NVIDIA#5903 rerun showed the scenario now reaches the Tavily check and fails on the same newline command-shape issue. ## Changes - Encodes the Tavily Python probe source locally with portable `base64 | tr -d '\n'` and decodes it inside a single-line `python3 -c` command. - Adds a self-test mode that proves the command sent through `sandbox_exec` is newline-free. - Updates Deep Agents image contract tests for the new probe 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; same Python probe, single-line transport only. - [ ] 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/09-deepagents-code-tavily-opt-in.sh NEMOCLAW_E2E_TAVILY_SELF_TEST=probe-command-shape bash test/e2e/e2e-cloud-experimental/checks/09-deepagents-code-tavily-opt-in.sh npm test -- --run test/e2e-scenario/support-tests/platform-parity-cloud-experimental.test.ts 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 reliability of a cloud-experimental check by verifying a command runs in the expected format and completes successfully. * Strengthened validation around an opt-in workflow so it is less likely to break due to formatting issues in generated commands. * Added broader test coverage for the same behavior to catch regressions earlier. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Carlos Villela <cvillela@nvidia.com>
<!-- markdownlint-disable MD041 --> ## Summary Preserves Deep Agents TUI expect harness markers in the sanitized capture file. The post-NVIDIA#5905 rerun showed the expect harness reached startup and observed exit, but its markers were only printed to expect stdout and did not survive into the capture file checked by the assertions. ## Changes - Adds an expect `append_marker` helper that writes readiness, timeout/EOF, and exit markers directly to the capture file. - Keeps the existing strict prompt and clean-exit assertions unchanged. - Extends the Deep Agents image contract test to assert marker preservation. ## 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; capture-marker persistence only, strict TUI assertions remain in place. - [ ] 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/10-deepagents-code-tui-startup.sh npm test -- --run test/deepagents-code-tui-startup-check.test.ts 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** * Improved Deep Agents Code TUI startup/exit-state checks by validating multiple lifecycle markers (readiness, timeout/error/EOF before readiness, and exit capture with timeout/EOF around exit) to make automation more dependable. * Added coverage to ensure startup sanitization preserves the lifecycle marker strings in the generated sanitized capture artifact. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Summary
Fixes the Deep Agents Code Tavily opt-in check so its Python reachability probe no longer sends a multiline heredoc as a single OpenShell exec argument. The post-#5903 rerun showed the scenario now reaches the Tavily check and fails on the same newline command-shape issue.
Changes
base64 | tr -d '\n'and decodes it inside a single-linepython3 -ccommand.sandbox_execis newline-free.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/09-deepagents-code-tavily-opt-in.sh NEMOCLAW_E2E_TAVILY_SELF_TEST=probe-command-shape bash test/e2e/e2e-cloud-experimental/checks/09-deepagents-code-tavily-opt-in.sh npm test -- --run test/e2e-scenario/support-tests/platform-parity-cloud-experimental.test.ts test/langchain-deepagents-code-image.test.ts npm run typecheck:cliSigned-off-by: Carlos Villela cvillela@nvidia.com
Summary by CodeRabbit