Skip to content

fix: validate --page-size to prevent panic on negative values#410

Open
Bortlesboat wants to merge 1 commit intoagentregistry-dev:mainfrom
Bortlesboat:fix-negative-page-size
Open

fix: validate --page-size to prevent panic on negative values#410
Bortlesboat wants to merge 1 commit intoagentregistry-dev:mainfrom
Bortlesboat:fix-negative-page-size

Conversation

@Bortlesboat
Copy link
Copy Markdown

Fixes #368

Summary

arctl skill list --page-size -1 causes a panic due to slice bounds out of range when the negative pageSize produces a negative end index in displayPaginatedSkills.

Fix

Add validation at the start of runList to reject non-positive values with a clear error message:

Error: --page-size must be a positive integer, got -1

Test plan

  • arctl skill list --page-size -1 returns error instead of panic
  • arctl skill list --page-size 0 returns error
  • arctl skill list --page-size 5 works normally
  • arctl skill list (default 15) works normally

Fixes agentregistry-dev#368

arctl skill list --page-size -1 causes a panic due to slice bounds
out of range when the negative pageSize produces a negative end index
at line 75.

Add validation at the start of runList to reject non-positive values
with a clear error message instead of panicking.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Panic when arctl skill list --page-size CLI flag has a negative value

1 participant