fix(gateway): skip heartbeat diagnostics in session preview#66656
fix(gateway): skip heartbeat diagnostics in session preview#66656Tianworld wants to merge 2 commits intoopenclaw:mainfrom
Conversation
Greptile SummaryAdds a Confidence Score: 5/5
Prompt To Fix All With AIThis is a comment left during a code review.
Path: src/gateway/session-utils.fs.ts
Line: 382-384
Comment:
**Redundant `typeof` check and narrow filter scope**
The `typeof parsed?.type === "string"` guard is redundant — strict equality against a string literal already handles the type check. More importantly, other diagnostic types (e.g. `diagnostic.ping`, `diagnostic.status`) would still leak into the preview if they appear at the transcript tail. Widening to a prefix match makes this more resilient.
```suggestion
if (typeof parsed?.type === "string" && parsed.type.startsWith("diagnostic.")) {
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "fix(gateway): ignore heartbeat diagnosti..." | Re-trigger Greptile |
|
Related work from PRtags group Title: Open PR duplicate: [Bug]: WebChat session selector shows main session as “heartbeat” after a while, making /new fe…
|
|
Codex review: needs maintainer review before merge. What this changes: The branch filters Maintainer follow-up before merge: This is already a focused implementation PR with tests and changelog; there is no narrow automated repair to queue, so the next action is maintainer review and landing if checks are acceptable. Security review: Security review cleared: The diff only changes read-only transcript parsing, colocated tests, and a changelog entry; it does not touch CI, dependencies, scripts, secrets, permissions, package metadata, or downloaded code. Review detailsBest possible solution: Land this PR or an equivalent focused patch on main so the shared transcript-preview helper ignores the diagnostic namespace before deriving Do we have a high-confidence way to reproduce the issue? Yes. A transcript whose last JSONL row is Is this the best way to solve the issue? Yes. Filtering Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against a256745323ab. |
Skip diagnostic heartbeat transcript entries when deriving lastMessagePreview so session selectors don't get relabeled to 'heartbeat' over time. Fixes openclaw#66533 Made-with: Cursor
3b89b89 to
48b6bdd
Compare
|
ProjectClownfish pushed a narrow repair to this branch so the original contributor path can stay canonical. Source PR: #66656 |
Summary
Session selectors (notably Control UI / WebChat) can become misleading over time because the backend derives
lastMessagePreviewfrom transcript tail lines, and heartbeat diagnostic entries may become the most recent content.This change skips
type: "diagnostic.heartbeat"entries when scanning for the last user/assistant preview.Fixes #66533.
Test plan
pnpm exec vitest run src/gateway/session-utils.fs.test.ts