Skip to content

feat: compute commands#22

Open
andrew-virtuals wants to merge 3 commits into
mainfrom
feat/compute
Open

feat: compute commands#22
andrew-virtuals wants to merge 3 commits into
mainfrom
feat/compute

Conversation

@andrew-virtuals
Copy link
Copy Markdown
Contributor

@andrew-virtuals andrew-virtuals commented May 19, 2026

Note

Medium Risk
Adds a new on-chain USDC transfer flow for compute top-up, which increases risk due to chain/asset handling and fee calculation, but changes are localized to a new command and API wrapper methods.

Overview
Adds a new acp compute command group with status (fetches compute balance/limit/usage) and top-up (validates amount/chain, computes a fee, sends an on-chain USDC transfer, then notifies the backend with the tx hash).

Extends the Agent API client with compute types and endpoints (/agents/:id/compute/account, /common/compute-fee, /agents/:id/compute/top-up), wires the command into the CLI entrypoint, and updates README.md/SKILL.md docs to include the new compute workflow.

Reviewed by Cursor Bugbot for commit ae12288. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ae12288. Configure here.

Comment thread src/lib/api/agent.ts
return this.client.post<ComputeTopUpResponse>(
`/agents/${agentId}/compute/top-up`,
{ amount, txnHash }
);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agentAddress parameter silently dropped from API request body

High Severity

The computeTopUp method accepts an agentAddress parameter but never includes it in the POST body ({ amount, txnHash }). The caller in compute.ts explicitly fetches the wallet address via getWalletAddress() and passes it in, but the value is silently discarded. Other similar methods in the same file (e.g., getCoinbaseUrl, initCrossmintOrder) consistently include walletAddress in their request bodies, confirming this is an accidental omission.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ae12288. Configure here.

Comment thread src/commands/compute.ts
"--chain-id <id>",
"Chain to send USDC on (defaults to the account's preferred billing chain)",
"8453"
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Option description claims dynamic default but uses hardcoded value

Low Severity

The --chain-id option description claims it "defaults to the account's preferred billing chain," but the actual default is the hardcoded string "8453". The ComputeAccount type defines a preferredBillingChainId field that is never read or used for this default. Users may omit --chain-id believing the CLI will auto-detect their preferred chain, potentially sending USDC on an unintended chain.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ae12288. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant