jev-skill-suggestion: catalogues over 255 skills get HTTP 400 from TypeSafe on every prompt (choice limit)

Author: pitopsCreated Sep 22, 2026Updated Sep 22, 2026

The jev-skill-suggestion mod sends every candidate skill as one option of a single choice in the first request (wideQuestions in hooks/policy.ts), with no upper bound on how many. TypeSafe's /v1/systemone rejects a choice with more than 255 options, so on a larger catalogue every ranking request fails and the mod never suggests anything.

What happens

With 311 candidates from $.command.list() (Claude Code 2.1.280, provider: "typesafe", jev-latest), every prompt logs:

$.http.fetch (jev-skill-suggestion): 400 in 1032ms, 61 chars
[jev-skill-suggestion] typesafe responded 400 to the ranking
[jev-skill-suggestion] jev: no answer from 311 candidates · 1037ms
[jev-skill-suggestion] no suggestion: no answer

The response body, which the mod does not log, is:

json
{"detail":"Too many choices. Must have at most 255 choices."}

It fails open, as designed, so nothing breaks, but the result is worse than not having the mod installed. With the default hideListing: true the skill listing is withheld from the model, and no suggestion ever replaces it, so the model sees no skills at all.

Reproduce against the API directly

A choice with N synthetic criteria, nothing else in the request:

options result
5, 100, 128 200
255 200 (~10.6k input tokens, ~0.94 s)
256, 257, 311 400 Too many choices. Must have at most 255 choices.

How a catalogue gets there

It doesn't take an unusual setup. $.command.list() counts plugin commands as well as skills, and a handful of popular plugins is enough: here one plugin alone contributed 117 commands and skills, and the rest came from marketing, SEO, Vercel, Stripe and superpowers plugins plus user skills. #962 mentions a 452-skill catalogue, which would hit the same limit on this backend.

Workaround

Listing one large plugin's commands and skills in neverSuggested brings it under the limit (311 → 194 here), after which the mod works as described: gate, rerank and injection all behave. That option takes exact names only, so it needed all 117 names spelled out.

Possible fixes, no strong view on which:

  • Cap the first request's choice at 255, dropping the rest by some cheap pre-filter.
  • Split the catalogue into chunks of at most 255, rank each, and take the best of each chunk into the rerank. The rerank already re-reads a shortlist, so this fits its shape; the cost is one request per chunk.
  • At minimum, log the response body on a non-2xx. typesafe responded 400 to the ranking alone does not say why, and the reason is in the body.

A smaller, related papercut: neverSuggested accepting a prefix or glob (octo:*) would make the workaround one entry instead of 117.

I haven't checked whether the Vercel AI Gateway backend has the same limit.

Related: #962 (the rerank timeout on large catalogues).

Source: davila7/claude-code-templates