Skip to content
This repository was archived by the owner on Sep 11, 2025. It is now read-only.

Conversation

@mattjohnsonpint
Copy link
Contributor

  • Adds agents.ListAll and agents.GetInfo APIs to both SDKs
  • Updates the agents.Stop API to return status info (aligning with the others)
  • Update examples to show usage.

@mattjohnsonpint mattjohnsonpint requested review from a team and Copilot May 29, 2025 00:16
@linear
Copy link

linear bot commented May 29, 2025

Copy link
Contributor

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 PR adds new agent management APIs that introduce methods to retrieve agent details and list all agents across both the Go and AssemblyScript SDKs. Key changes include:

  • Extending the Stop API to return agent status info.
  • Adding GetInfo and ListAll APIs in both SDKs.
  • Updating examples, host functions, and related runtime logic to support these APIs.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
sdk/go/pkg/agents/imports_wasi.go Updated WASI imports to return pointers for agent info retrieval.
sdk/go/pkg/agents/imports_mock.go Updated mock implementations for stop, get, and list agents.
sdk/go/pkg/agents/agents.go Refactored Stop and added GetInfo and ListAll APIs.
sdk/go/examples/agents/main.go Updated examples to match new API signatures and return values.
sdk/assemblyscript/src/assembly/agents.ts Added exports for new agent management APIs.
sdk/assemblyscript/src/assembly/agent.ts Updated agent functions to utilize new API behaviors and error checks.
sdk/assemblyscript/examples/agents/assembly/index.ts Updated example functions to use new API functions.
runtime/httpserver/health.go Adjusted health endpoint to use local agent listing.
runtime/hostfunctions/agents.go Registered new host functions for getting agent info and listing agents.
runtime/db/agentstate.go Added functions to retrieve agent state from ModusDB and PostgresDB.
runtime/actors/agents.go Refactored Stop API and added GetAgentInfo and ListActiveAgents.
CHANGELOG.md Documented addition of new agent management APIs.
Comments suppressed due to low confidence (2)

sdk/assemblyscript/examples/agents/assembly/index.ts:47

  • [nitpick] For consistency with other exported functions (e.g., stopAgent, getAgentInfo), consider renaming 'ListAgents' to 'listAgents'.
export function ListAgents(): AgentInfo[] {

runtime/actors/agents.go:224

  • [nitpick] Consider clarifying the naming distinction between 'ListActiveAgents' (which queries the database) and 'ListLocalAgents' (which returns agents from the local actor system) to reduce potential confusion for API consumers.
func ListLocalAgents() []AgentInfo {

@trunk-io
Copy link

trunk-io bot commented May 29, 2025

Running Code Quality on PRs by uploading data to Trunk will soon be removed. You can still run checks on your PRs using trunk-action - see the migration guide for more information.

@mattjohnsonpint mattjohnsonpint merged commit 0c12b71 into main May 29, 2025
86 checks passed
@mattjohnsonpint mattjohnsonpint deleted the mjp/hyp-3424-add-apis-to-get-agent-status-and-list-agents branch May 29, 2025 00:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants