[codex] add agent response views#29
Merged
Merged
Conversation
HappySean2845
marked this pull request as ready for review
June 12, 2026 08:29
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
Adds opt-in agent-friendly response views to
surf-cliso instant-mode prompts can avoid brittle jq projections over raw API envelopes.What changed
--agent-view <view>for stable compact command-specific JSON views.--shapefor a JSON response shape summary with sample data and suggested views.search-web --agent-view resultsproject-detail --agent-view contractsmarket-tge --agent-view summaryonchain-txhex quantity decimal enrichment.Why
Recent instant eval batches showed jq failures mostly came from variable raw response shapes, not from missing prompt instructions. These views move common envelope parsing into deterministic CLI code while leaving API contracts and default CLI behavior untouched.
Impact
This is client-side and opt-in. Existing
surf ... --jsonbehavior is unchanged, so downstream Surf services, NER, spotlight, and existing scripts are unaffected unless they explicitly start using--agent-viewor--shape.Validation
go test ./cli -run 'TestTransformResponseForCommand|TestMakeRequestAndFormatTransformsOnchainTxResponse'go test ./cli -skip '^TestRequestRetryAfter$'go test ./cmd/surf -run '^$'Note: full
go test ./clistill hangs on existingTestRequestRetryAfter, which sleeps until the package timeout. I skipped only that existing slow test for broader CLI validation.