Skip to content

git: give a cut text PATCH page its resume cursor - #129

Open
jsegaran wants to merge 2 commits into
yas-run:mainfrom
indent-com:fix/git-text-patch-cursor
Open

jsegaran wants to merge 2 commits into
yas-run:mainfrom
indent-com:fix/git-text-patch-cursor

Conversation

@jsegaran

Copy link
Copy Markdown
Collaborator

A PATCH_TEXT query whose patch is larger than max_bytes silently drops files. The engine stops at the last whole file, sets GIT_PATCH_TRUNCATED, and computes where to resume. Then:

  • native_patch returns PatchResult::Text(bytes) and drops the response flags and the cursor.
  • The server answers with QueryCursor::Start, so the page has no QUERY_PAGE_MORE.

docs/design/git.md says a non-empty continuation cursor is the only sign that more remains. So clients see a complete patch: the TypeScript SDK never sets GIT_PATCH_TRUNCATED, and yas git diff -p prints only the first page.

The engine now returns the text cursor next to the text, and PatchResult::Text carries it. The server answers with QueryCursor::Patch { path, position: 0 }, which the engine already reads as "resume after this file". A text page cannot stop mid-file, so the position is always 0. Structured mode is unchanged. Clients that already page structured patches page text patches the same way: appendPatchCursor in the SDK and query_all in the CLI.

Tests:

  • text_patch_cut_at_max_bytes_resumes_from_its_cursor (engine): with a budget of one file, it follows cursors until there are none, and the pages concatenate to the unbudgeted patch.
  • cut_text_patch_page_carries_a_patch_cursor (server adapter): a cut page returns the first file and a Patch cursor naming it. With the old Start mapping it fails.

cargo test -p yas-git --test engine, cargo test -p yas-server --lib, cargo clippy -p yas-git -p yas-server --all-targets -- -D warnings and cargo fmt --check pass.

View in Indent
Tag @indent to continue the conversation here.

@ultimator-ai ultimator-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ultimator's review of d363d04

The change preserves the engine's whole-file text cursor through the native adapter and exposes it as the query continuation; structured pagination remains unchanged. Changes requested: enabling text pagination exposes the CLI's deferred-content collection to pending-frame overflow on large patches. At d363d04, nix-syntax passed; the other ten CI checks were running or queued when inspected, and no local checks were run.

1 issue: 1 bug

No issue is open since the review of b5b3c50.

Reviewed in 5m 25s · Session · @ultimator-ai review reviews again · @ultimator-ai fix fixes the open issues

Comment thread crates/server/src/yas_git.rs Resolved

@ultimator-ai ultimator-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ultimator's review of b5b3c50

The CLI now consumes and prints each text PATCH page's content before requesting its continuation, fixing #1's accumulation of unread transfers; the extracted query_page helper preserves the existing decoding path for other queries. Approved at b5b3c50 with no new findings; all eleven exact-head CI checks were queued when inspected, and no local checks were run.

No issues found · 1 resolved

Reviewed in 38s · Session · @ultimator-ai review reviews again · @ultimator-ai fix fixes the open issues

@indent
indent Bot force-pushed the fix/git-text-patch-cursor branch from b5b3c50 to 11d45b7 Compare October 25, 2026 19:44
@indent
indent Bot force-pushed the fix/git-text-patch-cursor branch from 11d45b7 to 9d3b878 Compare October 25, 2026 20:47

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant