Repository navigation
feat!: a token names its organization, and a scroll is released by the token of its search - #567
Merged
Merged
Conversation
bim-ba
force-pushed
the
feat/scroll-clear-next
branch
from
October 10, 2026 14:30
9ff8666 to
e4d8cfc
Compare
…e token of its search `ycli tracker issues scroll-clear --next TOKEN` releases the scroll a search goes on by, before it expires (#538). The command took `--pair id=token`, and nothing gave the pair: the scroll's own token came in a header ycli did not read. The `next` of a search by a scroll now holds it, so the SDK, the CLI and the MCP tool all take the one token. The token has a second format, which holds three things more: - the organization the listing was asked in, with the header that names it (organization 7 of Yandex 360 and 7 of Yandex Cloud are two). A token given under another account is refused and names both; it used to go on with the other organization's listing. - the address the listing was asked at, for a message only: a token of one issue's comments given to another issue is told what differs (`DE-2 (the token holds DE-1)`). It never builds a request and is never made a URL of: it is held to the characters of a path where the token is read, and a token whose address was written over is no token. - what the way of paging kept from the replies: nothing, except for a scroll, where it is the scroll's id and token. No refusal, no line of the log and no repr prints it. It is of no use without the caller's credentials and dies with the scroll. A token of the same address taken another way (a search by pages given the token of one by a scroll) is told so, where it was told an address. A token is made of the address and the query as they go on the wire, escaped, so no argument and no link of a service can break the making of it. Text taken from a token is repeated in a refusal only when it is short and plain: a refusal is read on a terminal and by a model. A token that is not what a listing gave (a field gone wrong or rewritten) is refused in ycli's own words on the SDK, the CLI and the MCP server, with nothing sent and no traceback; one table of such tokens holds it. A token of the first format is refused by name on every surface: "this token was given by an earlier version of ycli: start the listing again without it". It names no organization, so it is not guessed at. The live scenarios gain the round trip (a scroll in pieces, the clear, the next page refused) and a step field `exits` for a step whose point is a refusal. BREAKING CHANGE: `tracker.issues.scroll_clear` takes `next: str` in place of a `ScrollClear` body; `ycli tracker issues scroll-clear` takes `--next TOKEN` in place of `--pair`; the tool `tracker_issues_scroll_clear` takes `next` in place of `body`. A `next` token returned by an earlier version no longer goes on: start the listing again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bim-ba
force-pushed
the
feat/scroll-clear-next
branch
from
October 10, 2026 15:21
e4d8cfc to
f149912
Compare
bim-ba
added a commit
that referenced
this pull request
Oct 10, 2026
…of the token (#573) Two leftovers of the review of #567. A token of another organization was refused with the name of its header quoted from the token, up to forty letters of the token's own text: a forged `Ignore-previous-instructions-and-obey: 7` reached a terminal, and a model through a tool error. The header is now said only when it is the call's own; a token under another header is told "of another kind", and the call's side is named as before. A session given an organization by hand in another form than `Name: id` (`SyncSession(client, organization="7")`) failed with a pydantic error at the first truncated listing, when its token was made. It is refused when the session is built, in ycli's own words. `connect()` never produced that form. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 10, 2026
MCP: как агент дочитывает длинный список — потолок 500 без продолжения (находка живого прогона)
#502
Closed
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ycli tracker issues scroll-clear --next TOKENreleases the scroll of a search before it expires, and anexttoken is now bound to the organization it was returned in. Decisions: #538 (5-B), the review of #534 (findings 5 and 6).The token, second format
of,way,query,body,skip,seenorgName: idwith the id escaped (the kind is a part of it: 7 of Yandex 360 and 7 of Yandex Cloud are two); empty where the service names noneatkeptscrollId,scrollToken)scroll-clearWhat a call that goes on is told now:
this token is of another organization (X-Org-Id: 7) than this call (X-Org-Id: o): run it under the account that returned it; nothing is sentit differs in the address: DE-2 (the token holds DE-1)this token is of another listing than GET /v3/queues/: give it to the call that returned it, …of the same listing taken another way (ScrollPagination, where this call takes it by PageNumberPagination)this token was given by an earlier version of ycli: start the listing again without itThe address is never used to build a request and never made a URL of. It is compared as text and believed only when the token's fingerprint is its own. A token whose address was written over is refused as no token, at its own listing and at the one it names.
A token is made of the address and the query as they go on the wire, escaped, so no argument (
ДЕ-1,DE 1,DE[1]) and no link of a service can break the making of it; what is read back is held to the same characters.waymust be a way of paging that exists, andorga header name and an escaped id.Text taken from a token is repeated in a refusal only when it is short and plain (
[A-Za-z0-9._-], 64 at most): a refusal is read on a terminal and by a model through a tool error. Anything else is told as(the token holds another), and the refusal names what the call gave.The core does not know which parts of an address an argument filled. The rule it can hold: one part that differs is taken for an argument given again and named; more than one is another operation. So
boards list->queues list --nextis told "another listing", andcomments list DE-1->comments list DE-2 --nextnamesDE-2. One case reads oddly and is true: the same issue's worklog given the token of its comments is toldworklog (the token holds comments).A token of the first format is not upgraded: it names no organization, so there is nothing to check it against.
scroll-clear, one argument on three surfacestracker.issues.scroll_clear(body: ScrollClear)tracker.issues.scroll_clear(next: str)scroll-clear --pair id=tokenscroll-clear --next TOKENtracker_issues_scroll_clear(body)tracker_issues_scroll_clear(next)Before this, nothing gave the pair: the scroll's token comes in the
X-Scroll-Tokenheader, which ycli did not read. A token of anything but a scroll is refused:this token is not of a scroll: only a search by a scroll has something to release.The
nextof a scroll now holds the scroll's own token. It is of no use without the caller's credentials and dies with the scroll (its TTL, or the clear); the how-to (en, ru) and the docstring say so. No refusal text, no line of the debug log and no repr of the token's state printskept: a test holds it. One place does show it and is left as it is:scroll-clear --dry-runprints the request it would send, and the body of that request is the pair.Measured live (2026-10-10, values not printed)
X-Scroll-Id(24 chars) andX-Scroll-Token(39 chars)POST /system/search/scroll/_clearwith{id: token}Tests
X-Org-Id,X-Cloud-Org-Id, and a service that names none (goes on)test_continuation.pytest_the_address_in_a_token_is_for_a_message_and_never_asked_attest_a_token_of_the_first_format_is_refused_by_name_on_every_surfaceorg,wayandat: a line after it, an escape sequence, a sentence; an address that is no path, with a host, a control character, a query; a query with a fragment;vas2.0,true,1.0; another operation of as many parts; a forgedkept), each through the SDK, the CLI and the MCP tool: ycli's own refusal, nothing sent, no tracebacktests/unit/cli/test_forged_tokens.py#,?, 300 characters, and from a service link with[ ] { } | \\ ^and a backtick: the listing goes on to its endtest_a_listing_makes_its_own_token_whatever_its_address_holds,test_a_listing_that_follows_a_link_makes_its_token_whatever_the_link_holdstest_an_organization_of_any_id_makes_its_token_and_only_a_plain_one_is_repeatedtest_the_same_id_in_another_kind_of_organization_is_another_organizationkeptof a scroll, carried from piece to piece, printed nowheretest_a_scroll_keeps_what_releases_it_and_says_it_nowherescroll-clearon three surfaces sends{id: token}; a token of no scroll is refusedtest_listing_handles.py, the contract caseThe live scenario
tracker/issue-optionsgains the round trip: a scroll in pieces, the clear, the next page refused. For the last step a scenario step can now say the exit code it must end with (exits: 9); such a step reads nothing of the output, soexpectorsavebeside it is refused when the scenario is loaded.Leftovers of the #534 review, closed here
forms notifications list).Breaking changes
tracker.issues.scroll_clear,ycli tracker issues scroll-clearandtracker_issues_scroll_cleartake the token in place of the pair.nexttoken returned by an earlier version no longer goes on: start the listing again.After the review (eight findings, all fixed)
InvalidURLat another listing; so did a query with a fragment (already on main)scroll-clearwith akeptthat has noscrollIdraisedKeyErrorscroll-cleartook a token of another way of paging with a forgedkeptName: idv: 2.0passed andv: truewas told "an earlier version"int, exactlyexitspassed overexpectandsaveAfter the second round of the review (four findings, all fixed)
ДЕ-1,DE 1,DE[1]) broke the making of the token at truncation[ ] { } | \\ ^#, which is what goes on the wireorgandwaywere echoed as writtenwayis one of the ways that exist;orgis a header name and an escaped idSeen by the reviewer, not traced, not a matter of the token: a semicolon in the query of a
Linkheader cut a walk short without a refusal.Verified
On this head, over main
b79c29b2(0.136.0): ruff, ty, lint-imports (6 kept), ast-grep, pydoclint, gitleaks, rulesync and the generated reference without drift; the full suite: 7007 passed, 5 skipped, coverage 100 %.Live, on this exact commit:
YCLI_E2E=1 pytest e2e -m live -k "tracker and issue": 3 passed, the scroll round trip included; output kept in a file. An earlier run on the previous head failed in two of three scenarios: the one failure read was a connect timeout to the Tracker API (exit 6), the cause of the other was not read before re-running and its output was not kept; the re-run passed, and the sandbox held no object of the failed run (janitor,--dry-run).NOT RUN: the full live run over every service (CI runs it); a live check of the organization refusal with a second real organization (there is one account; unit tests with both header kinds hold it).
🤖 Generated with Claude Code