Skip to content

fix(ebay): preserve commerce fields in agent compact output#1424

Open
freemanconsulting wants to merge 2 commits into
mvanhorn:mainfrom
Freeman-Consulting:fix-ebay-agent-compact-commerce-fields
Open

fix(ebay): preserve commerce fields in agent compact output#1424
freemanconsulting wants to merge 2 commits into
mvanhorn:mainfrom
Freeman-Consulting:fix-ebay-agent-compact-commerce-fields

Conversation

@freemanconsulting

Copy link
Copy Markdown

Summary\n- keep eBay commerce fields in compact list output so --agent does not strip price/condition/bid data\n- adds regression coverage for listing/sold/auction and comp summary fields\n\n## Why\nThe eBay CLI documents --agent as JSON + compact + non-interactive. For commerce commands like listings/sold/auctions/comp, the generic compact allow-list kept title/url but dropped the fields agents actually need: price, condition, currency, bids, sold_price, etc. Downstream consumers had to avoid --agent to get usable pricing data.\n\n## Test\n- cd library/commerce/ebay && go test ./...\n

@greptile-apps

greptile-apps Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes --agent compact output for eBay commerce commands by extending the compactListFields allow-list with pricing, condition, auction, and statistical fields that agents need to make sense of listings, sold, auctions, and comp output. It also corrects the README to stop advertising saved-search create and feed as working examples.

  • helpers.go: Adds 18 eBay-specific fields (price, condition, bids, sold_price, currency, etc.) and 6 comp statistical fields (mean, median, p25, p75, std_dev, sample_size) to the shared compactListFields allow-list; scoped to the eBay CLI only.
  • agent-compact-preserves-commerce-fields.json: Adds the required .printing-press-patches/ entry with correctly copied base_run_id and base_printing_press_version from .printing-press.json, satisfying the reprint-guard convention.
  • helpers_compact_test.go: New white-box tests verify that commerce and comp fields survive compact mode while verbose fields (description, notes) are stripped.

Confidence Score: 5/5

Safe to merge; the allow-list expansion is additive and scoped to the eBay CLI only, tests cover both new field groups, and the patch file is correctly structured.

All changed code is additive — no existing fields are removed or reordered, and the new fields are eBay-specific enough that false positives in other command outputs are unlikely. The patch file provenance values match .printing-press.json exactly, and the two new tests directly exercise the changed code path. The only gap is the missing contributor attribution, which is a convention miss and does not affect runtime behavior.

.printing-press.json — contributor entry for freemanconsulting (plus README byline and NOTICE) should be added per repo convention before merge.

Important Files Changed

Filename Overview
library/commerce/ebay/.printing-press-patches/agent-compact-preserves-commerce-fields.json New patch entry correctly documents the compact allow-list change; base_run_id and base_printing_press_version match .printing-press.json exactly.
library/commerce/ebay/internal/cli/helpers.go Adds eBay-specific commerce fields and comp statistical fields to the compactListFields allow-list; implementation is correct and scoped to this CLI only.
library/commerce/ebay/internal/cli/helpers_compact_test.go New white-box tests covering listing/sold/auction field preservation and comp statistical fields; correctly uses package cli to access unexported compactListFields.
library/commerce/ebay/README.md Correctly replaces not-yet-implemented saved-search/feed examples with --help redirects; straightforward documentation fix.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["ebay-pp-cli <command> --agent"] --> B["compactFields()"]
    B --> C{Array response?}
    C -- Yes --> D["compactListFields()"]
    C -- No --> E["compactObjectFields() blocklist"]
    D --> F{Field in allow-list?}
    F -- Yes generic --> G["id, name, title, url, status..."]
    F -- Yes commerce NEW --> H["price, condition, bids, sold_price,\ncurrency, seller, best_offer,\nauction, buy_it_now, time_left,\nends_at, sold_date, image_url,\nlocation, shipping, item_id"]
    F -- Yes comp stats NEW --> I["mean, median, p25, p75,\nstd_dev, sample_size"]
    F -- No --> J["Dropped (description, notes, etc.)"]
    G --> K["Compact agent output"]
    H --> K
    I --> K
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A["ebay-pp-cli <command> --agent"] --> B["compactFields()"]
    B --> C{Array response?}
    C -- Yes --> D["compactListFields()"]
    C -- No --> E["compactObjectFields() blocklist"]
    D --> F{Field in allow-list?}
    F -- Yes generic --> G["id, name, title, url, status..."]
    F -- Yes commerce NEW --> H["price, condition, bids, sold_price,\ncurrency, seller, best_offer,\nauction, buy_it_now, time_left,\nends_at, sold_date, image_url,\nlocation, shipping, item_id"]
    F -- Yes comp stats NEW --> I["mean, median, p25, p75,\nstd_dev, sample_size"]
    F -- No --> J["Dropped (description, notes, etc.)"]
    G --> K["Compact agent output"]
    H --> K
    I --> K
Loading

Reviews (2): Last reviewed commit: "fix(ebay): address review and verifier f..." | Re-trigger Greptile

Comment on lines +510 to +519
// Commerce/search result fields. eBay's `listings`, `sold`, `comp`, and
// `auctions` commands are useless to agents if compact mode strips the
// price/condition/bid fields. `--agent` implies `--compact`, so these must
// survive the generic allow-list.
"item_id": true, "price": true, "sold_price": true, "currency": true,
"condition": true, "seller": true, "bids": true, "best_offer": true,
"auction": true, "buy_it_now": true, "time_left": true, "ends_at": true,
"sold_date": true, "image_url": true, "location": true, "shipping": true,
"mean": true, "median": true, "sample_size": true, "p25": true,
"p75": true, "std_dev": true,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Missing .printing-press-patches/ entry for this generated-code edit

helpers.go lives inside generated output from the Printing Press; the project's AGENTS.md requires every hand-edit to be recorded under .printing-press-patches/ (a JSON file following the schema used by the three existing entries) so that a future regen carries the intent forward. Without a patch entry, the next printing-press regen will silently overwrite helpers.go and drop this fix, restoring the broken compact output for agents. All three existing patches in that directory (catalog-go-1264-vuln-floor.json, chrome-profile-cookie-selection.json, standalone-pycookiecheat-profile-selection.json) demonstrate the required format.

Context Used: library/commerce/ebay/AGENTS.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Codex Fix in Claude Code Fix in Cursor Fix in Conductor

Comment thread library/commerce/ebay/internal/cli/helpers.go
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