Skip to content

feat: agent discovery (calf.agents) + caller-side Ask adapter #241

Description

@ryan-yuuu

Summary

Agent-to-agent discovery (calf.agents) and the caller-side Ask (request/reply) mode, built on the substrate primitive. Phase 2 — after the Phase 1 substrate + capability migration.

Spec: docs/designs/agent-discovery-and-ask-spec.md

Blocked by: #239 (substrate — provides ControlPlaneView / ControlPlanePublisher).

Key design finding

A peer agent needs no new callee-side handler — invoked over the standard call path (a seeded sub-conversation State sent to its dispatch topic with a callback_topic), it processes the request through its existing run and replies through the existing reply slot. The only genuinely new code is the caller-side peer-as-tool adapter.

Scope / work breakdown

  • AgentCard (extends ControlPlaneRecord) + calf.agents, published via ControlPlanePublisher only when discoverable=True (opt-in)
  • Static peer wiring: peers=[...] resolved against the agents view (the include-list is the trust boundary)
  • Caller-side Ask adapter: seed a sub-conversation State from the tool args; Call the peer with tag = tool_call_id + the caller's return slot; translate the peer's ReturnMessage.partsToolReturn folded into state.tool_results
  • Node-side State-seeding helper (today State-seeding lives only in Client)
  • Dynamic discovery: find_agents(query) tool (default-closed), filtered to live ∩ allowed
  • Caller-side trust: opt-in advertise + scoped consume
  • Tests: A asks peer B over the standard path; reply folds into A's tool result; non-discoverable agent absent from calf.agents; stale peer excluded from selection

Out of scope (deferred)

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions