fix(sessions): hide onboard warm-up session from list and export#5533
fix(sessions): hide onboard warm-up session from list and export#5533rluo8 wants to merge 3 commits into
Conversation
Signed-off-by: Rui Luo <ruluo@nvidia.com>
|
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 (10)
📝 WalkthroughWalkthroughA new ChangesWarmup Session Filtering
Sequence Diagram(s)sequenceDiagram
participant User as User CLI
participant runSessionsPassthrough
participant captureOpenshell
participant filterWarmupSessionsListJson
participant filterWarmupSessionsListText
User->>runSessionsPassthrough: nemoclaw <name> sessions list [--json]
runSessionsPassthrough->>captureOpenshell: sandbox exec openclaw sessions list
captureOpenshell-->>runSessionsPassthrough: { output, stdout, stderr, exitCode }
alt exitCode != 0
runSessionsPassthrough-->>User: write stderr, process.exit(exitCode)
else --json mode
runSessionsPassthrough->>filterWarmupSessionsListJson: filter(output)
filterWarmupSessionsListJson-->>runSessionsPassthrough: filtered JSON | null
alt null and WARMUP_SESSION_ID_PREFIX in raw output
runSessionsPassthrough-->>User: parse error + process.exit(1)
else
runSessionsPassthrough-->>User: write filtered (or raw) JSON
end
else text mode
runSessionsPassthrough->>filterWarmupSessionsListText: filter(output)
filterWarmupSessionsListText-->>runSessionsPassthrough: text with warmup rows removed
runSessionsPassthrough-->>User: write filtered text
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 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 unit tests (beta)
Comment |
Summary
nemoclaw onboardruns a throwaway scope-upgrade warm-up that persists an internalnemoclaw-onboard-warmup-*session. On a freshly-onboarded sandbox that session is the only entry, sonemoclaw <name> sessions listreported 1 conversation andsessions exportbundled a"ping"the user never sent. This filters that internal session out of the NemoClaw user-facing surfaces —sessions list,sessions list --json, andsessions export.Related Issue
Fixes #5511
Changes
src/lib/actions/sandbox/warmup-session.ts(new): single source of truth —WARMUP_SESSION_ID_PREFIX+isWarmupSessionId.src/lib/actions/sandbox/sessions/passthrough.ts: capturesessions listand filter internal warm-up sessions from both human-table output (filterWarmupSessionsListText, anchored on theid:field) and--json(filterWarmupSessionsListJson, tolerant balanced-JSON parse reusingparseSessionIndex; fails closed — errors rather than emitting unfiltered output if it can't parse but a warm-up id is present). stdout is filtered; OpenClaw's stderr is preserved on its own stream.src/lib/actions/sandbox/sessions/export.ts: exclude warm-up sessions from "export all" (explicit--keysstill honored); hardenparseSessionIndexwith balanced-JSON extraction for multi-line payloads.src/lib/adapters/openshell/client.ts+runtime.ts: opt-inincludeStreamsoption exposing separatestdout/stderron the capture result (additive, backward-compatible).src/lib/actions/sandbox/auto-pair-warmup.ts: reference the shared prefix in--session-idonly — no change to warm-up timing/behavior.passthrough.test.ts(new),client.test.ts(new), and updates toexport.test.ts/auto-pair-warmup.test.ts.Type of Change
Verification
Verifiedin GitHubnpx prek run --from-ref main --to-ref HEADpassesnpm testpasses (broad runtime changes only)npm run docsbuilds without warnings (doc changes only)Signed-off-by: rluo8 ruluo@nvidia.com
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Tests