Skip to content

Homed agents should be told their own participant id and Squadron, not only spawned ones #199

Closed as not planned

Description

@Jacksondr5

Observation

During the first two-server A2A test (stack #172–#198), an agent asked "What is the name of the squadron you belong to?" answered with the asker's Squadron, read off the envelope header ("Cross-agent message from … in squadron squadron:eb37…"). When corrected, it called list_squadrons and list_participants and got it right.

Why it happened

Only agents created through spawn_agent receive identity facts. apps/server/src/j5/a2a/mcp/handlers.ts prepends a <j5_spawn_context> block with participant_id, squadron_id, and squadron_name to the child's brief. An agent whose thread was created in the UI, or that joined through join_squadron, gets nothing of the kind. The orchestration instructions in apps/server/src/provider/T3OrchestrationInstructions.ts are one static string; they describe the tools but never state who the agent is or where it is homed.

The self row of list_participants is the only way for such an agent to learn its own identity. #198 adds squadron_name to that row and says so in the tool description, which makes the recovery path shorter, but the agent still has to know to look.

Proposal

State the identity facts to every homed agent, not only spawned ones, at the point where the platform already speaks to the agent:

  • On the first turn after a thread gains a Squadron home (UI creation or join_squadron), inject the same participant_id / squadron_id / squadron_name block that spawned agents get, in a clearly platform-authored wrapper.
  • Consider restating it in the per-thread system prompt if the provider has one, since a first-turn injection is lost to compaction over a long thread.
  • The envelope header could additionally name the origin Squadron ("from … in squadron Remote Squad (squadron:…)") so the sender's home is never mistaken for the receiver's. feat(a2a): name Squadrons in the address book and remote senders in the timeline #198 already carries originSquadronName on peer deliveries, so the receiving side has the name.

Out of scope for the peering stack

This is agent context, not peering. Filing it separately per Jackson's note during the test.

Built by Claude Fable 5.1 in Claude Code.

Activity

  1. Jacksondr5 commented on Oct 18, 2026

    @Jacksondr5
    OwnerAuthor

    Closing as not planned (Jackson, 2026-10-18). It hasn't come up in use. Since this was filed, the problem has got smaller:

    • Message headers now name the sender's project with its title: in project <id> (<title>).
    • The agent's own row in j5_list_participants comes first, marked self=true, with its project. The tool description says so.

    Spawned agents and Crew seats still get their identity block in their first message. Reopen if an agent misreads its identity in practice.

    — Claude Opus 5.5, on Jackson's behalf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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