fix: resume unknown slash command emits unknown_slash_command error_kind (#827)#3201
Merged
Merged
Conversation
Both direct-slash CLI path (claw /boguscommand) and resume slash path (claw --resume session /boguscommand) previously emitted error_kind:unknown (opaque fallback). Machine consumers could not distinguish unrecognized slash commands from other error classes. Fix: - format_unknown_direct_slash_command: prefix with 'unknown_slash_command:' - format_unknown_slash_command (resume path): prefix with 'unknown_slash_command:' - Add classifier arm for 'unknown_slash_command:' prefix One new regression test: direct_unknown_slash_command_emits_typed_error_kind Uses the direct-slash CLI path (no session load needed; reproducible on CI). 572 tests pass, 1 pre-existing worker_boot failure unrelated.
ee5e112 to
74b0378
Compare
|
Clean fix. The prefix-based classifier arm is a minimal, targeted approach and the regression test covers the exact case well. |
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.
Fixes ROADMAP #827.
Before:
claw --resume latest --output-format json /bogus→error_kind:"unknown"(opaque)After:
claw --resume latest --output-format json /bogus→error_kind:"unknown_slash_command"(typed)Root cause:
format_unknown_slash_command()emitted a message without a classifier-friendly prefix, soclassify_error_kindfell through to the generic"unknown"fallback.Fix: Prefix message with
unknown_slash_command:and add classifier arm.Tests: 1 new regression test, 572 pass.