Skip to content

✨ Finalize agent-friendly visual context - #345

Open
Robdel12 wants to merge 2 commits into
mainfrom
rd/agent-friendly-context
Open

✨ Finalize agent-friendly visual context#345
Robdel12 wants to merge 2 commits into
mainfrom
rd/agent-friendly-context

Conversation

@Robdel12

@Robdel12 Robdel12 commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Why

Visual context was still doing too much work in the CLI. It downloaded full payloads for human output, ranked and paged agent evidence locally, and filled gaps in API facts with client-side guesses. That made compact output large, made pagination drift as builds changed, and let the human and agent paths disagree.

Approach

Build and comparison context now consume one bounded provider contract for both human output and agent JSON. Evidence order, review facts, history streams, omission metadata, and opaque cursors stay provider-owned. The CLI handles presentation, source-pinned follow-up commands, shell-safe arguments, and fail-closed schema and final-output size checks. Raw JSON and explicit full context remain lossless.

Local workspace context follows the same compact shape. Its cursors are bound to the complete snapshot contents, target, stream, detail mode, and page size, while summary pages omit raw geometry unless --include diffs is requested. Structured provider error codes survive the HTTP boundary, so stale cursors and oversized pages remain actionable to agents.

Human output uses concrete labels such as Attention, Evidence, Images, Similar history, and Recent history. Both history streams are visible, and missing facts stay unknown or unavailable instead of becoming false zeroes or success states.

Evidence

The full suite passes 2,025 tests with no failures; six X11-only visual checks are skipped in this environment. Boundary coverage exercises human and agent output, raw/full preservation, independent history paging, snapshot invalidation, source authority, typed API errors, partial responses, final emitted payload bounds, malformed compact responses, and local/cloud shape parity. Lint, formatting, published type checks, the production build, and direct runs through the built binary also pass.

Consume the API-owned compact context contract for both human and agent flows. Add opaque cursor paging, bounded schema checks, local-provider parity, and lossless raw/full drill-downs.
Preserve typed API recovery signals, bind local cursors to snapshot contents, keep local and cloud compact shapes aligned, and enforce payload bounds after adding follow-up commands.
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