Commit 1bfeddc
test(e2e): accept completed OpenClaw TUI turns (#9444)
## Summary
Preserve a successful OpenClaw launch when the TUI closes its input
reader immediately after publishing the two required structured turns.
The harness still requires the real child to exit zero; nonzero exits
remain failures and now retain their bounded diagnostics.
This follows the merged startup-message fix in #9422. Two focused
current-main runs reproduced the newly exposed exit race after hosted
inference, sandbox inference, recovery, and the launch-readiness
producer had all passed: [run
32112329966](https://github.com/NVIDIA/NemoClaw/actions/runs/32112329966)
and [run
32112353122](https://github.com/NVIDIA/NemoClaw/actions/runs/32112353122).
## Related Issue
Follow-up to #9384
## Changes
- Treat the post-turn `/exit` write as best-effort after two ordered
structured turns are already qualified.
- Continue to wait for and require the actual TUI child exit status,
reporting both a failed exit-command write and any nonzero child exit.
- Keep cleanup diagnostics on stderr instead of redirecting the parent
shell's stderr for the remainder of the session.
- Extend the Linux delayed-input fixture to cover a clean TUI exit after
the two required turns without increasing the test-file budget.
## 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:
- [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: The change runs only
after exact PTY identity, noncanonical input mode, and two ordered
structured turns are proven. It does not retry input, relax PTY
evidence, or accept a nonzero TUI exit.
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:
## DGX Station Hardware Evidence
- [ ] Tested on DGX Station
- Tested commit: Not applicable
- Station profile/scenario: Not applicable
- Result: Not applicable
- Supporting evidence: Not applicable
## Verification
- [x] PR description includes a `Signed-off-by:` line and every commit
appears as `Verified` in GitHub
- [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or
`npm run validate:pr` passed after refreshing `origin/main` when hooks
were skipped or unavailable
- [x] Targeted behavior tests pass for the current change set, or tests
are marked not applicable above — `vitest run --project e2e-support
test/e2e/support/launch-agent-turn.test.ts` (19 passed; 24 Linux-only
tests skipped locally)
- [ ] Applicable broad gate passed — `npm test` for broad
runtime/test-harness changes; `npm run check` for repo-wide
validation/coverage changes — not applicable to this focused live-E2E
exit-path change; the targeted support suite, source-shape budget,
growth guardrails, repository checks, secret scan, and CLI typecheck
passed in `npm run validate:pr`.
- [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)
---
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved launch cleanup and exit handling when terminal sessions close
unexpectedly.
* Exit commands now handle terminal closure more gracefully and provide
clearer diagnostics when launches end unsuccessfully.
* **Tests**
* Updated delayed-input coverage to verify that sessions can complete
cleanly after two turns.
* Improved validation of successful completion when input becomes
available later in the launch.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>1 parent 7f7126e commit 1bfeddc
2 files changed
Lines changed: 16 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1264 | 1264 | | |
1265 | 1265 | | |
1266 | 1266 | | |
| 1267 | + | |
1267 | 1268 | | |
1268 | | - | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
1269 | 1279 | | |
1270 | 1280 | | |
1271 | 1281 | | |
| |||
1285 | 1295 | | |
1286 | 1296 | | |
1287 | 1297 | | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
1288 | 1301 | | |
1289 | 1302 | | |
1290 | 1303 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
522 | 522 | | |
523 | 523 | | |
524 | 524 | | |
| 525 | + | |
525 | 526 | | |
526 | 527 | | |
527 | 528 | | |
| |||
1042 | 1043 | | |
1043 | 1044 | | |
1044 | 1045 | | |
1045 | | - | |
| 1046 | + | |
1046 | 1047 | | |
1047 | 1048 | | |
1048 | 1049 | | |
| |||
0 commit comments