Skip to content

fix(e2e): skip Deep Agents first-run TUI - #5914

Merged
cv merged 6 commits into
mainfrom
codex/skip-deepagents-tui-onboarding
Jun 27, 2026
Merged

fix(e2e): skip Deep Agents first-run TUI#5914
cv merged 6 commits into
mainfrom
codex/skip-deepagents-tui-onboarding

Conversation

@cv

@cv cv commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

Stabilizes the Deep Agents Code TUI release gate when a fresh sandbox opens upstream's first-run onboarding modal. The Expect harness takes the modal's documented Escape skip path once, then still requires the real coding prompt and the documented double-Ctrl-C idle exit.

Changes

  • Match only the pinned upstream first-run name screen and record a dedicated onboarding-skip marker.
  • Send Escape once for that modal, then wait for the existing prompt-shaped readiness signature.
  • Send Ctrl-C twice after readiness to follow dcode's idle quit contract.
  • Extend behavioral and image-contract tests without broadening the ready-pattern assertion.

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: release-gate harness behavior only; no user-facing NemoClaw behavior changed.
  • 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: self-review confirms the harness matches only the pinned upstream onboarding copy, uses the modal's documented skip binding, preserves the strict coding-prompt assertion, and retains sanitized secret-screened capture handling.
  • 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
  • Git hooks passed during commit and push, or npx prek run --from-ref main --to-ref HEAD passes
  • Targeted tests pass for changed behavior
  • Full npm test passes (broad runtime changes only)
  • 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)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Targeted verification:

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

Live failure evidence identifying the first-run modal:

https://github.com/NVIDIA/NemoClaw/actions/runs/28303850957


Signed-off-by: Carlos Villela cvillela@nvidia.com

Summary by CodeRabbit

  • Bug Fixes
    • Updated Deep Agents Code TUI startup readiness detection to properly handle the first-run onboarding modal.
    • Refined “Your name (optional)” handling so it’s not considered ready, while later prompt-like states still are.
    • Improved the post-readiness exit flow by sending additional interrupts when needed.
  • Tests
    • Strengthened the TUI startup automation to fail fast if the embedded expect logic is missing.
    • Added onboarding pattern validation, onboarding-skip markers, and tighter assertions against sanitized startup logs and captured artifacts.

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@cv cv self-assigned this Jun 27, 2026
@coderabbitai

coderabbitai Bot commented Jun 27, 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

Adds first-run onboarding modal handling to the Deep Agents Code TUI startup check script. A new onboarding regex is wired into the embedded expect flow, and tests now cover onboarding detection, readiness ordering, and sanitized marker output.

Changes

TUI Onboarding Detection and Skip Flow

Layer / File(s) Summary
Onboarding pattern and expect flow
test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh
Defines TUI_ONBOARDING_PATTERN, passes it into the embedded expect script, initializes onboarding_pattern, branches on onboarding detection, captures ready_match, emits NEMOCLAW_TUI_ONBOARDING_SKIPPED, and sends two Ctrl-C signals after readiness.
Unit tests and harness validation
test/deepagents-code-tui-startup-check.test.ts
Extracts the embedded Expect program, adds a Tcl state-machine helper, extends readiness assertions, verifies onboarding-pattern matching, and checks lifecycle markers in sanitized output.
Image-level script assertions
test/langchain-deepagents-code-image.test.ts
Adds startup-check assertions for onboarding-pattern usage, onboarding-skipped marker emission, terminal control sequences, and the $saw_onboarding branch.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

area: e2e, bug-fix, integration: dcode

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and clearly reflects the main change: handling Deep Agents first-run TUI onboarding in e2e.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/skip-deepagents-tui-onboarding

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

@github-code-quality

github-code-quality Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in the codex/skip-deepagent... branch is 96%. Coverage data for the main branch is not yet available.

Show a code coverage summary of the most covered files.
File main codex/skip-deepagent... c1ea543 +/-
nemoclaw/src/se...cret-scanner.ts 100%
nemoclaw/src/commands/slash.ts 100%
nemoclaw/src/li...bprocess-env.ts 100%
nemoclaw/src/bl...eprint/state.ts 98%
nemoclaw/src/onboard/config.ts 98%
nemoclaw/src/bl...int/snapshot.ts 97%
nemoclaw/src/bl...print/runner.ts 95%
nemoclaw/src/co...ration-state.ts 94%
nemoclaw/src/bl...ate-networks.ts 94%
nemoclaw/src/index.ts 94%

TypeScript / code-coverage/cli

The overall coverage in the codex/skip-deepagent... branch is 68%. Coverage data for the main branch is not yet available.

Show a code coverage summary of the most covered files.
File main codex/skip-deepagent... c1ea543 +/-
src/lib/actions...all/run-plan.ts 80%
src/lib/state/o...oard-session.ts 79%
src/lib/actions...dbox/rebuild.ts 74%
src/lib/state/sandbox.ts 72%
src/lib/shields/index.ts 70%
src/lib/onboard/preflight.ts 69%
src/lib/actions...licy-channel.ts 59%
src/lib/onboard...er-gpu-patch.ts 59%
src/lib/policy/index.ts 52%
src/lib/onboard.ts 20%

Updated June 27, 2026 23:40 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@github-actions

github-actions Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor (Nemotron Ultra) — Changes requested

Merge posture: Do not merge yet
Primary next action: Resolve or justify PRA-1: Source-of-truth review needed: Upstream onboarding modal compatibility (10-deepagents-code-tui-startup.sh:29-31).
Open items: 0 required · 4 warnings · 1 suggestion · 1 test follow-up
Since last review: 1 prior item resolved · 0 still apply · 5 new items found

Action checklist

  • PRA-1 Resolve or justify: Source-of-truth review needed: Upstream onboarding modal compatibility (10-deepagents-code-tui-startup.sh:29-31)
  • PRA-2 Resolve or justify: Upstream onboarding workaround lacks regression test for contract change in test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh:29
  • PRA-3 Resolve or justify: tclsh simulation hardcodes prompt strings instead of using regex patterns in test/deepagents-code-tui-startup-check.test.ts:120
  • PRA-4 Resolve or justify: Merge conflict risk with PR feat(mcp): add OpenShell-managed MCP servers #5876 (OpenShell-managed MCP servers) in test/deepagents-code-tui-startup-check.test.ts:1
  • PRA-T1 Add or justify test follow-up: Upstream onboarding modal compatibility (10-deepagents-code-tui-startup.sh:29-31)
  • PRA-5 In-scope improvement: tclsh simulation is a well-scoped test helper — good pattern in test/deepagents-code-tui-startup-check.test.ts:55

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 Resolve/justify acceptance test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh:29 Add a lightweight probe in the image contract test or a version check that fails when dcode --help shows a --skip-first-run or --no-onboarding flag, prompting removal of this compatibility path.
PRA-3 Resolve/justify correctness test/deepagents-code-tui-startup-check.test.ts:120 Align the fake Expect's hardcoded strings with the pattern variables, or make the simulation use the same regex matching logic via Tcl's regexp command.
PRA-4 Resolve/justify correctness test/deepagents-code-tui-startup-check.test.ts:1 Coordinate with PR #5876 author to sequence merges or rebase one PR atop the other.
PRA-5 Improvement architecture test/deepagents-code-tui-startup-check.test.ts:55 No action needed; this is a good pattern for testing interactive PTY logic.
Review findings by urgency: 0 required fixes, 4 items to resolve/justify, 1 in-scope improvement

⚠️ 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: Upstream onboarding modal compatibility (10-deepagents-code-tui-startup.sh:29-31)

  • Location: not file-specific
  • Category: architecture
  • Problem: The advisor marked localized patch analysis as missing.
  • 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: None — missing automated probe for --skip-first-run or --no-onboarding flag
  • 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: Comment documents removal condition but no test enforces it

PRA-2 Resolve/justify — Upstream onboarding workaround lacks regression test for contract change

  • Location: test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh:29
  • Category: acceptance
  • Problem: The compatibility path for Deep Agents Code first-run name screen (deepagents-code 0.1.12) is documented with a removal condition ('once the pinned TUI exposes a stable skip or ready contract') but no automated test exists to detect when upstream adds such a flag. The workaround may persist unnecessarily.
  • Impact: Technical debt accumulation; workaround code remains after upstream fixes the root cause, increasing maintenance burden and test complexity.
  • Recommended action: Add a lightweight probe in the image contract test or a version check that fails when dcode --help shows a --skip-first-run or --no-onboarding flag, prompting removal of this compatibility path.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Search for 'Remove this compatibility path' comment at line 31; verify no test probes dcode for a first-run skip flag.
  • Missing regression test: Add a test in test/langchain-deepagents-code-image.test.ts that runs 'dcode --help' or version probe and fails with a clear message when a first-run skip flag is detected, so the workaround gets removed.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Search for 'Remove this compatibility path' comment at line 31; verify no test probes dcode for a first-run skip flag.
  • Evidence: Comment at shell:29-31 documents removal condition but no test enforces it.

