Skip to content

CLI missing: agents update command — cannot update agent capabilities after registration #1564

Description

@newjordan

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:

  1. agents register --reuse or agents update --capabilities 7 to update the existing agent PDA, OR
  2. 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

  1. agenc-marketplace --network mainnet agents register --authority <key> --agent-id <id> --capabilities 1 ... — succeeds, agent PDA created
  2. Attempt to claim a task with --capabilities 7 — fails InsufficientCapabilities
  3. Re-running agents register with --capabilities 7 — fails AgentAlreadyRegistered
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions