fix(cli): remove calldata_id resolution — tx_ready delivers calldata directly#247
Draft
fix(cli): remove calldata_id resolution — tx_ready delivers calldata directly#247
Conversation
Calldata is now delivered to clients via tx_ready SSE events with full hex — clients no longer need to resolve calldata_id references from the agent-backend API. Removed: - backendClient field and setBackendClient() from executor - calldata_id resolution block in buildTx (mode 1) - Raw calldata pass-through in buildTx (mode 3) — server-built calldata arrives via tx_ready, not via action params - Fallback to buildSendTx (mode 5) — replaced with explicit error - getCalldata() HTTP method from client - setBackendClient wiring from session buildTx now only handles ABI-encoding from function_name + contract_address. All other calldata delivery goes through tx_ready. Companion to vultisig/agent-backend#109 which moves stashing after tx_ready emission so clients always receive real hex. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.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.
Summary
Removes all calldata_id client-side resolution from the SDK CLI. Calldata is now delivered via
tx_readySSE events with full hex — the client no longer needs to fetch calldata references from the agent-backend API.What changed
executor.ts:
backendClientfield andsetBackendClient()methodbuildTx(theif (params.calldata_id && !params.data)block)buildTx(theif (params.data || params.calldata || params.hex_payload)block) — server-built calldata arrives via tx_ready, not via action paramsbuildSendTxwith an explicit error throwbuildTxnow only handles ABI-encoding fromfunction_name + contract_addressclient.ts:
getCalldata()HTTP method (calledGET /agent/calldata/:id)session.ts:
setBackendClientwiring after authWhy
Both Sonnet and minimax were observed putting the literal string
calldata_id: cd_xxxinto the txdatafield, causing on-chain reverts. The calldata_id mechanism required the LLM to correctly place a machine-generated reference into the right tool parameter — a fundamentally fragile design.The companion agent-backend PR (#109) moves calldata stashing after tx_ready emission, so tx_ready always carries full calldata. Clients sign directly from tx_ready without needing calldata_id resolution.
Depends on
Test plan
yarn checkpasses