Skip to content

Return client errors for invalid process and file paths - #469

Open
chruffins wants to merge 2 commits into
mainfrom
hypeship/fix-process-file-api-errors
Open

chruffins wants to merge 2 commits into
mainfrom
hypeship/fix-process-file-api-errors

Conversation

@chruffins

@chruffins chruffins commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Accept unknown process IDs as strings so missing IDs reach handlers and return 404.
  • Return 400 when GET /fs/list_files is given a file path.
  • Add regression coverage for both cases.

Tests

  • cd server && go test -race $(go list ./... | grep -v /e2e$) (the first run exposed the repository-generated SSE patch step was missing; after applying it, target suites passed)
  • cd server && go test -race ./lib/oapi ./cmd/api/api
  • cd server && go vet ./...

Note

Medium Risk
OpenAPI breaking change for process path parameters (string without UUID validation) may affect API clients; process lookup behavior changes for malformed IDs but is limited to process management endpoints.

Overview
Process routes now treat process_id as a plain string in the OpenAPI spec and generated bindings (UUID format validation removed for status, stdout stream, stdin, and kill). Handlers look up IDs directly in the process map, so arbitrary unknown IDs (e.g. no-such-id) reach application logic and return 404 instead of failing at path parsing. Tests were updated accordingly, including broader 404 coverage for stdin and kill.

Filesystem listing maps syscall.ENOTDIR from os.ReadDir to 400 with "path is not a directory" when ListFiles is called on a file path, with a regression test in fs_test.go.

Reviewed by Cursor Bugbot for commit 6382bc4. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6382bc4. Configure here.

Comment thread server/openapi.yaml
@chruffins
chruffins marked this pull request as ready for review October 15, 2026 21:14
@chruffins
chruffins requested a review from hiroTamada October 15, 2026 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant