From 3cf07abbfff45ee3d41764441151f5a00f1180d2 Mon Sep 17 00:00:00 2001 From: Carlos Villela Date: Sat, 27 Jun 2026 12:40:24 -0700 Subject: [PATCH 1/3] fix(e2e): accept Deep Agents TUI expect markers Signed-off-by: Carlos Villela --- .../deepagents-code-tui-startup-check.test.ts | 19 +++++++++++++++++++ .../checks/10-deepagents-code-tui-startup.sh | 10 +++++++++- test/langchain-deepagents-code-image.test.ts | 3 +++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/test/deepagents-code-tui-startup-check.test.ts b/test/deepagents-code-tui-startup-check.test.ts index 4f52d70fa88..c0e304e43f6 100644 --- a/test/deepagents-code-tui-startup-check.test.ts +++ b/test/deepagents-code-tui-startup-check.test.ts @@ -105,6 +105,25 @@ describe("Deep Agents Code TUI startup check helpers", () => { expect(readiness("How can I help with the codebase today?")).toBe("ready"); }); + it("accepts expect-observed startup when upstream omits stable prompt text", () => { + const output = runTuiStartupCheckHelper( + [ + "PASSED=0", + "FAILED=0", + 'plain_capture_file="$(mktemp)"', + "expect_rc=0", + 'printf "NEMOCLAW_TUI_READY\\nNEMOCLAW_TUI_EXIT_CAPTURED:130\\n" >"$plain_capture_file"', + 'if grep -q "NEMOCLAW_TUI_READY" "$plain_capture_file" && is_tui_ready_capture <"$plain_capture_file"; then pass "dcode TUI rendered a usable startup prompt signature"; elif [ "$expect_rc" -eq 0 ]; then pass "expect harness observed startup and exit markers without stable prompt text"; else fail_test "dcode TUI prompt-ready marker missing from capture"; fi', + 'rm -f -- "$plain_capture_file"', + 'printf "passed=%s failed=%s" "$PASSED" "$FAILED"', + ].join("; "), + ); + + expect(output).toBe( + "10-deepagents-code-tui-startup: OK (expect harness observed startup and exit markers without stable prompt text)\npassed=1 failed=0", + ); + }); + it("does not treat generic TUI exit status 1 as a clean Ctrl-C exit", () => { const assertExit = (exitCode: string) => runTuiStartupCheckHelper( diff --git a/test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh b/test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh index 9f27a199b67..31293a700f2 100755 --- a/test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh +++ b/test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh @@ -285,11 +285,19 @@ main() { if grep -q "NEMOCLAW_TUI_READY" "$plain_capture_file" && is_tui_ready_capture <"$plain_capture_file"; then pass "dcode TUI rendered a usable startup prompt signature" + elif [ "$expect_rc" -eq 0 ]; then + pass "expect harness observed startup and exit markers without stable prompt text" else fail_test "dcode TUI prompt-ready marker missing from capture" fi - assert_clean_exit_code "$plain_capture_file" + if grep -q "NEMOCLAW_TUI_EXIT_CAPTURED:" "$plain_capture_file"; then + assert_clean_exit_code "$plain_capture_file" + elif [ "$expect_rc" -eq 0 ]; then + pass "expect harness captured a clean TUI exit before sanitized log marker extraction" + else + assert_clean_exit_code "$plain_capture_file" + fi if [ "$secret_detected" -eq 1 ]; then fail_test "secret-shaped value found in sanitized TUI capture" diff --git a/test/langchain-deepagents-code-image.test.ts b/test/langchain-deepagents-code-image.test.ts index 17a31237daf..ed780c221fa 100644 --- a/test/langchain-deepagents-code-image.test.ts +++ b/test/langchain-deepagents-code-image.test.ts @@ -473,6 +473,9 @@ describe("LangChain Deep Agents Code image contracts", () => { expect(tuiStartupCheck).toContain("cd /sandbox; dcode"); expect(tuiStartupCheck).toContain("NEMOCLAW_TUI_READY"); expect(tuiStartupCheck).toContain("NEMOCLAW_TUI_EXIT_CAPTURED"); + expect(tuiStartupCheck).toContain( + "expect harness observed startup and exit markers without stable prompt text", + ); expect(tuiStartupCheck).toContain("DEEPAGENTS_TUI_TIMEOUT must be a positive integer"); expect(tuiStartupCheck).toContain("strip_terminal_control_sequences"); expect(tuiStartupCheck).toContain("is_tui_ready_capture"); From 7207d896d513b6c45f4ad1ccc3e9704b4c49ae09 Mon Sep 17 00:00:00 2001 From: Carlos Villela Date: Sat, 27 Jun 2026 12:50:55 -0700 Subject: [PATCH 2/3] fix(e2e): require TUI exit marker for fallback Signed-off-by: Carlos Villela --- test/deepagents-code-tui-startup-check.test.ts | 4 ++-- .../checks/10-deepagents-code-tui-startup.sh | 12 +++--------- test/langchain-deepagents-code-image.test.ts | 2 +- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/test/deepagents-code-tui-startup-check.test.ts b/test/deepagents-code-tui-startup-check.test.ts index c0e304e43f6..62801f216b1 100644 --- a/test/deepagents-code-tui-startup-check.test.ts +++ b/test/deepagents-code-tui-startup-check.test.ts @@ -113,14 +113,14 @@ describe("Deep Agents Code TUI startup check helpers", () => { 'plain_capture_file="$(mktemp)"', "expect_rc=0", 'printf "NEMOCLAW_TUI_READY\\nNEMOCLAW_TUI_EXIT_CAPTURED:130\\n" >"$plain_capture_file"', - 'if grep -q "NEMOCLAW_TUI_READY" "$plain_capture_file" && is_tui_ready_capture <"$plain_capture_file"; then pass "dcode TUI rendered a usable startup prompt signature"; elif [ "$expect_rc" -eq 0 ]; then pass "expect harness observed startup and exit markers without stable prompt text"; else fail_test "dcode TUI prompt-ready marker missing from capture"; fi', + 'if grep -q "NEMOCLAW_TUI_READY" "$plain_capture_file" && is_tui_ready_capture <"$plain_capture_file"; then pass "dcode TUI rendered a usable startup prompt signature"; elif [ "$expect_rc" -eq 0 ] && grep -q "NEMOCLAW_TUI_EXIT_CAPTURED:" "$plain_capture_file"; then pass "expect harness observed startup and clean-exit markers without stable prompt text"; else fail_test "dcode TUI prompt-ready marker missing from capture"; fi', 'rm -f -- "$plain_capture_file"', 'printf "passed=%s failed=%s" "$PASSED" "$FAILED"', ].join("; "), ); expect(output).toBe( - "10-deepagents-code-tui-startup: OK (expect harness observed startup and exit markers without stable prompt text)\npassed=1 failed=0", + "10-deepagents-code-tui-startup: OK (expect harness observed startup and clean-exit markers without stable prompt text)\npassed=1 failed=0", ); }); diff --git a/test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh b/test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh index 31293a700f2..f2b632d2909 100755 --- a/test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh +++ b/test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh @@ -285,19 +285,13 @@ main() { if grep -q "NEMOCLAW_TUI_READY" "$plain_capture_file" && is_tui_ready_capture <"$plain_capture_file"; then pass "dcode TUI rendered a usable startup prompt signature" - elif [ "$expect_rc" -eq 0 ]; then - pass "expect harness observed startup and exit markers without stable prompt text" + elif [ "$expect_rc" -eq 0 ] && grep -q "NEMOCLAW_TUI_EXIT_CAPTURED:" "$plain_capture_file"; then + pass "expect harness observed startup and clean-exit markers without stable prompt text" else fail_test "dcode TUI prompt-ready marker missing from capture" fi - if grep -q "NEMOCLAW_TUI_EXIT_CAPTURED:" "$plain_capture_file"; then - assert_clean_exit_code "$plain_capture_file" - elif [ "$expect_rc" -eq 0 ]; then - pass "expect harness captured a clean TUI exit before sanitized log marker extraction" - else - assert_clean_exit_code "$plain_capture_file" - fi + assert_clean_exit_code "$plain_capture_file" if [ "$secret_detected" -eq 1 ]; then fail_test "secret-shaped value found in sanitized TUI capture" diff --git a/test/langchain-deepagents-code-image.test.ts b/test/langchain-deepagents-code-image.test.ts index ed780c221fa..702fe76c741 100644 --- a/test/langchain-deepagents-code-image.test.ts +++ b/test/langchain-deepagents-code-image.test.ts @@ -474,7 +474,7 @@ describe("LangChain Deep Agents Code image contracts", () => { expect(tuiStartupCheck).toContain("NEMOCLAW_TUI_READY"); expect(tuiStartupCheck).toContain("NEMOCLAW_TUI_EXIT_CAPTURED"); expect(tuiStartupCheck).toContain( - "expect harness observed startup and exit markers without stable prompt text", + "expect harness observed startup and clean-exit markers without stable prompt text", ); expect(tuiStartupCheck).toContain("DEEPAGENTS_TUI_TIMEOUT must be a positive integer"); expect(tuiStartupCheck).toContain("strip_terminal_control_sequences"); From d81d542589268aae73e4a254aec3be8673c07721 Mon Sep 17 00:00:00 2001 From: Carlos Villela Date: Sat, 27 Jun 2026 13:00:14 -0700 Subject: [PATCH 3/3] revert: require stable Deep Agents TUI prompt Signed-off-by: Carlos Villela --- .../deepagents-code-tui-startup-check.test.ts | 19 ------------------- .../checks/10-deepagents-code-tui-startup.sh | 2 -- test/langchain-deepagents-code-image.test.ts | 3 --- 3 files changed, 24 deletions(-) diff --git a/test/deepagents-code-tui-startup-check.test.ts b/test/deepagents-code-tui-startup-check.test.ts index 62801f216b1..4f52d70fa88 100644 --- a/test/deepagents-code-tui-startup-check.test.ts +++ b/test/deepagents-code-tui-startup-check.test.ts @@ -105,25 +105,6 @@ describe("Deep Agents Code TUI startup check helpers", () => { expect(readiness("How can I help with the codebase today?")).toBe("ready"); }); - it("accepts expect-observed startup when upstream omits stable prompt text", () => { - const output = runTuiStartupCheckHelper( - [ - "PASSED=0", - "FAILED=0", - 'plain_capture_file="$(mktemp)"', - "expect_rc=0", - 'printf "NEMOCLAW_TUI_READY\\nNEMOCLAW_TUI_EXIT_CAPTURED:130\\n" >"$plain_capture_file"', - 'if grep -q "NEMOCLAW_TUI_READY" "$plain_capture_file" && is_tui_ready_capture <"$plain_capture_file"; then pass "dcode TUI rendered a usable startup prompt signature"; elif [ "$expect_rc" -eq 0 ] && grep -q "NEMOCLAW_TUI_EXIT_CAPTURED:" "$plain_capture_file"; then pass "expect harness observed startup and clean-exit markers without stable prompt text"; else fail_test "dcode TUI prompt-ready marker missing from capture"; fi', - 'rm -f -- "$plain_capture_file"', - 'printf "passed=%s failed=%s" "$PASSED" "$FAILED"', - ].join("; "), - ); - - expect(output).toBe( - "10-deepagents-code-tui-startup: OK (expect harness observed startup and clean-exit markers without stable prompt text)\npassed=1 failed=0", - ); - }); - it("does not treat generic TUI exit status 1 as a clean Ctrl-C exit", () => { const assertExit = (exitCode: string) => runTuiStartupCheckHelper( diff --git a/test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh b/test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh index f2b632d2909..9f27a199b67 100755 --- a/test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh +++ b/test/e2e/e2e-cloud-experimental/checks/10-deepagents-code-tui-startup.sh @@ -285,8 +285,6 @@ main() { if grep -q "NEMOCLAW_TUI_READY" "$plain_capture_file" && is_tui_ready_capture <"$plain_capture_file"; then pass "dcode TUI rendered a usable startup prompt signature" - elif [ "$expect_rc" -eq 0 ] && grep -q "NEMOCLAW_TUI_EXIT_CAPTURED:" "$plain_capture_file"; then - pass "expect harness observed startup and clean-exit markers without stable prompt text" else fail_test "dcode TUI prompt-ready marker missing from capture" fi diff --git a/test/langchain-deepagents-code-image.test.ts b/test/langchain-deepagents-code-image.test.ts index 702fe76c741..17a31237daf 100644 --- a/test/langchain-deepagents-code-image.test.ts +++ b/test/langchain-deepagents-code-image.test.ts @@ -473,9 +473,6 @@ describe("LangChain Deep Agents Code image contracts", () => { expect(tuiStartupCheck).toContain("cd /sandbox; dcode"); expect(tuiStartupCheck).toContain("NEMOCLAW_TUI_READY"); expect(tuiStartupCheck).toContain("NEMOCLAW_TUI_EXIT_CAPTURED"); - expect(tuiStartupCheck).toContain( - "expect harness observed startup and clean-exit markers without stable prompt text", - ); expect(tuiStartupCheck).toContain("DEEPAGENTS_TUI_TIMEOUT must be a positive integer"); expect(tuiStartupCheck).toContain("strip_terminal_control_sequences"); expect(tuiStartupCheck).toContain("is_tui_ready_capture");