refactor(gateway): remove unused readLastMessagePreviewFromTranscript helper#84427
Conversation
|
Codex review: needs maintainer review before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: not applicable. this is a cleanup PR, not a bug report. The source check is high-confidence because the helper has no live call sites outside its export and direct tests on current main. PR rating Rank-up moves:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. Real behavior proof Next step before merge Security Review detailsBest possible solution: Land the bounded deletion after normal CI and maintainer review, keeping the active Do we have a high-confidence way to reproduce the issue? Not applicable: this is a cleanup PR, not a bug report. The source check is high-confidence because the helper has no live call sites outside its export and direct tests on current main. Is this the best way to solve the issue? Yes: deleting the unused wrapper and barrel export is the narrow maintainable cleanup while preserving the cached Label changes:
Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 9eee202a694b. |
There was a problem hiding this comment.
Pull request overview
Removes the unused readLastMessagePreviewFromTranscript helper from the gateway session utilities, along with its barrel export and dedicated unit tests, consolidating transcript preview reads around the existing readSessionTitleFieldsFromTranscript (sync/async) pathways.
Changes:
- Deleted
readLastMessagePreviewFromTranscriptfromsrc/gateway/session-utils.fs.ts. - Removed the corresponding re-export from
src/gateway/session-utils.ts. - Removed unit tests and remaining references to the deleted helper from
src/gateway/session-utils.fs.test.ts.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/gateway/session-utils.ts | Drops the re-export of the removed helper to prevent downstream usage. |
| src/gateway/session-utils.fs.ts | Removes the now-unused wrapper function while keeping internal tail-preview helpers used elsewhere. |
| src/gateway/session-utils.fs.test.ts | Deletes tests that only validated the removed helper and trims shared-behavior assertions accordingly. |
|
ClawSweeper PR egg ✨ Hatched: 💎 rare Cosmic Branchling Hatch commandComment Hatchability rules:
Rarity: 💎 rare. What is this egg doing here?
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
82c5874 to
7f89a3e
Compare
7f89a3e to
86bce72
Compare
86bce72 to
257aab2
Compare
|
Merged via squash.
Thanks @medns! |
… helper (openclaw#84427) Merged via squash. Prepared head SHA: 257aab2 Co-authored-by: medns <[email protected]> Co-authored-by: odysseus0 <[email protected]> Reviewed-by: @odysseus0
… helper (openclaw#84427) Merged via squash. Prepared head SHA: 257aab2 Co-authored-by: medns <[email protected]> Co-authored-by: odysseus0 <[email protected]> Reviewed-by: @odysseus0
… helper (openclaw#84427) Merged via squash. Prepared head SHA: 257aab2 Co-authored-by: medns <[email protected]> Co-authored-by: odysseus0 <[email protected]> Reviewed-by: @odysseus0
… helper (openclaw#84427) Merged via squash. Prepared head SHA: 257aab2 Co-authored-by: medns <[email protected]> Co-authored-by: odysseus0 <[email protected]> Reviewed-by: @odysseus0
… helper (openclaw#84427) Merged via squash. Prepared head SHA: 257aab2 Co-authored-by: medns <[email protected]> Co-authored-by: odysseus0 <[email protected]> Reviewed-by: @odysseus0
… helper (openclaw#84427) Merged via squash. Prepared head SHA: 257aab2 Co-authored-by: medns <[email protected]> Co-authored-by: odysseus0 <[email protected]> Reviewed-by: @odysseus0
… helper (openclaw#84427) Merged via squash. Prepared head SHA: 257aab2 Co-authored-by: medns <[email protected]> Co-authored-by: odysseus0 <[email protected]> Reviewed-by: @odysseus0
… helper (openclaw#84427) Merged via squash. Prepared head SHA: 257aab2 Co-authored-by: medns <[email protected]> Co-authored-by: odysseus0 <[email protected]> Reviewed-by: @odysseus0
… helper (openclaw#84427) Merged via squash. Prepared head SHA: 257aab2 Co-authored-by: medns <[email protected]> Co-authored-by: odysseus0 <[email protected]> Reviewed-by: @odysseus0
… helper (openclaw#84427) Merged via squash. Prepared head SHA: 257aab2 Co-authored-by: medns <[email protected]> Co-authored-by: odysseus0 <[email protected]> Reviewed-by: @odysseus0
… helper (openclaw#84427) Merged via squash. Prepared head SHA: 257aab2 Co-authored-by: medns <[email protected]> Co-authored-by: odysseus0 <[email protected]> Reviewed-by: @odysseus0
Summary
readLastMessagePreviewFromTranscriptinsrc/gateway/session-utils.fs.ts(re-exported insrc/gateway/session-utils.ts) was unused throughout the gateway codebase. Other files use the more efficient, cachedreadSessionTitleFieldsFromTranscript(or its async version) to retrieve previews.readLastMessagePreviewFromTranscriptand its export.readLastMessagePreviewFromTranscriptimplementation insrc/gateway/session-utils.fs.ts.readLastMessagePreviewFromTranscriptinsrc/gateway/session-utils.ts.readLastMessagePreviewFromTranscriptfromsrc/gateway/session-utils.fs.test.ts.readLastMessagePreviewFromOpenTranscriptremain unchanged as they are still utilized by other session-utils helpers.Motivation
Explain why this change should exist now. Link it to the user pain, failure mode, maintainer need, or product goal. If this is purely mechanical, write
N/A.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Real behavior proof (required for external PRs)
Behavior or issue addressed: Dead/unused
readLastMessagePreviewFromTranscripthelper function inside session-utils.Real environment tested: Local development environment running Node.js 22.22.0 on Windows 10 Pro with pnpm workspaces.
Exact steps or command run after this patch:
pnpm test src/gateway/session-utils.fs.test.ts --runpnpm openclaw statusEvidence after fix (screenshot, recording, terminal capture, console output, redacted runtime log, linked artifact, or copied live output):
pnpm openclaw statuscommand successfully queries the status and outputs without any module or export resolution crashes:Observed result after fix: The
pnpm openclaw statuscommand successfully compiled and returned the correct state of the repository under thecleanup/unused-read-last-message-previewbranch. The test suite completed successfully and verified all 72 remaining test cases pass without references to the deleted helper.What was not tested: None.
Root Cause (if applicable)
Regression Test Plan (if applicable)
src/gateway/session-utils.fs.test.tssession-utils.fs.test.tscover these cases.User-visible / Behavior Changes
None.
Diagram (if applicable)
N/A
Security Impact (required)
No)No)No)No)No)Repro + Verification
Environment
Steps
pnpm test src/gateway/session-utils.fs.test.ts --runExpected
Actual
Evidence
Attach at least one:
Human Verification (required)
readLastMessagePreviewFromTranscriptis not referenced anywhere else in core packages or the plugin-sdk.Review Conversations
Compatibility / Migration
Yes)No)No)Risks and Mitigations
None.