Add one-shot creation and option-aware views to batch - #286
Open
IoannisMaras wants to merge 2 commits into
Open
Conversation
Author
|
I didnt want to mess up the skills , but I you want me to include these changes there I could do that |
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.
Summary
batch --create-if-missingso a missing document can be created and processed in one invocationbatch --saveas an explicit persistence boundary for resident batchesoptionsobject to batch itemsstart,end,max-lines,cols,range,type,limit,page,out,render, screenshot size, andgridMotivation
Batch already supported document edits. The missing capability was command options and several view modes. For example, this could not previously be expressed inside a batch:
It required a separate CLI invocation after the batch, adding another process startup and document-open cycle. It could also lead callers to request an unbounded view and consume substantially more output tokens when they only needed a small section.
The same bounded view can now be part of
operations.json:{ "command": "view", "mode": "text", "options": { "start": "1", "max-lines": "50" } }Page-specific screenshot output can also remain in the batch:
{ "command": "view", "mode": "screenshot", "options": { "page": "1", "render": "html", "out": "page-1.png", "screenshot-width": "1000" } }Together with creation, this enables a one-shot workflow:
Local timings
Creation-path comparison measured on the same Windows machine and Release build:
createinvocation--create-if-missingFor commands that previously had to run outside the batch, each avoided invocation removes roughly one CLI startup plus a document-open cycle. Local read/view commands were generally around 0.34-0.42 s per separate invocation. Output-limiting options such as
max-linesalso reduce response size, although token savings depend on the document and requested limit and were not benchmarked here.These are local wall-clock measurements intended to illustrate avoided overhead, not a formal cross-platform benchmark.
Validation
git diff --checkpasses