Repository navigation
Saved documents: picture data on its own last line, so agents can stop before it #856
steventhebrave
started this conversation in
Ideas
Replies: 1 comment 1 reply
|
Thanks, this is a good idea and we'd like the PR. Two things we'll check in review, which you may want to cover in your rigs first: (1) moving |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
A small kernel change I'd like to contribute: when a document is saved, write #bento-doc as the document on one line and (if the deck has pictures), wire "assets":{…} on its own line and make it the last line.
Why: #bento-doc is currently a single line. An agent reading the file can't stop partway through a line, so it gets either a truncated document or it consumes a load of tokens on the megabytes of text-encoded image data.
Proposed changes:
The line break is JSON whitespace, so all parsers and older shells should see the same thing. A document without assets is byte-identical to JSON.stringify(doc). Encrypted or sealed bodies aren't touched.
It's ready on a branch with a kernel rig and a slides browser rig. It passes the kernel, shared, slides, spaces, dash and type workflows and the 57 browser rigs.
It changes the save path, so I'm checking before opening a PR. I don't think it clashes with anything inflight and it's hopefully quite a small change! Happy to open the PR if it looks like a good idea.
All reactions