Skip to main content
← Back to list
01Issue
BugShippedSwamp CLIPublic
AssigneesNone

Relationships

↔ sibling #3576

#3577 [nit] swamp issue search: invalid --type/--status/--limit reach the API instead of being rejected locally

Opened by gklijs · 10/17/2026· Shipped 10/19/2026

Severity: nit (DX only). No incorrect state — the requests are rejected server-side — but invalid input reaches the API for round-trips the CLI can catch locally, and the resulting errors are raw server strings.

Environment

* swamp 20261014.121640.0-sha.c5d1db96
* Linux (WSL2), bash

Problem

swamp issue search enumerates the valid values for --type and --status in its own option help, yet forwards any value to the Lab, which answers with an HTTP 400:

$ swamp issue search --type bogus
Error: Failed to search issues (HTTP 400): {"error":"Invalid type filter"}

$ swamp issue search --status bogus
Error: Failed to search issues (HTTP 400): {"error":"Invalid status filter"}

$ swamp issue search --limit 0
Error: Failed to search issues (HTTP 400): {"error":"Invalid limit"}

Source: src/cli/commands/issue_search.ts:45-54 accepts --type/--status/--limit without validation, and lines 93-99 pass options.type, options.status, options.limit straight through. --limit <limit:integer> also accepts 0 and negative values.

By contrast, sibling subcommands validate locally:

* `swamp issue get 0` -> `Issue number must be a positive integer.` (`src/cli/commands/issue_get.ts`)
* `swamp issue edit` checks `VALID_ISSUE_TYPES` and reports `Invalid issue type "x". Must be one of: ...` (`src/cli/commands/issue_edit.ts:156-165`)

Expected

Reject invalid --type/--status/--limit before issuing the request, using the same message style as issue_edit ("Must be one of: ..."), and constrain the option in Cliffy (enum for --type/--status, a positive range for --limit).

Same class of missing local validation

swamp data list <behavior> --type bogus silently prints an empty list instead of rejecting the value, even though the help enumerates the valid set (log, file, resource, data).

Reproduction

swamp issue search --type bogus
swamp issue search --status bogus
swamp issue search --limit 0
swamp data list <behavior> --type bogus
02Bog Flow
✓OPEN✓TRIAGED✓IN PROGRESS✓SHIPPEDLINKED+ 4 MOREPR_MERGED+ 2 MORESESSION_SUMMARIZED

Shipped

10/19/2026, 1:50:35 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 linked sibling of #357610/19/2026, 1:16:38 PM
Editable. Press Enter to edit.

stack72 commented 10/19/2026, 1:50:39 PM

Thanks @gklijs for reporting this! The fix has been merged and a release is on its way. We appreciate your contribution to swamp.

Sign in to post a ripple.