Advertisement
Telegram ads for your business · TCA Media
Advertisement
Telegram ads for your business · TCA Media
AI

How to transfer a task from one AI agent to another while preserving context

The agent-hub has added the /handoff command: it prompts the agent to prepare a summary, sends it for review to a new Telegram topic, and launches another agent there.

10 Nov, 13:33Read in Russian
news.hamidun.com

The command is needed for transitions between agents that use different session formats. Instead of the entire history, the new agent receives a text containing the task objective, completed work, decisions made, modified files, and remaining steps.

Before sending, the summary can be reviewed and edited. It is limited to 3,000 UTF-16 units, valid for 15 minutes, and becomes invalid after a new move in the original session, snapshot restoration, or context change. After confirmation, the hub creates a Telegram topic, saves its binding, and launches the recipient with a new session.

The /save and /restore commands do not replace the handoff: they work with a snapshot of the same agent's session and do not transfer project files or login data. The new agent receives the confirmed summary but not the predecessor's history or permissions.

Advertisement
Telegram ads for your business · TCA Media

Both agents operate in the same directory. This allows the recipient to independently verify the code, but during parallel work, changes may overlap. The state of files may also change between preparing the summary and launching the new session.

The hub includes cancellation, protection against outdated buttons, and duplicate topic creation. Automatic retry of the Telegram request is not used: if the topic creation response is lost, a retry may result in a duplicate. Preparing the summary takes up to three minutes, and two summaries can be prepared simultaneously.

The functionality was tested with automated tests and manually using real agents via Telegram. The project code is published under the MIT license.