Feature: agents can address each other by name - #69
Merged
Merged
Conversation
Typing '@' now offers open agents ahead of project files, and an agent can check on another, read its conversation, ask it a real question, or hand it a whole job. Four tools, and only one of them wakes the other agent. Status, transcript reads and delegation progress are all assembled from state the host already keeps, so they cost nothing, cannot loop, and work while the target is mid-turn — which is exactly when 'have you finished X?' gets asked. An earlier design refused while busy; that would have failed the feature's most common question. The busy refusal now names the read tools instead, so busy degrades to reading rather than dead-ending. Delegation does not block. ask_agent held the asker's turn gate for the length of the job, so messages to it were dropped for minutes at a time; delegate_to_agent returns at once and reports back through an inbox. Progress is filed under ONE inbox id and overwritten, so a ten-minute job costs the same context as a ten-second one — an append-only feed would grow with the other agent's work and be paid for on every later turn. Completion appends a card to the delegating agent's transcript, which needs no model turn at all; the agent itself learns from its inbox next time it speaks. Identity is structural. The first version put attribution only in the host instruction, which the engine discards after the turn — so a relayed question stayed in history as an ordinary user turn, and an agent asked afterwards who it had been talking to could only report what the message 'claimed'. Every agent-to-agent message is now wrapped by the host, and Wrap strips any envelope already in the payload so 'only MandoCode adds this' is true rather than reassuring. The turn is also logged under its own role, so the distinction survives a restart — previously the question was not recorded at all, leaving a dangling answer in the re-brief and in read_agent_transcript. Turns are claimed, not checked. AnswerPeerAsync read the busy flag but never set it, so a peer question did not mark the agent busy: a user typing mid-answer, or a second agent asking at the same moment, got a concurrent turn on one chat history. One atomic gate now serves the user's turn, a peer's question and the setup wizard alike.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
You can now tag another agent by name. Type
@in any agent's chat and the other open agents are offered before project files — pick one, ask your question in plain language, and your agent works out what to do with it.From there it can check what that agent is doing, read its conversation, ask it a question and relay the answer, or hand it an entire job and carry on talking to you while it runs.
What it looks like
Nothing routes those by hand. The tools describe honestly what each of them costs and when each works, and the agent picks — which is why "has it finished?" gets answered from live state without waking anyone, while "is the work any good?" costs a real turn on the agent that did it.
Why this matters
Two agents working in different folders currently know nothing about each other. Anything one has learned has to be copied across by hand, and there is no way to ask the agent that already has the context. The most common question — "has the other one finished yet?" — has no answer at all short of switching tabs and reading.
Handing over work has the same gap. Asking another agent to build something meant waiting for it with no way to check progress, and no way to be told when it was done.
What is new
Four capabilities, and only one of them interrupts the other agent:
Supporting behaviour worth knowing about:
Scope and risk
Medium. The observation features carry very little risk; asking and delegating carry most of it, and both were built with that in mind.
Verification
Builds clean, 0 warnings and 0 errors. Full Desktop suite passes — 489 of 489, with 44 new tests covering name resolution (an ambiguous name resolves to nothing rather than guessing which agent you meant), chain limits including the concurrent case, the message labelling and its forgery handling, the progress summary staying constant-size under 200 updates, and the reporting of jobs whose agent closed mid-run.
Exercised by hand throughout, and four defects found that way are fixed here: relayed questions were not recorded at all, leaving answers with nothing that prompted them; the completion announcement repeated the whole brief instead of the outcome; the per-turn token figure sat against the wrong edge of its pill; and the concurrent-turn defect above.
Not covered by tests: the
@picker and the transcript are XAML and a WebView, so a reviewer should confirm the picker offers agents above files, that a same-named file is still reachable, and that a delegated job leaves the delegating agent responsive while it runs.Design notes
docs/agent-mentions.mdrecords the shape and the reasoning, including alternatives that were rejected and why — copying a transcript into the asking agent's context, a publish/subscribe broker, streaming the other agent's actions, and queueing work for a busy agent. It also records what was investigated and deliberately not built: reaching Desktop agents from the CLI.