Repository navigation
test(openclaw): add TUI chat correlation regression - #3364
Conversation
Signed-off-by: Carlos Villela <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis pull request adds a comprehensive regression test for OpenClaw issue ChangesTUI/Webchat Correlation Test Suite
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes The test spans multiple concerns—data model, trace analysis logic, failure reporting, test data fixtures, sandbox execution infrastructure, embedded script generation, and two distinct test paths—with dense logic for event compaction, analysis detection, and live WebSocket-based reproduction. While the changes are contained in a single file, they demand careful reasoning across each layer and verification of the analysis heuristics. Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
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/openclaw-tui-chat-correlation.test.js`:
- Around line 1-446: The test edits were made to the guarded JS copy instead of
the canonical TypeScript source; revert/remove changes in
test/openclaw-tui-chat-correlation.test.js and apply the intended changes into
the TypeScript test (test/openclaw-tui-chat-correlation.test.ts) by copying the
updated test implementation (including analyzeIssue2603Trace,
buildLiveReproScript, runLiveIssue2603Repro, execOpenShell, execInSandbox and
the "OpenClaw TUI chat correlation regression (`#2603`)" describe/it blocks) into
the .ts file, converting any CommonJS snippets to TS/ES module syntax as needed
and preserving typings, then run tests to ensure the legacy-path-guard job no
longer fails.
🪄 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: a926969b-e236-4386-981a-1c799c5ab31d
📒 Files selected for processing (1)
test/openclaw-tui-chat-correlation.test.js
Signed-off-by: Carlos Villela <[email protected]>
|
Addressed the CodeRabbit/legacy-path-guard finding in 35f67fe: moved the regression harness from the guarded |
…3366) ## Summary Adds `pull-requests: write` to the `e2e-advisor` workflow so the advisor can actually post its recommendation comment on PRs. ## What's broken on `main` today Since PR #3289 merged ~2 hours ago, the advisor workflow has been running successfully on same-repo PRs — but the `Post E2E advisor PR comment` step silently skips every time: ``` 403 {"message":"Resource not accessible by integration"} ``` Concrete evidence on PR #3364: | Run | Job | Comment posted? | |---|---|---| | [25697796461](https://github.com/NVIDIA/NemoClaw/actions/runs/25697796461) | ✅ success | ❌ no | | [25699366979](https://github.com/NVIDIA/NemoClaw/actions/runs/25699366979) | ✅ success | ❌ no | The runs look green because `comment.mjs` catches the 403 as a permission error (a defensive path added during the #3289 review) and keeps the job passing, but the user-visible artifact — the comment on the PR — never materializes. ## Root cause The `permissions:` block on `main` currently declares: ```yaml permissions: contents: read pull-requests: read issues: write ``` The token effective permissions confirm this takes effect (from the `Set up job` log group): ``` GITHUB_TOKEN Permissions Contents: read Issues: write Metadata: read PullRequests: read ``` Even so, `POST /repos//issues/3364/comments` returns `403 Resource not accessible by integration`. The reason is a well-documented GitHub Actions permission-name trap: for `GITHUB_TOKEN`, **PR comments are gated by `pull-requests: write`, not `issues: write`** — even though the REST endpoint lives under `/issues/:n/comments`. The `issues` permission only applies to true issues; PRs fall under `pull-requests`. This is tracked in [community discussion #56632](https://github.com/orgs/community/discussions/56632) and has bitten many workflows. ## Fix Flip `pull-requests` from `read` to `write`, and drop an inline comment on the permissions block so the next reviewer doesn't have to rediscover this. `issues: write` is kept for now — it's unused on the PR-comment path but it's dirt-cheap to leave in case we ever want the advisor to post on true issues. ## Defense in depth The graceful permission-error handling in `tools/e2e-advisor/comment.mjs` (added in #3289 per @ericksoa's review) stays in place unchanged. This PR just ensures that for a correctly-configured repo the 403 path is no longer hit on normal same-repo PRs. ## Testing - `python3 -c "import yaml; yaml.safe_load(open('.github/workflows/e2e-advisor.yaml'))"` — workflow still parses. - Non-code change, so local unit tests are unaffected. - The real verification is the next same-repo PR after merge — expected behavior is an advisor comment appearing within a few minutes. ## Out of scope for this PR There's a second gap visible on upstream: `PI_E2E_ADVISOR_API_KEY` is not set on `NVIDIA/NemoClaw`, so the analysis step currently degrades to: > `Skipped: No Pi provider credential was available in this workflow environment` That's an admin configuration task (Settings → Secrets and variables → Actions → New repository secret), not a code change, so handling it separately. ## Related - PR #3289 (merged): introduced the advisor + the trust-boundary restructure. - Observed on PR #3364 (same-repo, member-authored, fresh push — exactly the case the advisor is designed for). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Updated pull request workflow permissions to enable advisor to post and update comments on pull requests. [](https://app.coderabbit.ai/change-stack/NVIDIA/NemoClaw/pull/3366) <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary
Adds a focused regression harness for #2603 so NemoClaw can recognize the OpenClaw TUI/WebChat correlation failure without making normal CI depend on a live sandbox. The default test documents the observed broken gateway trace, while an opt-in live test can be run against an OpenClaw sandbox to verify whether a pinned OpenClaw build has fixed the behavior.
Related Issue
Refs #2603
Changes
test/openclaw-tui-chat-correlation.test.tswith shared analysis helpers for rapid A/B/C TUI/WebChat sends.chat finalevents for submittedchat.sendrun IDs, visible replies arriving under different run IDs, and duplicate user turns inchat.history.NEMOCLAW_ISSUE_2603_LIVE=1andNEMOCLAW_ISSUE_2603_SANDBOX=<name>that drives the same OpenClaw gateway WebSocket protocol used by the TUI.chat.sendrun IDs either stay attached to their visible replies or produce UI-safe queue status events instead of empty finals.messages.queue.byChannel.webchat = "queue") if it preserves expected chat semantics.OPENCLAW_VERSIONand run the opt-in live test as acceptance evidence.Type of Change
Verification
npx prek run --all-filespassesnpm testpassesmake docsbuilds without warnings (doc changes only)Signed-off-by: Carlos Villela [email protected]
Summary by CodeRabbit