Skip to content

Agent Version Hardcoded in Registration Payload #148

@rtdean93

Description

@rtdean93

I am trying to use the agentfield.yaml file when building my agent - as described in the docs - https://agentfield.ai/api/cli-reference/af-init

It would be great if this file was created when I use the CLI to build the templated agent.

I manually added it and I updated my main.py to register with those values if they exist. Yet, I found a few issues.

Bug #1: Agent Version Hardcoded in Registration Payload

Status: Open
Severity: Medium
Discovered: 2026-01-21
SDK Version: Latest (as of 2026-01-21)

Description

The AgentField Python SDK hardcodes the agent version to "1.0.0" in the registration payload, ignoring the version parameter passed to the Agent() constructor.

Location

File: agentfield/client.py
Method: AgentFieldClient.register_agent()
Line: ~535 (may vary by SDK version)

async def register_agent(
    self,
    node_id: str,
    reasoners: List[dict],
    skills: List[dict],
    base_url: str,
    discovery: Optional[Dict[str, Any]] = None,
    vc_metadata: Optional[Dict[str, Any]] = None,
) -> Tuple[bool, Optional[Dict[str, Any]]]:
    """Register or update agent information with AgentField server."""
    try:
        registration_data = {
            "id": node_id,
            "team_id": "default",
            "base_url": base_url,
            "version": "1.0.0",  # <-- BUG: Hardcoded version!
            "reasoners": reasoners,
            "skills": skills,
            # ... rest of payload
        }

Expected Behavior

When an agent is initialized with a specific version:

app = Agent(
    node_id="my-agent",
    version="2.5.3",  # Custom version
    agentfield_server="http://localhost:8080"
)

The registration payload sent to the AgentField server should include "version": "2.5.3".

Actual Behavior

The registration payload always sends "version": "1.0.0" regardless of the version parameter.

Impact

  1. No Version Tracking: Agents cannot properly track their version numbers in the AgentField dashboard
  2. Breaks Semantic Versioning: Teams cannot use semantic versioning for agent deployments
  3. Deployment Issues: Cannot differentiate between agent versions when multiple versions are deployed
  4. agentfield.yaml Ignored: The version field in agentfield.yaml is effectively ignored

Reproduction Steps

  1. Create an agent with a custom version:

    from agentfield import Agent
    
    app = Agent(
        node_id="test-agent",
        version="2.0.0",
        agentfield_server="http://localhost:8080"
    )
  2. Start the agent and register with AgentField server

  3. Check the AgentField dashboard or query the agent registration

  4. Observe that version shows as "1.0.0" instead of "2.0.0"

Workaround

We've implemented a monkey-patch in main.py that overrides the register_agent method to use the actual version from the Agent instance:

# Monkey-patch location in our code
# File: main.py
# Lines: 48-141

from agentfield.client import AgentFieldClient

# Store the version from yaml_config
agent_version = yaml_config.get("version", "1.0.0")

# Create patched version of register_agent that uses actual version
async def patched_register_agent(self, node_id, reasoners, skills, base_url, ...):
    registration_data = {
        "id": node_id,
        "version": agent_version,  # Use actual version
        # ... rest of payload
    }
    # ... rest of implementation

# Apply the patch
AgentFieldClient.register_agent = patched_register_agent

See main.py:48-141 for full implementation.

Suggested Fix

The SDK should be modified to:

  1. Store version in client: Pass the agent version to the AgentFieldClient when it's instantiated
  2. Use stored version: Reference the stored version in the registration payload

Proposed code change in agentfield/client.py:

async def register_agent(
    self,
    node_id: str,
    reasoners: List[dict],
    skills: List[dict],
    base_url: str,
    discovery: Optional[Dict[str, Any]] = None,
    vc_metadata: Optional[Dict[str, Any]] = None,
    version: str = "1.0.0",  # Add version parameter
) -> Tuple[bool, Optional[Dict[str, Any]]]:
    """Register or update agent information with AgentField server."""
    try:
        registration_data = {
            "id": node_id,
            "team_id": "default",
            "base_url": base_url,
            "version": version,  # Use parameter instead of hardcoded value
            "reasoners": reasoners,
            "skills": skills,
            # ... rest of payload
        }

And in agentfield/agent_field_handler.py, update the call to include version:

success, payload = await self.agent.client.register_agent(
    node_id=self.agent.node_id,
    reasoners=self.agent.reasoners,
    skills=self.agent.skills,
    base_url=self.agent.base_url,
    discovery=discovery_payload,
    vc_metadata=self.agent._build_vc_metadata(),
    version=self.agent.version,  # Add this line
)

Bug #2: Missing Metadata Fields in Registration

Status: Open
Severity: Low
Discovered: 2026-01-21
SDK Version: Latest (as of 2026-01-21)

Description

The AgentField SDK does not send agent metadata (description, tags, author) from agentfield.yaml during registration, even though these fields are part of the YAML schema.

Location

File: agentfield/client.py
Method: AgentFieldClient.register_agent()

Expected Behavior

When an agentfield.yaml file contains:

node_id: my-agent
version: 1.0.0
description: My production agent
tags:
  - production
  - analytics
author:
  name: Bobby Dean
  email: bobby@example.com

These fields should be included in the registration payload sent to AgentField server.

Actual Behavior

The description, tags, and author fields are not included in the registration payload. The SDK only sends:

Impact

  1. No Agent Discovery by Tags: Cannot filter/search agents by tags in AgentField dashboard
  2. Missing Documentation: Description is not visible in the control plane
  3. No Author Attribution: Cannot track who maintains which agents
  4. agentfield.yaml Partially Ignored: Core metadata fields in the YAML are unused

Workaround

We've extended our monkey-patch to include these fields in metadata.custom:

registration_data = {
    "id": node_id,
    "version": agent_version,
    "metadata": {
        "deployment": { ... },
        "performance": { ... },
        "custom": {
            "description": agent_description,
            "tags": agent_tags,
            "author": agent_author,
        },
    },
}

See main.py:104-108 for implementation.

Suggested Fix

  1. Add metadata parameters to register_agent() method
  2. Include in registration payload at the top level or in a dedicated metadata section
  3. Auto-load from agentfield.yaml in the Agent class constructor

Proposed addition to registration payload:

registration_data = {
    "id": node_id,
    "team_id": "default",
    "base_url": base_url,
    "version": version,
    "description": description,  # Add this
    "tags": tags,                # Add this
    "author": author,            # Add this
    "reasoners": reasoners,
    "skills": skills,
    # ... rest of payload
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions