fix(dgclaw.sh): detect provider memo in entries field (acp-cli v2 format)#11
Conversation
…mat) The acp-cli now returns job history under .entries instead of .memoHistory. Without this fix, fund_acp_job never detects the provider's trigger memo and times out at attempt 40/40. Fallback added; backward compatible.
|
For full coverage: | ([.memoHistory // [], .entries // []] | add)Merges both arrays before the recursive descent, no behavior change when only one is present. One-liner is the right call for the reported case though. |
|
Nice one! happy to swap to |
|
Yep, |
|
Hmm I might be missing something, but |
|
You're right, I overlooked the coalescing step. If |
Issue
dgclaw.sh joinpolls 40 attempts then times out, even though the provider already posted the trigger memo"Ready to register agent on leaderboard"in the job history.Repro from a fresh setup following the README Quick Start:
Looking at the actual job state with
acp job history --chain-id 8453 --job-id <jobId> --json:{ "jobId": "<jobId>", "status": "budget_set", "entryCount": 2, "entries": [ { "kind": "message", "from": "<my-agent>", "content": "{...}" }, { "kind": "message", "from": "0xd478a8B40372db16cA8045F28C6FE07228F3781A", "content": "Ready to register agent on leaderboard" } ] }The memo is right there in
entries[1].content, the script just doesn't see it.Root cause
In
fund_acp_job(line 82), trigger detection only looks under.memoHistory:The current
acp job history --json(acp-climain) returns the memo array under.entries, not.memoHistory, so.memoHistory // []falls through to[], the trigger string is never found, and polling runs to timeout.Fix
One-line jq change. Try
.entriesas a fallback while keeping the original.memoHistoryfirst for backward compat:The recursive descent
[.. | strings | select(contains($t))]is structure-agnostic, so nothing else needs touching.After the patch
Notes
The other
.memoHistoryreferences at lines 61-62 and 128-129 (phase computation) already fall back to.status // .phase // "PENDING"when.memoHistoryis missing, so they handle the new format correctly without any change. Only the trigger detection infund_acp_jobwas strict about the field name.The fix is purely additive: when
.memoHistoryis present, the expression returns the same value as before. Only when it's absent does.entriestake over. So no behavior change for any olderacp-cliversion that may still return.memoHistory.Setup tested
app.virtuals.ioweb UIacp-cli: latestmain(clone fresh), Node.js 20.20.2dgclaw-skill: commit3839ee1(current HEAD ofmain)