Problem
After registering an agent with --capabilities 1, attempting to claim a task that requires --capabilities 7 fails with:
AnchorError thrown in src/instructions/claim_task.rs:255.
Error Code: InsufficientCapabilities. Error Number: 6003.
Error Message: Agent has insufficient capabilities.
The agent's on-chain PDA already exists, so re-running agents register fails with AgentAlreadyRegistered. There is no CLI subcommand to update the agent's capabilities.
What I expected
Either:
agents register --reuse or agents update --capabilities 7 to update the existing agent PDA, OR
agents register with --capabilities flag should call update_agent if the agent already exists (idempotent upsert)
What's available in the protocol
The protocol IDL (@tetsuo-ai/protocol v0.2.1) has a working update_agent instruction:
name: "updateAgent"
args: [
{ name: "capabilities", type: { option: "u64" } }
{ name: "endpoint", type: { option: "string" } }
{ name: "metadata_uri", type: { option: "string" } }
{ name: "status", type: { option: "u8" } }
]
All args are Option<T>, so a minimal update would be capabilities: Some(7). But the CLI has no agents update subcommand to call this.
Reproduction
agenc-marketplace --network mainnet agents register --authority <key> --agent-id <id> --capabilities 1 ... — succeeds, agent PDA created
- Attempt to claim a task with
--capabilities 7 — fails InsufficientCapabilities
- Re-running
agents register with --capabilities 7 — fails AgentAlreadyRegistered
- No
agents update command exists to call update_agent
Environment
- CLI: agenc-marketplace v next (binary, standalone)
- Network: mainnet
- Protocol: HJsZ53Zb27b8QMRbQpuDngE44AdwCGxvEZr61Zmxw1xK
- Node: v22
Suggested fix
Add an agents update subcommand that calls the existing update_agent instruction, e.g.:
agenc-marketplace --network mainnet agents update \
--authority <key> \
--agent-id <id> \
--capabilities 7
Problem
After registering an agent with
--capabilities 1, attempting to claim a task that requires--capabilities 7fails with:The agent's on-chain PDA already exists, so re-running
agents registerfails withAgentAlreadyRegistered. There is no CLI subcommand to update the agent's capabilities.What I expected
Either:
agents register --reuseoragents update --capabilities 7to update the existing agent PDA, ORagents registerwith--capabilitiesflag should callupdate_agentif the agent already exists (idempotent upsert)What's available in the protocol
The protocol IDL (
@tetsuo-ai/protocolv0.2.1) has a workingupdate_agentinstruction:All args are
Option<T>, so a minimal update would becapabilities: Some(7). But the CLI has noagents updatesubcommand to call this.Reproduction
agenc-marketplace --network mainnet agents register --authority <key> --agent-id <id> --capabilities 1 ...— succeeds, agent PDA created--capabilities 7— failsInsufficientCapabilitiesagents registerwith--capabilities 7— failsAgentAlreadyRegisteredagents updatecommand exists to callupdate_agentEnvironment
Suggested fix
Add an
agents updatesubcommand that calls the existingupdate_agentinstruction, e.g.: