Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .agents/skills/yandex-360/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ semantics, a service ycli does not wrap yet), read the official docs directly, a
adding it. `--dry-run` prints the write request instead of sending it, the JSON result pipes
to `jq`, and the exit code says what failed (3 not found, 4 auth, 5 rate limited,
6 transient).
- **A long listing comes in pieces** — a list tool returns `{items, truncated, next}`; when
- **A long listing comes in pieces** — a list tool returns `{items, truncated, next}`, 50
items unless you give `limit` (a command gives 500); when
`truncated` is true, call it again with that `next`, its required arguments as they were
and nothing else but `limit` (the token carries its listing; an argument that differs from
it is refused by name). `all=true` returns everything at once and can overflow the context.
Expand Down
11 changes: 11 additions & 0 deletions .ast-grep/rule-tests/tool-takes-the-tool-cap-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
id: tool-takes-the-tool-cap
valid:
- |
cap = config.http.tool_cap(limit, all_=all)
- |
limit = config.http.tool_cap(limit)
invalid:
- |
cap = config.http.cap(limit, all_=all)
- |
return client.answers.list(survey_id, limit=config.http.cap(limit))
15 changes: 15 additions & 0 deletions .ast-grep/rules/tool-takes-the-tool-cap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
id: tool-takes-the-tool-cap
language: python
severity: error
message: A tool caps its listing with `config.http.tool_cap(...)`, not with the CLI's `cap(...)`.
note: |-
A tool's answer is read whole into a model's context, so a tool that is given no `limit`
gives `HTTPConfig.max_tool_items` (50), where a command gives `max_items` (500). The owner's
decision in #561 (2026-10-10), which changes #502 for the MCP server only.
url: https://github.com/bim-ba/ycli/issues/561
files:
- src/ycli/**/mcp.py
- src/ycli/**/mcp/**/*.py
rule:
pattern: $CONFIG.http.cap($$$ARGUMENTS)
fix: $CONFIG.http.tool_cap($$$ARGUMENTS)
3 changes: 2 additions & 1 deletion .claude/skills/yandex-360/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ semantics, a service ycli does not wrap yet), read the official docs directly, a
adding it. `--dry-run` prints the write request instead of sending it, the JSON result pipes
to `jq`, and the exit code says what failed (3 not found, 4 auth, 5 rate limited,
6 transient).
- **A long listing comes in pieces** — a list tool returns `{items, truncated, next}`; when
- **A long listing comes in pieces** — a list tool returns `{items, truncated, next}`, 50
items unless you give `limit` (a command gives 500); when
`truncated` is true, call it again with that `next`, its required arguments as they were
and nothing else but `limit` (the token carries its listing; an argument that differs from
it is refused by name). `all=true` returns everything at once and can overflow the context.
Expand Down
3 changes: 2 additions & 1 deletion .opencode/skills/yandex-360/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ semantics, a service ycli does not wrap yet), read the official docs directly, a
adding it. `--dry-run` prints the write request instead of sending it, the JSON result pipes
to `jq`, and the exit code says what failed (3 not found, 4 auth, 5 rate limited,
6 transient).
- **A long listing comes in pieces** — a list tool returns `{items, truncated, next}`; when
- **A long listing comes in pieces** — a list tool returns `{items, truncated, next}`, 50
items unless you give `limit` (a command gives 500); when
`truncated` is true, call it again with that `next`, its required arguments as they were
and nothing else but `limit` (the token carries its listing; an argument that differs from
it is refused by name). `all=true` returns everything at once and can overflow the context.
Expand Down
2 changes: 1 addition & 1 deletion docs/en/how-to/script-the-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ stopped at 100 of 752; go on with: ycli tracker issues search 'Queue: DE' --next
$ ycli tracker issues search 'Queue: DE' --limit 100 --next eyJ2IjoxLCJvZiI6… > second.json
```

A token carries its listing: with `--next`, give nothing but the limit and what the command cannot be called without, and that as it was: an argument that differs from the token's is refused by its name, never passed over. A token of a Tracker issue search by a scroll (`--scroll-type`) works once; any other token works again. A listing that can no longer go on exits with `9`: start it again without the token. A run that asks more pages than `YCLI__HTTP__MAX_PAGES` stops there and says so the same way, with a token to go on from.
A token carries its listing: with `--next`, give nothing but the limit and what the command cannot be called without, and that as it was: an argument that differs from the token's is refused by its name, never passed over. A token of a Tracker issue search by a scroll (`--scroll-type`) works once; any other token works again. A listing that can no longer go on exits with `9`: start it again without the token. A run that asks more pages than `YCLI__HTTP__MAX_PAGES` stops there and says so the same way, with a token to go on from. A small first `--limit` sets the size of the pages for every piece after it, so take the first piece as large as the ones you mean to go on with.

## Delete without a prompt

Expand Down
3 changes: 2 additions & 1 deletion docs/en/reference/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ Optional settings follow the `YCLI__<GROUP>__<SETTING>` pattern. An empty one co
|---|---|---|
| `YCLI__HTTP__TIMEOUT_SECONDS` | `30` | per-request timeout, seconds (> 0) |
| `YCLI__HTTP__RETRIES` | `3` | retries of an idempotent request after a 429 or a 5xx (≥ 0) |
| `YCLI__HTTP__MAX_ITEMS` | `500` | item cap of a listing without `--limit` or `--all` (> 0) |
| `YCLI__HTTP__MAX_ITEMS` | `500` | item cap of a listing command without `--limit` or `--all` (> 0) |
| `YCLI__HTTP__MAX_TOOL_ITEMS` | `50` | item cap of a listing tool of the MCP server without `limit` or `all`: its answer is read whole into a model's context (> 0) |
| `YCLI__HTTP__MAX_PAGES` | `1000` | page cap of one listing: a listing that never ends stops here with a warning (> 0) |
| `YCLI__HTTP__MAX_TOKEN_LENGTH` | `16384` | the longest `next` token read: a longer one is refused before it is decoded (> 0) |
| `YCLI__HTTP__MAX_RETRY_AFTER_SECONDS` | `60` | longest pause a 429 may ask for in `Retry-After`; a longer one fails at once (> 0) |
Expand Down
Loading
Loading