fix(sell): keep multi-currency --accept whole (disable cli/v3 comma split)#665
Open
bussyjd wants to merge 1 commit into
Open
fix(sell): keep multi-currency --accept whole (disable cli/v3 comma split)#665bussyjd wants to merge 1 commit into
bussyjd wants to merge 1 commit into
Conversation
…plit) cli/v3 StringSliceFlag splits each value on "," by default. Since one --accept is a comma-separated key=value list (token=X,network=Y,price=Z) and parseAcceptKV already splits on "," itself, cli/v3 shredded each option into fragments before parsing, so the first fragment had no network and every multi-currency offer failed with "network is required". Multi-currency offers were unreachable from the CLI; the only workaround was a single-currency offer plus a manual kubectl patch of spec.payments[]. Set DisableSliceFlagSeparator: true on the commands that carry --accept (sell http, sell agent, sell update) so each --accept arrives whole; parseAcceptKV keeps doing the intra-option "," split. The repeatable --register-skills/-domains/-metadata flags are unaffected in practice (each value is a single token or key=value; nothing passes them comma-joined). Add a regression test that drives real cli/v3 argv parsing (the existing accept_test.go tests called parseAcceptOption/buildAcceptPayments directly and bypassed cli/v3, so they never caught this), with a negative control proving the field is load-bearing. Fixes #664 Claude-Session: https://claude.ai/code/session_01AtSvU6TbF54ywnqJ2dGHAp
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
Fixes #664. Multi-currency
--acceptoffers could not be created from the CLI — every attempt failed withnetwork is requiredeven whennetwork=was present.--acceptis acli.StringSliceFlag, and cli/v3 splits slice-flag values on,by default. One--acceptis meant to be a single comma-separatedkey=valuelist (token=X,network=Y,price=Z), andparseAcceptKValready splits on,itself — so cli/v3 shredded each option into fragments first:buildAcceptPaymentsthen read the first fragment (token=USDC) as a whole option with no network →network is required. The grouping is lost in the split, so it must be prevented up front.Fix
Set
DisableSliceFlagSeparator: trueon the three commands that carry--accept(sell http,sell agent,sell update). Each--acceptnow arrives whole;parseAcceptKVkeeps doing the intra-option,split.The repeatable
--register-skills/--register-domains/--register-metadataflags on those commands are unaffected in practice: each value is a single token orkey=valuepair, and nothing in the repo passes them comma-joined (verified with a repo-wide grep). Repeating the flag still works exactly as before.Test
accept_test.go's existing tests callparseAcceptOption/buildAcceptPaymentsdirectly and bypass cli/v3 argv parsing, which is why they never caught this. AddedTestSellAccept_CommaSeparatorDisabled:DisableSliceFlagSeparator: true.--acceptoptions arrive whole and build two payments; the negative control (default separator) shreds them into 6 fragments and fails to build, proving the field is load-bearing.Manual verification
obol sell http ... --accept token=USDC,network=base,price=0.03 --accept token=OBOL,network=ethereum,price=0.0001now produces aServiceOfferwith bothspec.payments[]entries directly — nokubectl patchworkaround.