feat: Bucket A — payload reduction + first-class upload#2
Merged
Conversation
task-memory init from /tm-init run
The CLI convention is kebab-case everywhere else; --fullPage was a v0.1 holdout. Accept both forms — kebab is preferred going forward, camelCase stays for back-compat with live scripts. Refs: docs/planning/sprint-bucket-a.md §1 (GHAX-FR-06)
Cuts payload per-tab when the operator only needs a narrow slice. The jnremache field session averaged 200 bytes/tab of query-string noise on google-product tabs; --fields id,title trims that. --filter runs a case-insensitive regex against both url and title. --fields projects only the listed keys (id, title, url, active); unknown keys silently ignored to keep a typo from killing the call. Refs: docs/planning/sprint-bucket-a.md §2 (TOK-04)
Caps the stringified eval result at N utf-8 bytes so an accidental
document.body.innerText on a heavy page can't blow out an LLM
operator's context window. On trip, returns {value, truncated:true,
originalBytes} — shape is unchanged when under cap.
Byte slicing uses Buffer.subarray so the count matches what the
network actually transfers, not .length's code-unit count. Slicing
may land mid-codepoint; that's fine — the point is hard containment.
Refs: docs/planning/sprint-bucket-a.md §3 (TOK-02)
…-004) Replaces the hand-rolled document.body.innerText.substring(skip, skip+length) pattern the jnremache session used 40+ times. --selector scopes to one element (via locator.innerText, so CSS-hidden content is still excluded like the default path). --length/--skip paginate the returned string. Daemon still pulls full innerText — the win is on the wire, which is where the operator's context budget actually lives. Refs: docs/planning/sprint-bucket-a.md §4 (TOK-10)
Replaces the hand-rolled 30-line Node + ws shim the jnremache session used 5x to hit DOM.setFileInputFiles directly. Wraps Playwright's locator.setInputFiles which already handles the CDP plumbing, multi-file inputs, and MIME sniffing. Paths are resolved relative to the daemon's cwd (captured at attach time). Comma-separated values select multi-file mode. Rust dispatch checks positional arity before the RPC round-trip so the Usage line fires instantly on operator typos. Refs: docs/planning/sprint-bucket-a.md §5 (JNR-07)
On heavy SPAs (hundreds of cursor:pointer divs across Radix/Headless portals), the cursor-interactive section dominates snapshot output and is usually not what an operator wants when they asked for a compact dump. Gate the implicit -i-driven scan on !opts.compact. Explicit -C (cursorInteractive) still forces the scan on — that's an opt-in ask. Only the implicit coupling via -i is broken. Refs: docs/planning/sprint-bucket-a.md §6 (TOK-01)
Matches the TASK-001 change for screenshot. README was updated to advertise --full-page on both verbs; this keeps the daemon honest. Refs: docs/planning/sprint-bucket-a.md §1 (GHAX-FR-06)
- CHANGELOG [Unreleased] — new section covering the six Bucket A items (screenshot --full-page, tabs --filter/--fields, eval --max-bytes, text --selector/--length/--skip, upload verb, snapshot --compact suppresses cursor-interactive). - README command surface updated to advertise the new flags. No ARCHITECTURE changes — these are surface additions, not architectural shifts.
kepptic
added a commit
that referenced
this pull request
Apr 24, 2026
feat: Bucket A — payload reduction + first-class upload
kepptic
added a commit
that referenced
this pull request
Apr 24, 2026
feat: Bucket A — payload reduction + first-class upload
kepptic
added a commit
that referenced
this pull request
Apr 24, 2026
feat: Bucket A — payload reduction + first-class upload
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
Six flags and one new verb to cut payload size for LLM operators driving ghax. Sourced from the 2026-04-20 jnremache field report (see
plan.mdfollow-up sprint, Bucket A).Payload reduction
screenshot --full-page— kebab alias matching the rest of the CLI convention (TASK-001, + drive-by forresponsive)tabs --filter <regex> --fields <csv>— server-side regex + field projection, ~200 bytes saved per google-product tab (TASK-002)eval --max-bytes <N>— utf-8 byte cap on result, returns{value, truncated, originalBytes}on trip (TASK-003)text --selector --length --skip— scoped, paged page-text dumps; replaces hand-rolledinnerText.substring(...)(TASK-004)snapshot --compact+-i— compact mode now suppresses the cursor-interactive pass that dominates output on heavy SPAs (TASK-006)Ergonomics
upload <@ref|selector> <path>[,<path>…]— first-class file upload verb wrappinglocator.setInputFiles. Replaces a 30-line hand-rolled CDP shim the field session used 5x (TASK-005)Housekeeping
Test Coverage
Added 11 new smoke assertions — one per new flag, plus error-path coverage (invalid regex on
--filter, missing arg onupload, --max-bytes pass-through vs truncation, --compact vs -C override).All 60+ smoke checks pass against the Rust binary (
GHAX_BIN=target/release/ghax npm run test:smoke), exit 0.Pre-Landing Review
Reviewed inline during autopilot run. No unfixed issues. Fix-First items addressed:
responsivehandler needed matching--full-pagesupport after README called it out (fixed in 6fa6579).Manual QA (live browser)
Verified against a running Edge on :9222:
tabs --filter example --fields id,url --json— correct filter + projectiontext --selector h1/--length 20/--skip 8 --length 13— correct sliceseval '"x".repeat(100)' --max-bytes 20—{value:"xxxxxxxxxxxxxxxxxxxx", truncated:true, originalBytes:100}✓snapshot -ivssnapshot -i --compact— cursor-interactive section dropped in compact modescreenshot --full-page— 52 KB PNG written--helpsurfaces the new verbs and flagsPlan Completion
All six Bucket A items from
plan.mdmarked done:screenshot --full-pagetabs --filter --fieldseval --max-bytestext --selector --length --skipuploadsnapshot --compactsuppresses cursor passBuckets B/C/D (stable refs, React fill fallback, dialog-aware walker, papercut bundle, docs-only items) remain queued in
plan.md.Documentation
CHANGELOG.md[Unreleased] covers all six items.README.mdcommand surface reflects every new flag + the kebab-alias rename.Test plan
npm run typecheck— cleancargo build --release— cleannpm run build— clean (78.8kb daemon bundle)GHAX_BIN=\$PWD/target/release/ghax npm run test:smoke— 60+ checks, exit 0🤖 Generated with Claude Code