Skip to content

Compact WooCommerce list results by default; render large tool results without indentation - #1635

Merged
helpcodeai merged 3 commits into
mainfrom
feat/woo-compact-defaults
Nov 11, 2026
Merged

helpcodeai merged 3 commits into
mainfrom
feat/woo-compact-defaults

Conversation

@helpcodeai

Copy link
Copy Markdown
Contributor

Summary

Second step after #1631. #1631 gave every installed WooCommerce connector the optional _fields key (110 of 111 updated at the 10:56 boot). This PR gives _fields a compact default on woocommerce_list_orders and woocommerce_search_products. A list call that doesn't pass _fields now gets small objects: about 1-2 KB per order instead of 50-100 KB. It also stops the backend from pretty-printing multi-megabyte tool results.

Matteo approved the default (customer-visible change) on 2026-11-11. The shop with the daily 600+ MB of full orders was told by email beforehand.

Changes

  • woocommerce.json, _fields default:
    • Orders: status, dates, totals, payment method, billing and shipping, line items without meta, shipping lines, coupon codes, refunds.
    • Products: ids, name, SKU, type, prices, stock, categories, link, modified date.
    • Not included: meta_data, descriptions, images, _links.
    • Full objects: pass _fields: "" (the engine drops an empty value, so WooCommerce returns complete objects), add meta_data to the list, or use the get tools. Descriptions and the instructions say so.
    • Why it rolls out by itself: the endpoint mapping is unchanged from Auto-apply catalog updates that only add optional query parameters; WooCommerce sync filters #1631, so on installed connectors this is a parameters-only change: safe class, applied at the next boot.
  • dynamic-mcp-tools.ts renderResult: the result is serialised compactly first, and only results up to 1,000,000 characters (COMPACT_RENDER_CHARS) are re-rendered with indentation. A 10 MB page used to be pretty-printed to ~25 MB and then serialised a second time when over the limit. A plain string is still serialised once.
  • Specs:
    • woocommerce.live.spec.ts: defaults content; "" documented; why a key and its default cannot arrive in the same deploy.
    • catalog-resync.additive.spec.ts: fixture moved to the modified_* keys.
    • dynamic-mcp-tools.spec.ts: a large object renders compactly without a pretty pass.

Type

  • Bug fix
  • New feature
  • Documentation
  • Refactoring
  • Performance improvement
  • Other (describe below)

Testing

  • Added/updated unit tests
  • Tested manually (describe steps below)
  • No tests needed (explain why)

In packages/backend:

  • npx jest src/adapters/intl/woocommerce src/connectors/catalog-resync: passed.
  • dynamic-mcp-tools.spec needs @aws-sdk/client-s3, which my local node_modules lacks, so it runs in CI.
  • eslint on the changed files: clean.

From the root: validate-adapters --warn shows no new warning, regenerate-catalog shows no diff, adapter-count --check is OK.

Checklist

  • My code follows the existing code style
  • I have tested my changes locally
  • I have updated documentation (if applicable)
  • All existing tests pass (npm test) (CI)
  • This PR has a descriptive title

Cloud and self-hosted behave the same.

Related Issues

Follow-up to #1619 and #1631.

@helpcodeai
helpcodeai requested a review from D3nisty as a code owner November 11, 2026 11:03
@helpcodeai
helpcodeai merged commit 357d63f into main Nov 11, 2026
16 checks passed
@helpcodeai
helpcodeai deleted the feat/woo-compact-defaults branch November 11, 2026 11:40
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant