Skip to content

feat(models): introduce native models for OpenAgents with A2A compati…#233

Merged
zomux merged 6 commits intodevelopfrom
feature/guidedocs
Jan 9, 2026
Merged

feat(models): introduce native models for OpenAgents with A2A compati…#233
zomux merged 6 commits intodevelopfrom
feature/guidedocs

Conversation

@zomux
Copy link
Copy Markdown
Contributor

@zomux zomux commented Jan 8, 2026

…bility

  • Added native models: Skill, Artifact, Task, and AgentProfile, extending A2A protocol models.
  • Implemented bidirectional conversion functions between native and A2A models.
  • Enhanced task delegation mod with A2A compatibility, including delegation lifecycle events and capability matching utilities.
  • Updated tests for native models and capability routing to ensure functionality and compatibility.

…bility

- Added native models: Skill, Artifact, Task, and AgentProfile, extending A2A protocol models.
- Implemented bidirectional conversion functions between native and A2A models.
- Enhanced task delegation mod with A2A compatibility, including delegation lifecycle events and capability matching utilities.
- Updated tests for native models and capability routing to ensure functionality and compatibility.
Copilot AI review requested due to automatic review settings January 8, 2026 20:54
@vercel
Copy link
Copy Markdown

vercel bot commented Jan 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
openagents-studio Ready Ready Preview, Comment Jan 9, 2026 4:25am

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request introduces native models for OpenAgents with A2A protocol compatibility, representing a significant architectural enhancement:

Purpose: Add native OpenAgents models (Skill, Artifact, Task, AgentProfile) that extend A2A protocol models while maintaining backward compatibility, and enhance task delegation with capability-based routing.

Key Changes:

  • Native model implementations with bidirectional A2A conversion
  • Enhanced task delegation mod with A2A compatibility and capability-based routing
  • External delegator for cross-network A2A task delegation
  • Capability matcher utilities for structured and LLM-based agent matching
  • Discovery mod enhancements for skill announcement

Reviewed changes

Copilot reviewed 39 out of 40 changed files in this pull request and generated 25 comments.

Show a summary per file
File Description
src/openagents/models/*.py New native models: Skill, Artifact, Task, AgentProfile with A2A conversion
src/openagents/utils/native_converters.py Bidirectional converters between native and A2A models
src/openagents/mods/coordination/task_delegation/mod.py Major refactor to use A2A Task model with delegation metadata
src/openagents/mods/coordination/task_delegation/a2a_delegation.py A2A delegation utilities and metadata helpers
src/openagents/mods/coordination/task_delegation/capability_matcher.py Capability-based agent matching with structured and LLM support
src/openagents/mods/coordination/task_delegation/external_delegator.py External A2A agent delegation handler
src/openagents/mods/coordination/task_delegation/adapter.py Enhanced adapter with routing, accept/reject, and cancel operations
src/openagents/mods/discovery/agent_discovery/adapter.py New announce_skills tool for capability broadcasting
src/openagents/mods/discovery/agent_discovery/mod.py Configurable connection/disconnection broadcasting
tests/models/test_native_models.py Comprehensive tests for native models and conversions
tests/mods/test_capability_routing.py Tests for capability matching and routing
src/openagents/core/transports/a2a.py A2A transport delegation methods
src/openagents/utils/mod_loaders.py Support for mod config dictionaries
src/openagents/utils/agent_loader.py Enhanced mod configuration processing
studio/src/components/editors/LazyMonacoEditor.tsx Lazy-loaded Monaco editor for performance
studio/craco.config.js Code splitting configuration
Various UI files Monaco editor lazy loading and UI improvements

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

task = Task(**task_data)

# Store in TaskStore
asyncio.create_task(self.task_store.create_task(task))
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

The asyncio.create_task call on line 264 is used for loading tasks at initialization, but there's no mechanism to await or track this task. If the application shuts down before this task completes, tasks may not be loaded. Consider awaiting this operation during initialization or adding it to a tracked task list.

Copilot uses AI. Check for mistakes.
}

def shutdown(self) -> bool:
async def shutdown(self) -> bool:
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

The shutdown method signature changed from synchronous to asynchronous, but this is a breaking change. The base class BaseMod likely has a synchronous shutdown method, and this override makes it async without updating the base class contract.

Copilot uses AI. Check for mistakes.
# Cleanup - use sync shutdown for tests
import asyncio
try:
loop = asyncio.get_running_loop()
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

Variable loop is not used.

Copilot uses AI. Check for mistakes.
{"id": "minimal", "name": "Minimal Skill"},
]

result = await discovery_adapter.announce_skills(skills)
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

Variable result is not used.

Copilot uses AI. Check for mistakes.
import sys

# Temporarily remove a2a module to simulate no A2A
a2a_modules = [k for k in sys.modules.keys() if "a2a" in k.lower()]
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

Variable a2a_modules is not used.

Copilot uses AI. Check for mistakes.
Comment on lines +12 to +21
from openagents.models.a2a import (
AgentSkill,
Artifact as A2AArtifact,
Task as A2ATask,
TaskState as A2ATaskState,
TaskStatus,
TextPart,
AgentCard,
AgentCapabilities,
)
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

Import of 'AgentCapabilities' is not used.

Copilot uses AI. Check for mistakes.
import asyncio
import aiohttp
from bs4 import BeautifulSoup
from typing import Dict, Any
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

Import of 'Any' is not used.
Import of 'Dict' is not used.

Suggested change
from typing import Dict, Any

Copilot uses AI. Check for mistakes.
Web search tool using DuckDuckGo (no API key required)
"""
import asyncio
from typing import Dict, Any
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

Import of 'Any' is not used.
Import of 'Dict' is not used.

Suggested change
from typing import Dict, Any

Copilot uses AI. Check for mistakes.
self._polling_tasks[local_task_id].cancel()
try:
await self._polling_tasks[local_task_id]
except asyncio.CancelledError:
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

'except' clause does nothing but pass and there is no explanatory comment.

Suggested change
except asyncio.CancelledError:
except asyncio.CancelledError:
# Cancellation is expected when stopping the background polling task.

Copilot uses AI. Check for mistakes.
try:
await self._timeout_task
except asyncio.CancelledError:
pass
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

'except' clause does nothing but pass and there is no explanatory comment.

Suggested change
pass
logger.debug("Timeout checker task cancelled during shutdown")

Copilot uses AI. Check for mistakes.
- Removed the SYSTEM_EVENT_REPORT_LLM_LOG event and associated handling from the system commands.
- Updated EventBasedLLMLogger to log LLM calls locally instead of sending them to the network.
- Cleaned up related code and documentation to reflect the change in logging strategy.
…rkflow

- Introduced a new demo showcasing a coordinated multi-agent workflow for finding and comparing alternative web services.
- Added `network.yaml` for network configuration and project template.
- Created `README.md` detailing architecture, workflow, and usage instructions.
- Implemented `coordinator.py`, `searcher.yaml`, and `comparer.yaml` for agent functionalities.
- Developed tools for web searching and webpage fetching to support agent operations.
- Included a test script `test_workflow.py` to validate the end-to-end workflow.
- Enhanced `network_readme.yaml` and `network.yaml` with improved formatting and additional fields for clarity.
- Added `initialized` and `created_by_version` attributes to both network configurations.
- Updated README content in `network_readme.yaml` for better documentation of features and usage.
- Adjusted agent group configurations and transport settings for consistency across test networks.
- Modified `agent_loader.py` to auto-include messaging mod for WorkerAgent, improving mod management.
- Updated tests to reflect changes in tool availability and task delegation constants.
- Simplified the logic for identifying WorkerAgent subclasses by consolidating checks for class type, class name, and string representation.
- Improved handling of mock classes in tests to ensure accurate detection of WorkerAgent instances.
- Enhanced code readability and maintainability by reducing nested try-except blocks.
…tatus handling

- Introduced new task status constants to reflect the updated task lifecycle, with tasks starting as "submitted" instead of "in_progress".
- Refactored test cases to utilize the new A2A Task model, ensuring accurate task state verification and metadata handling.
- Enhanced task creation and state retrieval methods to align with the updated task structure and asynchronous shutdown processes.
- Updated assertions in tests to validate task delegation, progress reporting, and completion handling with the new model.
@zomux zomux merged commit 0d3dd72 into develop Jan 9, 2026
6 checks passed
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.

3 participants