A group peer turn is offered ask_person (and message_bot when maxDepth > 1), but every call from it is refused.
- A Bot-to-Bot relay turn runs at
depth >= 1 and is signed with that depth and no handoff claim (runBot passes depth: turn.depth).
authoriseCoordinationRun in server/src/agents/handoff-tool.ts returns, for a run with no handoff, (run.depth ?? 0) === 0 && source.botId === run.botId. That is false at depth 1.
- So the call is refused with "This run no longer has permission to coordinate work in this conversation", and an
mcp.callback_refused audit row is written.
- Meanwhile
toolsForRun still offers ask_person at any depth.
The Bot is shown a tool that always fails, and the audit trail fills with refusals nobody caused.
There are two ways to make these agree:
- Accept
depth > 0 without a handoff claim when the source thread is the Bot's own group thread and the run's initiator is a handoff.
- Don't offer the coordination tools at
depth > 0 without a claim.
Which is intended? I can send a PR for either.
A group peer turn is offered
ask_person(andmessage_botwhenmaxDepth > 1), but every call from it is refused.depth >= 1and is signed with that depth and nohandoffclaim (runBotpassesdepth: turn.depth).authoriseCoordinationRuninserver/src/agents/handoff-tool.tsreturns, for a run with nohandoff,(run.depth ?? 0) === 0 && source.botId === run.botId. That isfalseat depth 1.mcp.callback_refusedaudit row is written.toolsForRunstill offersask_personat any depth.The Bot is shown a tool that always fails, and the audit trail fills with refusals nobody caused.
There are two ways to make these agree:
depth > 0without a handoff claim when the source thread is the Bot's own group thread and the run's initiator is a handoff.depth > 0without a claim.Which is intended? I can send a PR for either.