Skip to content

skillserver versions <name> crashes (unhandled 404) instead of a clean not-found #142

Description

@Aaronontheweb

Summary

skillserver versions <name> for a skill that isn't on the server crashes with an unhandled exception (Aborted (core dumped), exit code 134) instead of printing a clean "not found" and exiting 1. The server returns 404, and VersionsCommand doesn't handle it.

Sibling read commands (verify, download-subagent) already catch the 404 and exit 1 gracefully — versions is the outlier.

Repro

Against any running skill server, query a skill that doesn't exist:

skillserver versions no-such-skill
echo "exit=$?"

Observed

Unhandled exception. System.Net.Http.HttpRequestException: Response status code does not indicate success: 404 (Not Found).
   at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
   at System.Net.Http.Json.HttpClientJsonExtensions.<FromJsonAsyncCore>...
   at Netclaw.SkillClient.SkillServerClient.GetSkillVersionsAsync(String name, CancellationToken ct) in src/Netclaw.SkillClient/SkillServerClient.cs:line 87
   at Netclaw.SkillServer.Cli.Commands.VersionsCommand.ExecuteAsync(ParsedArgs args, SkillServerClient client) in src/Netclaw.SkillServer.Cli/Commands/VersionsCommand.cs:line 25
   at Program.<<Main>$>g__DispatchAsync|0_0(...) in src/Netclaw.SkillServer.Cli/Program.cs:line 87

exit=134 (SIGABRT).

Root cause

VersionsCommand.ExecuteAsync (src/Netclaw.SkillServer.Cli/Commands/VersionsCommand.cs:25) calls client.GetSkillVersionsAsync(name), which uses GetFromJsonAsync (src/Netclaw.SkillClient/SkillServerClient.cs:87). GetFromJsonAsync throws HttpRequestException on a 404, and nothing catches it, so the process aborts.

By contrast, VerifyCommand and DownloadSubAgentCommand catch the same 404 and print Error: ... + exit 1.

Expected

A missing skill should print a clean message and exit 1, consistent with the other read commands — e.g.:

Skill 'no-such-skill' not found.

(An explicit "not found" message reads better than the raw Response status code does not indicate success: 404 text those other commands currently surface, so consider that phrasing for the fix.)

Scope

Confirmed on an empty 0.4.0 server:

Command (missing resource) Result
versions <missing> crash, exit 134
verify <not-on-server> graceful, exit 1
download-subagent <missing> <ver> graceful, exit 1
list / list-subagents (empty) exit 0

Only versions is affected. Fix can live in VersionsCommand (catch the 404) or in the client (map 404 → empty list / typed not-found); either is fine as long as versions <missing> exits 1 with a readable message and no stack trace.

Environment

  • Image: ghcr.io/netclaw-dev/skillserver:0.4.0
  • CLI: skillserver 0.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcliIssues pertaining to the `skillserver` command line interface (CLI)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions