Repository navigation
Conversation
A field the Bot left empty says nothing about the action. Writing only a note on a Shopify order was handed to the person as money-moving because the action's schema has a billing_address field that was never filled in; field names now only count when they hold something. Refs CopilotKit#890
sx4im
requested review from
MikeRyanDev,
davidmckayv,
dustywusty,
guidovizoso,
mxmzb,
samjulien and
tylerslaton
as code owners
October 31, 2026 17:11
Resolve CHANGELOG.md Unreleased entry collision: keep upstream's three entries and the PR's empty-fields entry (mechanical merge).
The merge of main (20de77d) rebuilt the tree from upstream main plus the merged CHANGELOG.md, silently dropping this PR's server/src/approvals/policy.ts and server/tests/approvals-policy.test.ts changes. Restore both files from the pre-merge head.
This branch has not been deployed
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.
What this changes
Finishes the false-positive half of #890. Writing only a note on a Shopify order was still handed to the person as money-moving: the Bot passes
billing_addressleft empty, and the safety matcher fired on the field name even though nothing was in it.flatteninserver/src/approvals/policy.tsno longer counts a field name when the field holds nothing (null, undefined, empty string, object or array). The rules now match the arguments actually sent, not names of fields left empty. Abilling_addresswith something in it still matches exactly as before.Where it runs
Pure function, no state involved.
Boundary and audit
Changelog
CHANGELOG.mdunderUnreleased.Proof
bun test server/tests/approvals-policy.test.ts: 33 pass, 0 fail. The new assertions (order note withbilling_address: nulland withbilling_address: {}) fail before the fix (came backpayments) and pass after.tsc --noEmitclean on server.Refs #890