PRA-3 Resolve/justify — tclsh simulation hardcodes prompt strings instead of using regex patterns

  • Location: test/deepagents-code-tui-startup-check.test.ts:120
  • Category: correctness
  • Problem: The fake Expect implementation in runTuiExpectStateMachine hardcodes 'Your name (optional)' and 'What would you like to build?' strings for onboarding/ready events. The real Expect script uses regex patterns from env vars (NEMOCLAW_TUI_ONBOARDING_PATTERN, NEMOCLAW_TUI_READY_PATTERN). If upstream changes the onboarding/ready text, the simulation diverges from production behavior.
  • Impact: False confidence: unit tests pass even when upstream text changes break the real Expect script's pattern matching.
  • Recommended action: Align the fake Expect's hardcoded strings with the pattern variables, or make the simulation use the same regex matching logic via Tcl's regexp command.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Compare tclEventLiterals.onboarding/ready handling in runTuiExpectStateMachine (test:120-135) with the actual Expect script's -nocase -re $onboarding_pattern and $ready_pattern branches (shell:117-125, 132-145).
  • Missing regression test: Add a test that runs the real Expect script (via tclsh) against captured real TUI output fixtures to verify pattern matching stays aligned with upstream text.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Compare tclEventLiterals.onboarding/ready handling in runTuiExpectStateMachine (test:120-135) with the actual Expect script's -nocase -re $onboarding_pattern and $ready_pattern branches (shell:117-125, 132-145).
  • Evidence: Fake Expect uses fixed strings; real Expect uses env var regex patterns.

PRA-4 Resolve/justify — Merge conflict risk with PR #5876 (OpenShell-managed MCP servers)

💡 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-5 Improvement — tclsh simulation is a well-scoped test helper — good pattern

  • Location: test/deepagents-code-tui-startup-check.test.ts:55
  • Category: architecture
  • Problem: The runTuiExpectStateMachine function (~100 lines) directly simulates the Expect state machine for unit testing without introducing unnecessary framework layers, registries, or abstractions. It preserves real shell/system boundaries by spawning tclsh.
  • Impact: Positive example of focused test infrastructure; no action needed.
  • Suggested action: No action needed; this is a good pattern for testing interactive PTY logic.
  • Expected follow-up: Prefer a current-PR fix when local to changed code; defer only with rationale or linked follow-up.
  • Verification: Review the runTuiExpectStateMachine function and its three test consumers (onboarding→ready→exit, onboarding→timeout, ready→exit-close-first).
  • Missing regression test: None.
  • Done when: The local improvement is applied, or the PR notes why it should be deferred.
  • Evidence: runTuiExpectStateMachine at test:55-155; three itWithTclsh tests at test:109-148.
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 Upstream onboarding modal compatibility (10-deepagents-code-tui-startup.sh:29-31) — None — missing automated probe for --skip-first-run or --no-onboarding flag. Comment documents removal condition but no test enforces it
Since last review details

Current findings, using the urgency labels above:

PRA-1 Resolve/justify — Source-of-truth review needed: Upstream onboarding modal compatibility (10-deepagents-code-tui-startup.sh:29-31)

  • Location: not file-specific
  • Category: architecture
  • Problem: The advisor marked localized patch analysis as missing.
  • 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: None — missing automated probe for --skip-first-run or --no-onboarding flag
  • 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: Comment documents removal condition but no test enforces it

PRA-2 Resolve/justify — Upstream onboarding workaround lacks regression test for contract change

  • Location: test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh:29
  • Category: acceptance
  • Problem: The compatibility path for Deep Agents Code first-run name screen (deepagents-code 0.1.12) is documented with a removal condition ('once the pinned TUI exposes a stable skip or ready contract') but no automated test exists to detect when upstream adds such a flag. The workaround may persist unnecessarily.
  • Impact: Technical debt accumulation; workaround code remains after upstream fixes the root cause, increasing maintenance burden and test complexity.
  • Recommended action: Add a lightweight probe in the image contract test or a version check that fails when dcode --help shows a --skip-first-run or --no-onboarding flag, prompting removal of this compatibility path.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Search for 'Remove this compatibility path' comment at line 31; verify no test probes dcode for a first-run skip flag.
  • Missing regression test: Add a test in test/langchain-deepagents-code-image.test.ts that runs 'dcode --help' or version probe and fails with a clear message when a first-run skip flag is detected, so the workaround gets removed.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Search for 'Remove this compatibility path' comment at line 31; verify no test probes dcode for a first-run skip flag.
  • Evidence: Comment at shell:29-31 documents removal condition but no test enforces it.

PRA-3 Resolve/justify — tclsh simulation hardcodes prompt strings instead of using regex patterns

  • Location: test/deepagents-code-tui-startup-check.test.ts:120
  • Category: correctness
  • Problem: The fake Expect implementation in runTuiExpectStateMachine hardcodes 'Your name (optional)' and 'What would you like to build?' strings for onboarding/ready events. The real Expect script uses regex patterns from env vars (NEMOCLAW_TUI_ONBOARDING_PATTERN, NEMOCLAW_TUI_READY_PATTERN). If upstream changes the onboarding/ready text, the simulation diverges from production behavior.
  • Impact: False confidence: unit tests pass even when upstream text changes break the real Expect script's pattern matching.
  • Recommended action: Align the fake Expect's hardcoded strings with the pattern variables, or make the simulation use the same regex matching logic via Tcl's regexp command.
  • Expected follow-up: Resolve in this PR or explain why the risk is acceptable.
  • Verification: Compare tclEventLiterals.onboarding/ready handling in runTuiExpectStateMachine (test:120-135) with the actual Expect script's -nocase -re $onboarding_pattern and $ready_pattern branches (shell:117-125, 132-145).
  • Missing regression test: Add a test that runs the real Expect script (via tclsh) against captured real TUI output fixtures to verify pattern matching stays aligned with upstream text.
  • Done when: The risk is fixed or explicitly justified in the PR. Verification: Compare tclEventLiterals.onboarding/ready handling in runTuiExpectStateMachine (test:120-135) with the actual Expect script's -nocase -re $onboarding_pattern and $ready_pattern branches (shell:117-125, 132-145).
  • Evidence: Fake Expect uses fixed strings; real Expect uses env var regex patterns.

PRA-4 Resolve/justify — Merge conflict risk with PR #5876 (OpenShell-managed MCP servers)

PRA-5 Improvement — tclsh simulation is a well-scoped test helper — good pattern

  • Location: test/deepagents-code-tui-startup-check.test.ts:55
  • Category: architecture
  • Problem: The runTuiExpectStateMachine function (~100 lines) directly simulates the Expect state machine for unit testing without introducing unnecessary framework layers, registries, or abstractions. It preserves real shell/system boundaries by spawning tclsh.
  • Impact: Positive example of focused test infrastructure; no action needed.
  • Suggested action: No action needed; this is a good pattern for testing interactive PTY logic.
  • Expected follow-up: Prefer a current-PR fix when local to changed code; defer only with rationale or linked follow-up.
  • Verification: Review the runTuiExpectStateMachine function and its three test consumers (onboarding→ready→exit, onboarding→timeout, ready→exit-close-first).
  • Missing regression test: None.
  • Done when: The local improvement is applied, or the PR notes why it should be deferred.
  • Evidence: runTuiExpectStateMachine at test:55-155; three itWithTclsh tests at test:109-148.

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 Jun 27, 2026

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: ubuntu-repo-cloud-langchain-deepagents-code
Optional E2E: issue-4434-tui-unreachable-inference-vitest

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • ubuntu-repo-cloud-langchain-deepagents-code (high): This live Vitest scenario performs cloud LangChain Deep Agents Code onboarding and runs the cloud experimental checks list, including test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh. It is the direct end-to-end validation for the modified TUI startup Expect harness against a real Deep Agents Code sandbox.

Optional E2E

  • issue-4434-tui-unreachable-inference-vitest (high): Optional adjacent confidence for TUI-driven sandbox behavior with hosted inference. The PR does not modify inference routing, so this is not merge-blocking, but it can help catch regressions in interactive TUI/inference integration if maintainers want broader coverage.

New E2E recommendations

  • None.

@github-actions

github-actions Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Vitest E2E Scenario Recommendation

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

Dispatch required Vitest E2E scenarios:

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

Workflow run

Full Vitest E2E advisor summary

Vitest E2E Scenario Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required Vitest E2E scenarios

  • ubuntu-repo-cloud-langchain-deepagents-code: The PR changes the Deep Agents Code TUI startup cloud-experimental check that is executed by the live Vitest registry scenario for cloud-langchain-deepagents-code onboarding. This targeted scenario is live-supported and is the smallest dispatch that exercises the changed TUI onboarding/ready/exit behavior in a real Deep Agents Code sandbox.
    • Dispatch: gh workflow run e2e-vitest-scenarios.yaml --ref <pr-head-ref> --field scenarios=ubuntu-repo-cloud-langchain-deepagents-code

Optional Vitest E2E scenarios

  • None.

Relevant changed files

  • test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh

@github-actions

github-actions Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — No blocking findings

Merge posture: No blocking advisor findings
Primary next action: No advisor follow-up required beyond maintainer review.
Open items: 0 required · 0 warnings · 0 suggestions · 0 test follow-ups
Since last review: 1 prior item resolved · 0 still apply · 0 new items found

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.

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

🧹 Nitpick comments (1)
test/langchain-deepagents-code-image.test.ts (1)

474-479: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

Avoid locking the image contract to exact source text.

These assertions pin private implementation details: Tcl variable names, exact marker calls, and control-sequence formatting. Prefer an observable Vitest-driven check that proves onboarding is skipped, readiness is reached, and idle quit exits.

As per path instructions, "**/*.test.{ts,js,mts,mjs,cts,cjs}: 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 474 - 479, The
test in tuiStartupCheck is over-asserting private Tcl source text instead of
observable behavior. Replace the exact string expectations around onboarding
markers, escape sequences, and control flow with a Vitest-level assertion that
verifies the public outcomes: onboarding is skipped, readiness is detected, and
the idle-quit path terminates correctly. Use the existing
tuiStartupCheck-related test setup to assert behavior through emitted results or
state 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.

Inline comments:
In `@test/deepagents-code-tui-startup-check.test.ts`:
- Around line 103-117: The startup readiness test is only asserting the first
onboarding prompt as not-ready, while the second onboarding phrase added in the
same `isOnboarding`/`runTuiStartupCheckHelper` coverage is not guarded. Update
the readiness assertions in `test/deepagents-code-tui-startup-check.test.ts` so
both onboarding variants, including “What should Deep Agents call you?”, are
verified as not-ready before the existing ready-state checks.

---

Nitpick comments:
In `@test/langchain-deepagents-code-image.test.ts`:
- Around line 474-479: The test in tuiStartupCheck is over-asserting private Tcl
source text instead of observable behavior. Replace the exact string
expectations around onboarding markers, escape sequences, and control flow with
a Vitest-level assertion that verifies the public outcomes: onboarding is
skipped, readiness is detected, and the idle-quit path terminates correctly. Use
the existing tuiStartupCheck-related test setup to assert behavior through
emitted results or state rather than implementation details.
🪄 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: 56162cf2-70f7-4e9d-be19-f88e72408b83

📥 Commits

Reviewing files that changed from the base of the PR and between 50cb04b and 2b3fc4f.

📒 Files selected for processing (3)
  • test/deepagents-code-tui-startup-check.test.ts
  • test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh
  • test/langchain-deepagents-code-image.test.ts

Comment thread test/deepagents-code-tui-startup-check.test.ts
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@cv

cv commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed PRA-2 and PRA-T1 through PRA-T8 in verified commit d8f09a70c: two deterministic tclsh tests now execute the embedded Expect program with stubbed PTY primitives. The success path proves Your name (optional) produces Escape (1b), then the real coding prompt produces readiness, then idle exit sends double Ctrl-C (03,03) and captures exit 0. The negative path proves onboarding followed by timeout records NEMOCLAW_TUI_TIMEOUT and never records NEMOCLAW_TUI_READY.

PRA-1 source-of-truth review:

  • Invalid state: a fresh Deep Agents home opens upstream LaunchNameScreen, so the coding-prompt gate times out while the TUI is correctly waiting for optional onboarding input.
  • Source boundary: pinned deepagents-code==0.1.12 should_run_onboarding() and LaunchNameScreen; Escape is its priority skip binding and persists onboarding completion.
  • Source-fix constraint: NemoClaw cannot change the pinned third-party TUI in this release-gate fix, and must not treat onboarding copy as readiness or manufacture lifecycle markers.
  • Regression tests: the real embedded Tcl state machine now covers onboarding→ready→exit and onboarding→timeout, alongside regex and sanitized-marker tests.
  • Removal condition: remove this localized onboarding branch when the pinned upstream CLI no longer presents the modal for fresh homes or exposes a stable non-interactive onboarding-skip flag/protocol.

Nemotron Ultra’s prior warning was an advisor JSON-parse failure rather than a code finding. The completed GPT-5.5 review, the manual source review above, and the new behavioral tests cover that gap; the refreshed advisors are running on the new head.

@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: 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/deepagents-code-tui-startup-check.test.ts`:
- Around line 224-226: The startup-check test is only comparing marker order in
markerText and can pass even when the onboarding marker is absent because
indexOf returns -1. Update deepagents-code-tui-startup-check.test.ts to first
assert that NEMOCLAW_TUI_ONBOARDING_SKIPPED is actually present in the observed
output before checking it appears before NEMOCLAW_TUI_READY, keeping the
assertion at the public output boundary in this test case.
🪄 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: 93f01a96-370a-47fa-9437-8b28735b3e1a

📥 Commits

Reviewing files that changed from the base of the PR and between 2b3fc4f and d8f09a7.

📒 Files selected for processing (1)
  • test/deepagents-code-tui-startup-check.test.ts

Comment thread test/deepagents-code-tui-startup-check.test.ts
cv added 2 commits June 27, 2026 16:12
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@cv

cv commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed the two remaining CodeRabbit test-strengthening findings in 47d28c1: both pinned onboarding phrases are now explicitly rejected as readiness, and the success-path state-machine test asserts both lifecycle markers exist before comparing their order. Focused TUI/image tests pass (68/68), CLI typecheck passes, and the full commit/push hooks pass. Signed-off-by: Carlos Villela cvillela@nvidia.com

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@cv

cv commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed the final Nemotron review on current head f257f21:

  • PRA-1: the embedded-Tcl behavioral tests now use it.runIf(tclshAvailable), so environments without tclsh skip those explicitly named (tclsh) tests instead of failing with ENOENT.
  • PRA-2: the fake event queue now accepts a closed TuiExpectEvent union and emits only fixed tclEventLiterals; caller-controlled strings are no longer interpolated into Tcl.
  • PRA-3/PRA-5/PRA-T1: the workaround remains narrowly tied to the inspected, pinned deepagents-code 0.1.12 first-run name screen. It still requires the real coding prompt before readiness, and the shell source now states the removal condition: remove once the pinned TUI exposes a stable skip or ready contract.
  • PRA-4/PRA-T2: the tests execute the actual embedded Tcl program from the production check; only Expect I/O is stubbed to cover onboarding -> ready -> exit and onboarding -> timeout deterministically.
  • PRA-6: no third-party issue link was added because this repository's contributor instructions prohibit external project repository links, and filing an upstream issue is outside this PR's authorization. The upstream boundary and removal condition are documented directly in source.

Verification: shfmt, ShellCheck, bash syntax, focused TUI/image tests (68/68), CLI typecheck, conditional scan, full commit hooks, and pre-push hooks all pass.

Signed-off-by: Carlos Villela cvillela@nvidia.com

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@cv

cv commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed the final GPT advisor warning in c1ea543. Only the second Ctrl-C send is now wrapped in Tcl catch, preserving the required readiness-first flow and initial interrupt while tolerating a child that already closed. The embedded production Tcl state-machine test now simulates closure after the first Ctrl-C and verifies a one-key 03 trace plus NEMOCLAW_TUI_READY and NEMOCLAW_TUI_EXIT_CAPTURED:0. Focused TUI/image coverage is 69/69; shfmt, ShellCheck, bash syntax, CLI typecheck, conditional scan, full commit hooks, and pre-push hooks pass. The existing onboarding-timeout test covers PRA-T2, while the live lane after merge will provide the requested runtime acceptance evidence. Signed-off-by: Carlos Villela cvillela@nvidia.com

@cv

cv commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator Author

Current-head Nemotron warnings are resolved/justified as follows:

  • PRA-1: the source-of-truth review was recorded earlier in this PR and remains applicable: invalid state = pinned dcode 0.1.12 opens LaunchNameScreen and blocks the coding prompt; source boundary = upstream should_run_onboarding() / LaunchNameScreen; source-fix constraint = this repo cannot add a third-party non-interactive flag; regression coverage = actual embedded Tcl exercises onboarding -> ready -> exit and onboarding -> timeout; removal condition = the new shell comment says to remove once the pinned TUI exposes a stable skip or ready contract.
  • PRA-2/PRA-T1: a dcode --help text probe would be a brittle inverse assertion and would not prove a future flag actually suppresses LaunchNameScreen. The pinned-version image contract plus the live onboarding/timeout state-machine tests fail visibly when this contract changes; the release-gate run after merge is the runtime acceptance check. The removal condition is explicit in source.
  • PRA-3: the fake prompt strings are event payloads, not duplicated matching logic. The actual embedded Tcl program and its branch expressions are executed; separate helper tests exercise the exact TUI_ONBOARDING_PATTERN and TUI_READY_PATTERN, including both onboarding phrases and rejecting them as readiness.
  • PRA-4: feat(mcp): add OpenShell-managed MCP servers #5876 is currently DIRTY/conflicting and review-required, while fix(e2e): skip Deep Agents first-run TUI #5914 is GitHub MERGEABLE on current main. No behavioral conflict is being hidden here; feat(mcp): add OpenShell-managed MCP servers #5876 must resolve against the landed main state if it proceeds.

No new code is warranted for these warnings. GPT review, CodeRabbit, required CI, focused tests, and manual review are clean on c1ea543.

Signed-off-by: Carlos Villela cvillela@nvidia.com

@cv
cv enabled auto-merge (squash) June 27, 2026 23:42
@cv
cv disabled auto-merge June 27, 2026 23:42
@cv
cv merged commit 745988a into main Jun 27, 2026
41 checks passed
@cv
cv deleted the codex/skip-deepagents-tui-onboarding branch June 27, 2026 23:42
Hadar301 pushed a commit to Hadar301/NemoClaw-OpenShift that referenced this pull request Jul 12, 2026
<!-- markdownlint-disable MD041 -->
## Summary
Stabilizes the Deep Agents Code TUI release gate when a fresh sandbox
opens upstream's first-run onboarding modal. The Expect harness takes
the modal's documented Escape skip path once, then still requires the
real coding prompt and the documented double-Ctrl-C idle exit.

## Changes

- Match only the pinned upstream first-run name screen and record a
dedicated onboarding-skip marker.
- Send Escape once for that modal, then wait for the existing
prompt-shaped readiness signature.
- Send Ctrl-C twice after readiness to follow dcode's idle quit
contract.
- Extend behavioral and image-contract tests without broadening the
ready-pattern assertion.

## 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: release-gate harness behavior
only; no user-facing NemoClaw behavior changed.
- [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 confirms
the harness matches only the pinned upstream onboarding copy, uses the
modal's documented skip binding, preserves the strict coding-prompt
assertion, and retains sanitized secret-screened capture handling.
- [ ] 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] 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
```

Live failure evidence identifying the first-run modal:

https://github.com/NVIDIA/NemoClaw/actions/runs/28303850957

---
Signed-off-by: Carlos Villela <cvillela@nvidia.com>


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

* **Bug Fixes**
* Updated Deep Agents Code TUI startup readiness detection to properly
handle the first-run onboarding modal.
* Refined “Your name (optional)” handling so it’s not considered ready,
while later prompt-like states still are.
* Improved the post-readiness exit flow by sending additional interrupts
when needed.
* **Tests**
* Strengthened the TUI startup automation to fail fast if the embedded
expect logic is missing.
* Added onboarding pattern validation, onboarding-skip markers, and
tighter assertions against sanitized startup logs and captured
artifacts.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@wscurran wscurran added area: ci CI workflows, checks, release automation, or GitHub Actions area: e2e End-to-end tests, nightly failures, or validation infrastructure bug-fix PR fixes a bug or regression integration: dcode LangChain Deep Code integration behavior labels Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci CI workflows, checks, release automation, or GitHub Actions area: e2e End-to-end tests, nightly failures, or validation infrastructure bug-fix PR fixes a bug or regression integration: dcode LangChain Deep Code integration behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants