Summary
Instance routes currently fail when the instance name contains spaces or other percent-encoded characters in the URL path.
Example: an instance named Opencode Go appears in /api/instances, but direct instance routes return 404 when addressed as /api/instances/nullclaw/Opencode%20Go.
Reproduction
Observed against a local NullHub instance with a real instance named Opencode Go:
GET /api/instances/nullclaw/Opencode%20Go -> 404
DELETE /api/instances/nullclaw/Opencode%20Go -> 404
POST /api/instances/nullclaw/Opencode%20Go/stop -> 404
But /api/instances still lists Opencode Go under nullclaw.
Root Cause
src/api/instances.zig route parsing does not percent-decode the {name} path segment before state lookup.
So the backend looks up Opencode%20Go instead of Opencode Go.
This appears to affect all instance routes that rely on parsePath(...), not just delete.
Proposed Fix
Small follow-up PR:
- Add regression tests first for percent-encoded instance names.
- Decode path segments before instance lookup in
src/api/instances.zig.
- Cover at least delete and get routes, and confirm stop/restart if they share the same parser.
- Keep the fix tightly scoped; no broad routing refactor.
Validation
Expected validation once implemented:
zig build test --summary all
zig build
npm run build only if UI changes are needed
Scheduling Note
This should wait until PR #73 is merged, because PR #73 already changes src/api/instances.zig substantially for local standalone NullClaw import support.
Waiting avoids file conflicts and keeps this bug fix as a clean second PR.
Summary
Instance routes currently fail when the instance name contains spaces or other percent-encoded characters in the URL path.
Example: an instance named
Opencode Goappears in/api/instances, but direct instance routes return404when addressed as/api/instances/nullclaw/Opencode%20Go.Reproduction
Observed against a local NullHub instance with a real instance named
Opencode Go:GET /api/instances/nullclaw/Opencode%20Go->404DELETE /api/instances/nullclaw/Opencode%20Go->404POST /api/instances/nullclaw/Opencode%20Go/stop->404But
/api/instancesstill listsOpencode Goundernullclaw.Root Cause
src/api/instances.zigroute parsing does not percent-decode the{name}path segment before state lookup.So the backend looks up
Opencode%20Goinstead ofOpencode Go.This appears to affect all instance routes that rely on
parsePath(...), not just delete.Proposed Fix
Small follow-up PR:
src/api/instances.zig.Validation
Expected validation once implemented:
zig build test --summary allzig buildnpm run buildonly if UI changes are neededScheduling Note
This should wait until PR #73 is merged, because PR #73 already changes
src/api/instances.zigsubstantially for local standalone NullClaw import support.Waiting avoids file conflicts and keeps this bug fix as a clean second PR.