Skip to main content
loomcycle
§ story · bridge-core v0.8.0

Every messenger bridge now carries files, voice and the agent's questions.

Three weeks of work turned our Teams, Slack, Discord and Telegram bridges from text pipes into full conversation channels

1. Where we left off in October

In October we wrote about putting loomcycle agents into Microsoft Teams, Slack, Discord and Telegram. Each bridge is a small npm package that sits between one chat platform and one loomcycle agent. A person writes to the bot, the bridge starts or steers an interactive run for that person, and the answer comes back into the chat. Each person is their own loomcycle user, with their own runs, memory and history.

That first version did one thing: text in, text out. People do not only type in a messenger. They send voice notes from the street. They drop a PDF into the chat and ask "what does this say?". And an agent that does careful work sometimes needs to stop and ask a question before it goes on.

Between November 6 and November 27 we closed those three gaps. The shared core, @loomcycle/bridge-core, is now at v0.8.0. The Teams bridge is at v0.7.1, and the Slack, Discord and Telegram bridges are at v0.5.3. On the runtime side, the work landed across loomcycle v1.167 to v1.171.

2. You can talk to the agent, and it can talk back

With BRIDGE_VOICE=1, a person can send a voice message instead of typing. The bridge downloads the recording, asks loomcycle to transcribe it, and hands the agent the text with a line (voice message) in front of it. From there the words travel the way typed words do. When the turn ends, the bridge can ask loomcycle to speak the reply and post it back as audio, labelled "AI voice". The text reply is always sent too, so nothing is lost if you cannot play sound right now.

Each platform does this a little differently, because each platform allows different things:

The detail we spent the most time on was language. Our first version sometimes picked the wrong voice. A Russian voice note from someone whose Telegram app is set to English was transcribed correctly, but the reply was read by the English voice. The platform's "language" for a person is the language of their app's menus, not the language they speak. And the agent may answer in a different language from the question.

So the bridge now sends no language when it asks for speech. loomcycle looks at the reply's own letters (Ukrainian, other Cyrillic, Latin) and picks the matching voice from the ones the deployment has. The reply is spoken in its own language, not the input's.

Every voice call uses the person's own token, so their budget and access rules apply. The audio lives in memory for one request and is never kept.

3. You can hand the agent a file

The second gap was files. With BRIDGE_FILES=1, a person can attach a document in their 1:1 chat with the bot, and the agent can read it. File intake is off by default, and it stays limited on purpose: 1:1 chats only, trusted speakers only, a size cap, a count cap and a list of types.

Before anything reaches the agent, the bridge checks the file. The type the platform declares and the file's extension must agree. Then the bridge checks the bytes themselves: a PDF must start like a PDF, a .docx must be a ZIP with the right parts inside, a text file must be UTF-8. An executable renamed to .docx is refused.

This needed two new things in the runtime, which shipped in v1.168.

First, the owner of a run can now put a file straight into that run's inbox with PUT /v1/runs/{run_id}/inbox/{name}. A token limited to certain agents, like the ones a bridge works with, needs the new inbox_put surface granted before it can do that. loomcycle records such a file as the person's upload, not as verified data.

Second, a live run can now take untrusted blocks as input. This is the part we care about most. The bridge sends the person's typed text as normal text, and then one attached_file block per file. That block is marked untrusted, so the agent reads it as data and never as instructions. The agent gets a reference into its inbox, a name, a type and a size. It never gets the bytes or the download link in its prompt.

Teams needed extra care. On some tenants, Teams delivers a file to a bot as an empty message with no download link at all. The file still sits in the sender's OneDrive, so the Teams bridge can now look the message up through Microsoft Graph and fetch the file from there. It takes the file only when it is in the sender's own OneDrive. There are two modes. App mode uses tenant-wide permissions. Delegated mode is the narrower one: each person signs in once, on their first file, and every Graph call uses their own token, so Graph limits the bridge to that person's own chats and files. We also added a token on file downloads, because from March 1, 2027 Microsoft requires a bot to send one, and a token from a plain client secret will no longer work. The bridge warns at start when it is configured in a way that will break on that date.

Both Graph modes are new and not yet confirmed on a live tenant; the README marks them as a preview.

4. The agent can ask you a question

The third gap matters most for real work. loomcycle has a tool called Interruption. An agent calls it to stop and ask a person something, and the run waits for the answer. In the web UI that has worked for a long time. In a chat, it was clumsy: you got a few buttons, and that was it.

In v1.171 and bridge-core v0.8.0 the question became a proper part of the conversation:

Here is what that looks like in Telegram:

Agent:  Which day should I send the weekly summary?
        1. Monday morning
        2. Friday afternoon
        3. Only when something changed
        Reply with a number or type your own answer, or tap a button.
        [1] [2] [3] [Decline]

You:    Thursday after the team call, and skip holiday weeks

Agent:  Got it. I'll send it on Thursdays after the team call
        and skip weeks with a public holiday.

We also made the answer check the same everywhere. Before, an A2A resume accepted any answer at all. Now one check runs on HTTP, gRPC, MCP and A2A. With options, the answer must be one of them unless the question allows another.

One more rule stays in place: a person the bridge does not trust, such as someone in a public group, may pick an option or decline, but may never type an answer of their own. A typed answer reaches the agent as trusted text, and we will not give that to an untrusted speaker.

5. Restarts no longer break the conversation

Containers get redeployed and loomcycle gets upgraded. Two things used to go wrong.

If the bridge restarted while a question was open, the question was gone. Now, with a file store (BRIDGE_STORE=file:<path>), the open question is saved with the conversation: its ids, its options, whether it allows your own answer, and the buttons drawn for it. On the first message after a restart, the bridge asks loomcycle whether the run is still waiting. If it is, the buttons and typed answers work again, and the agent's reply after your answer shows up in the chat. If it is not, the question is forgotten and your message goes on as a normal one.

If loomcycle restarted under a live run, a chat could get stuck. Now the person is told the connection was interrupted, and their next message ends the old run and continues the session in a new one.

6. One person, one user, wherever they sign in

A person might use the web UI through one sign-in gate and talk to the Teams bot through another. Without help, that is two loomcycle users for one human, with two separate histories.

An external gate can now set identity_map.same_subject_as to name another gate. Then a person's first sign-in through the bridge lands on the user the other gate already made. It is opt-in, and the config refuses to load any pairing that could join two different people.

The reverse case matters as well. When someone uninstalls the bot, the bridge revokes them. With on_revoke: unlink, that revoke ends only this gate's link (its tokens, groups and identity) for a person who also holds an identity at another gate. They lose the bot, not their whole account.

One more change makes a new chat feel less like starting from zero. An agent can set history_preload, and the first run of a new chat then gets one untrusted block with that person's recent chats with the same agent. It is off until an agent turns it on, it is never used on a continuation or a sub-agent, and it never includes another person's chats.

7. The bridges say no to unsafe setups

The last piece is less visible. On November 6 we went through the ways a bridge could be set up badly and made the bridge refuse them.

In October the bridges let you talk to an agent from the apps you already use. Now that conversation can include your voice, your documents and the agent's own questions, and it survives the restarts that happen in any real deployment.

Voice and files are off until you turn them on, and both run with the person's own token, budget and access rules. If you run one of the bridges, the READMEs under packages/bridge-* in the loomcycle repository have every setting. Tell us what breaks, especially on the Teams Graph path we have not yet seen on a live tenant.