fix(cli): handle 404 in versions command instead of crashing#143
Merged
Aaronontheweb merged 3 commits intoJul 22, 2026
Conversation
skillserver versions <name> for a skill that isn't on the server crashed with an unhandled HttpRequestException on the 404 (Aborted, exit 134). GetSkillVersionsAsync uses GetFromJsonAsync, which throws on a non-success status, and VersionsCommand had no catch around it. Catch the 404 in VersionsCommand and print a clean "Skill '<name>' not found." message, exiting 1 -- consistent with how VerifyCommand and DownloadSubAgentCommand already handle a missing resource. Other HttpRequestExceptions fall through to ConsoleOutput.HandleHttpError. The fix is scoped to the versions path; the client is unchanged, so verify and download-subagent are unaffected. Closes netclaw-dev#142
Aaronontheweb
enabled auto-merge (squash)
July 22, 2026 02:14
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.
Root cause
skillserver versions <name>for a skill that isn't on the server crashed with an unhandledHttpRequestExceptionon the server's 404 (Aborted (core dumped), exit134), dumping a stack trace.VersionsCommand.ExecuteAsynccallsclient.GetSkillVersionsAsync(name), which usesGetFromJsonAsync. That helper callsEnsureSuccessStatusCode()internally and throwsHttpRequestExceptionon a 404. Nothing caught it, so the process aborted. Sibling read commands (verify,download-subagent) already wrap their calls in atry/catch (HttpRequestException);versionswas the outlier.Fix
Catch
HttpRequestExceptioninVersionsCommand, matching the sibling pattern:Skill '<name>' not found.and exits1.HttpRequestExceptionfalls through toConsoleOutput.HandleHttpError, exiting1.The fix is scoped to the
versionspath.SkillServerClientis unchanged, soverifyanddownload-subagentare unaffected.Added
VersionsCommandTestswith two cases using the existing mock-HttpMessageHandlerpattern: a 404 returns1without throwing (regression test for this bug), and a successful response returns0and lists versions.Verification
Built the CLI from this branch and ran it against a real
ghcr.io/netclaw-dev/skillserver:0.4.0server.Missing skill — now exits
1with a readable message, no stack trace / no core dump:Existing skill — still lists versions correctly (exit
0):Sibling commands still behave (exit
1, no crash) — client untouched, no regression:dotnet build(Release): 0 warnings, 0 errors.dotnet test(CLI test project): 114 passed, 0 failed.Closes #142