fix(pay): read a settlement clause standing on its own as the method - #162
Merged
ralyodio merged 1 commit intoSep 21, 2026
Merged
Conversation
A listing split into one clause per line - "$0.25 per task" then "settled in SOL" on the next line, after a semicolon, or as its own array entry - refused the whole pay: the clause was parsed as a price line, and "Could not find an amount in \"\"" told nobody anything. The ; the multi-line string splits on is the same mark SETTLED already tolerates before the clause, so the string form made the clause's own syntax unreachable. A standalone clause naming a recognised coin or rail now becomes the method instead; a clause naming anything else still refuses the pay. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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.
readPayLinereads "…, settled in SOL" / "via bank transfer" / "paid in USDC" off the end of a line and returns it as the method.normalisePaythen splits a stringpayfield on newlines and;before handing each piece toreadPayLine— so the moment the settlement clause stands on its own, the whole pay is refused withCould not find an amount in "", an error that quotes an empty string and names nothing.So all of these were rejected while the same clause inline on a line parses fine:
pay: "$0.25 per task; settled in SOL"— the;is the documented line separator and the same markSETTLEDitself tolerates in front of the clause ([,;]?), which made the clause's own syntax unreachable in the string form.pay: "$0.25 per task\nsettled in SOL"— a clause per line is exactly how the one-line-per-price box invites the text to be written.pay: ["$100 an hour", "via bank transfer"]— the array form an API client naturally produces.pay: [{ text: "paid in USDC" }, { text: "$5k fixed" }]— same for the object-text form.A standalone clause that names a recognised coin or rail now becomes the method (
namedMethod, first one wins, an explicitpayMethodstill overrides it, as before). A clause naming anything else —in London,paid in magic beans— still refuses the pay, now quoting the clause text itself.Covered by
test/pay-standalone-method.test.ts: the;, newline, array-entry and{text}forms all read as method + one line, a clause before the lines works, unrecognised words still refuse,payMethodstill wins, andunpaidon its own line still clears the lines.tscclean,node --test— 366/366 pass.Submitted under the current paid Agentic Jobs bug-fix offer.