feat: add bundled skill and /lossless diagnostics#243
Merged
Conversation
Add the approved MVP operator surface for lossless-claw. This ships a bundled lossless-claw skill with focused references, registers a native /lcm command with /lossless as the alias, and exposes scan-only summary health diagnostics through /lcm doctor. It also updates package metadata so the skill is bundled and adds a changeset for the new user-facing surface. Regeneration-Prompt: |\n Implement the approved lossless-claw MVP operator surface inside the plugin package without depending on the Go TUI binary. Add a concrete plan doc first, then ship a bundled skill named lossless-claw with references covering configuration, architecture, diagnostics, and recall-tool usage. Register native plugin commands centered on /lcm with /lossless as the alias. Keep the command surface narrow: /lcm should report version, enabled and selected state, DB path and file size, summary counts, a defensible summarized-context metric, and whether broken or truncated summaries are present. /lcm doctor should be the only user-facing summary-health diagnostic entrypoint in MVP and should stay scan-only instead of exposing advanced repair or rewrite operations. Keep changes scoped, add tests for manifest metadata, registration, and command behavior, and update README plus release metadata for the new bundled skill and command surface.
Keep /lossless as the surfaced native command while documenting /lcm as the hidden alias. Rework status and doctor output into compact section cards, split GLOBAL vs CURRENT CONVERSATION reporting, and fall back cleanly when the host does not expose session identity. Add focused tests for the fallback path and the forward-compatible session-key path. Regeneration-Prompt: | Refine the lossless-claw command polish only. Keep `/lossless` as the visible native command and `/lcm` as an accepted hidden alias. Add built-in command docs that point users to `/lossless help`, reformat status and doctor output into compact emoji section cards, and split GLOBAL stats from CURRENT CONVERSATION stats. Investigate whether the plugin command handler can resolve the active LCM conversation from host-provided session identity; support hidden `sessionKey` or `sessionId` fields if they appear, but when the current OpenClaw command API does not expose them, show the nicest possible fallback explaining that only GLOBAL stats are available. Update targeted tests for the new help text, status layout, host-gap fallback, and forward-compatible session-key resolution.
Resolve the current LCM conversation from ctx.sessionKey first, with ctx.sessionId as a compatibility fallback when the active key is not stored yet. Keep mismatched session-id fallbacks unavailable so the status card does not show the wrong conversation, and add focused command tests for direct resolution, fallback, and mismatch handling. Regeneration-Prompt: | Update the /lossless slash command status output so the CURRENT CONVERSATION section reflects the active LCM conversation for the OpenClaw plugin-command session. The host now passes PluginCommandContext.sessionKey and sessionId. Treat the active session key as authoritative, keep /lossless as the visible command and /lcm as the hidden alias, preserve the existing emoji/status-card formatting and lightweight help text, and fall back gracefully with explicit messaging when the current conversation cannot be resolved. If the active session key is not stored in the conversations table yet, use the active session id only as a compatibility fallback so older rows without session_key can still show current-conversation stats. Refuse that fallback when it points at a conversation already bound to a different stored session key, because that would show the wrong conversation. Add focused tests that cover direct session-key resolution, the session-id compatibility fallback, and the mismatch case, then verify the command tests and full suite still pass.
Tighten the /lossless status presentation without changing current-conversation resolution. Switch the card to compact label:value lines, rename the header alias copy, move section titles to title case, and remove session id from the visible current-conversation block while keeping session-key resolution and session-id fallback behavior intact. Regeneration-Prompt: | Polish the /lossless status output on top of the existing session-key resolution work. Keep /lossless as the visible slash command and /lcm as the alias, preserve the active-session-key current-conversation behavior, and do not reintroduce the old binding-based resolution path. Adjust the card so it reads well in chat screenshots: avoid all-caps section headers, tighten spacing so it feels like a compact status card instead of debug output, change the header copy from Hidden alias to Alias, and remove current conversation session id from the displayed fields while keeping session key. Update the focused command tests to match the new formatting and verify both the command test file and the full test suite still pass.
Make /lossless doctor resolve the active LCM conversation using the same session-key/session-id logic as status and refuse to run a global scan when the current conversation cannot be resolved. Keep /lossless visible, preserve /lcm as the alias, and add focused tests for scoped issue, scoped clean, and unavailable behavior. Regeneration-Prompt: | Josh changed the MVP requirement for `/lossless doctor`: it must only diagnose the current LCM conversation from the plugin command context, using the same session-key/session-id resolution path already used by status. If the current conversation cannot be resolved, return an explicit unavailable message and say that no global scan ran. Keep `/lossless` as the visible command, preserve `/lcm` as alias, retain the compact text format, and add focused tests covering a resolved conversation with local issues, a resolved clean conversation, and unresolved context with no global fallback.
Implement a native TypeScript repair path for /lossless doctor apply. Keep doctor scoped to the resolved current conversation only. Leave /lossless doctor as a read-only scan, and add /lossless doctor apply to rewrite detected broken summaries in place using the plugin's existing summarization runtime instead of the Go TUI bridge. Preserve the compact status-card output, return an explicit unavailable message when the current conversation cannot be resolved, and cover clean no-op, successful scoped repair, and unresolved no-global-fallback behavior in focused command tests. Regeneration-Prompt: | Add a native TypeScript implementation for inside the lossless-claw plugin. Keep as a read-only scan and never broaden either command beyond the current conversation exposed by the host session identity. Reuse the existing broken-summary marker detection, order repairs bottom-up so condensed nodes can consume freshly repaired child summaries, and rewrite repaired summaries in place in SQLite. Use the plugin's own summarization/runtime facilities instead of calling into the Go TUI. Preserve the compact status-card command output, and if the active conversation cannot be resolved, return an explicit unavailable response without attempting any global scan or repair. Add focused tests for a clean no-op apply, a scoped repair that actually mutates summaries, and the unresolved case proving there is no global fallback.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
lossless-clawskill discoverable from the plugin manifest/losslesscommand surface with/lcmalias and scoped diagnostics/repair flows/new//resetsession lifecycle behaviorWhat changed
Validation
pnpm test -- test/lcm-command.test.ts test/plugin-config-registration.test.ts test/config.test.tsNotes
.changeset/short-rivers-wave.md