75 Commits
Author SHA1 Message Date
Aleksander DygońandClaude Opus 5.5 f1357b2057 Tell a Telegram chat with no link how to link it (#12043)
* Tell an unlinked Telegram chat how to link it

A Telegram chat that adds the shared OpenBot bot without the one-use link
from the app has no route, so Signal discarded each update with no reply.
A user who mentioned the bot got silence and no hint.

Signal now sends one notice in such a chat when a direct message, a
mention or a command arrives and the account service answers that no host
has the chat. The text comes from the new status.messaging.telegramNotLinked
key and names the app path: Marketplace > Apps > Telegram > Add to a group
or Open a direct chat.

- The notice is sent only on a real lookup answer with hostId null. A failed
  lookup, a chat linked to an offline host, a chat that a link just routed,
  replies, threads, renames, leaves and button presses get none.
- At most one notice per chat per 24 hours, in a bounded in-memory map. The
  time is kept before the call, a failure is not retried or logged, and the
  call has no reply or thread parameters.
- A link now forgets the cached "no host" lookup of its chat.
- Slack still answers 503 for a team with no host.
- remote/api depends on @openbot/i18n, and the Dockerfile copies it.
- TELEGRAM_TEST_API_ORIGIN (loopback only) points Signal at a fake Bot API
  in scripts/signal-security-e2e.ts, which checks the notice cases.

Fixes #11875

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep the Telegram notice out of chats that Signal saw linked

- Skip the notice for a chat that this Signal saw linked, revoked or
  named in a route ticket. A lookup that started before a link and
  answered after it can no longer send the notice.
- Ignore a TELEGRAM_TEST_API_ORIGIN that is not a loopback address,
  instead of turning off Telegram.
- In the Signal E2E, wait for the notice of a later chat before the
  count, so that a second notice cannot come after the assertion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 14:49:50 +01:00
Aleksander DygońandClaude Opus 5.5 ebbd9e428f Send Discord text and one file as one message (#14391)
* Send Discord text and one file as one message

messaging_post sent the text of a Discord post first and then each file
as its own message, because the Discord adapter had no postFileWithText
and the Signal upload op could not carry text.

The upload op now takes an optional content field. Signal sends it with
the file in one create-message call, with the same user mentions as a
text post. DiscordAdapter.postFileWithText uses it when the text fits
one chunk. When Signal refuses the call with invalid_request (a Signal
that is not updated yet, which rejects the unknown field), it returns
null and the service uses the old text-then-file path. The result keeps
the Discord message URL.

Deploy Signal before the desktop release. Until then, posts keep the old
two-message behavior.

Fixes #14378

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Post the text when Discord refuses the file of a captioned post

When Discord refused the one-message upload, for example a bot that may
send messages but not attach files (forbidden), postFileWithText failed
and the post text was lost. Before the captioned path, the text was
posted and the file was reported as skipped.

Now every refusal that proves that no message was made returns null, so
the service posts the text and then tries the file as before. A result
that can mean that Discord posted already (unreachable, invalid_answer,
discord_failed, or an HTTP 5xx with no Signal error body) still fails,
so the text is not posted twice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:13:16 +01:00
Aleksander DygońandClaude Opus 5.5 03c2ff34c2 Remove code comments and add the no-comments rule (#12604)
* Remove code comments and add the no-comments rule

Remove the comments from first-party code and configuration files:
TS/JS, JSX, CSS, SQL migrations, Swift, Kotlin, Gradle, shell,
Docker, systemd, Nix, YAML, TOML, JSONC and GritQL.

Keep only what a tool reads: license headers, shebangs, compiler
and lint directives, JSDoc types in plain .js files, generated file
headers, GritQL scope lines, the install-server.sh help text and the
openbot-boat-pre-stop marker. Vendored code, fixtures and released
schemas keep their comments.

Add the rule to AGENTS.md, and change the docs that asked for
comments. Add two i18n keys that only comments named to
RELEASED_SOURCE_KEYS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep comments that are data in strings

The benchmark task files in opencode-free-models-bench.ts tell the
model what each function must do. The sample file and HTML page in
the two stories are display content. Put their comments back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep released migrations and mobile native inputs unchanged

check:migrations compares each released migration with v0.73.0 byte
for byte, so restore src/backend/migrations. A change to a native
build input of apps/mobile makes a new runtime version, so restore
those files and the extra fingerprint sources.

List these files and the comment markers that a tool reads in
AGENTS.md. Remove the last requests for comments in
src/renderer/AGENTS.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 12:19:28 +01:00
Aleksander DygońandClaude Opus 5.5 db0081c71a Connect the Discord bot again after a fatal Gateway close (#12673)
* Connect the Discord bot again after a fatal Gateway close

Signal's Discord Gateway stopped for good after a fatal close code
(4004, 4010-4014). The library does not connect again after these codes,
and Signal replaced the manager only after a refused Message Content
intent. The Discord API route continued to work, so hosts showed
"Connected" and posts worked, but no mention arrived.

Signal now checks the shard status each minute. After 2 checks in a row
without each shard ready, a new manager replaces the Gateway. A new
manager also asks Discord for the shard count again. Each replacement
that does not get ready doubles the number of checks, up to 32, so a
refused token or intent does not use up the daily session starts. The
intent fallback uses the same replacement.

Fixes #10939

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Replace only a stopped Discord Gateway, and end the old manager

The local review found these problems in the first version:

- The check replaced a shard that the library was still resuming, so the
  events that a resume replays were lost. Now only an idle shard counts:
  the library leaves a shard idle after a fatal close code, and for only
  0.5 seconds when it connects again.
- The connect of a first connection that gets a fatal close never ends.
  The replacement now interrupts that fiber.
- A manager that was destroyed during its REST call still connects. It is
  now destroyed when its connect ends.
- The events of a replaced manager changed the shared state. They are
  now ignored.
- The intent fallback did not reset the count of checks.
- A new shard count kept the closed shards of the old count, so the guild
  reconcile could stop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 11:56:42 +01:00
NB ad4e6920e7 Close security gaps found in the security review (#12307)
* Close security gaps found in the security review

- Team API: a member does not see or use the browser tabs of an agent at
  `none`, and cannot open a tab for that agent. Routes and events use
  the same test.
- Remote viewer proxy: each joined server has its own path secret, and
  HTTP reaches only the remote-screen routes.
- Logging: redact tokens after any Authorization scheme, name and value
  pairs, Google OAuth tokens, Telegram bot tokens and webhook addresses.
- Network guard: refuse the rest of ::/64 (IPv4-compatible and SIIT).
- Pi on Windows: run where.exe from System32, not from the agent folder.
- Mobile: delete the phone copy when the session expires, and at a start
  with no session.
- Signal: compare the metrics token in constant time. TURN: deny all of
  ::/96 and the IPv4-mapped range as peers.
- Tests: a closed-agent tab check in the Team API routes E2E, IPv6 cases
  in the MCP OAuth E2E, and a new remote viewer proxy E2E in CI.

* Stop tab access at once when an agent closes to a member

- When the roles close an agent to a member, the host gives back that
  member's hold of the agent's tabs and closes the member's live views.
- The browser control state and its event show only the tabs that the
  member can see.
- The TURN server refuses all of ::/64, also the SIIT range.
2026-11-18 21:57:17 +01:00
NB 00c20726be Measure the public traffic of servers (#11881)
* Measure the public traffic of servers

- Add `leaseweb-pool.ts traffic`. It shows the public traffic in and out of each VPS on the four
  Leaseweb accounts for a period, and the part of the traffic pack of its contract. The output has
  no email.
- The Signal capacity reporter sends `network_in_bytes` and `network_out_bytes` on
  `signal_capacity` (generation 3), from the kernel counters of the interface of the default route.
- The smoke test checks the traffic values and that a Docker bridge is not counted.

* Keep the traffic base when the counters cannot be read

- The capacity reporter keeps the network base after a sample that could not read the counters, and
  reads the counters with the metrics.
- `leaseweb-pool.ts traffic` refuses a day that does not exist, names each account with no key,
  reads the VPS and its traffic at the same time, and takes no new VPS after a failure.
- The smoke test checks that an event with no counters keeps the base.
2026-11-18 11:13:38 +01:00
Aleksander DygońandClaude Opus 5.5 1c5ef14037 Keep the newest Discord threads in the list of places (#11204)
* Keep the newest Discord threads in the list of places

On a Discord server with more than 500 postable channels and threads,
Signal cut the list at 500 after the channels. The newest threads were
lost, and the agent did not know that the list was incomplete.

Signal now puts the threads newest first, so the limit drops the oldest
ones. The answer has an optional `omitted` count. The host tells the
agent how many places are not listed, and that messaging_post also takes
the id of a place that is not listed. An older host ignores the count,
and a newer host reads a missing count as 0. The 500 limit stays, so
released hosts keep accepting the answer.

Fixes #10957

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Check the Discord place list of a large server in the E2E test

Add a step to the Discord access E2E test: a server with 182 channels
and 330 active threads goes through Signal's listChannels and the
host's Discord driver. The step checks that the list keeps all
channels and the newest threads, that the agent gets a note with the
count of places left out, and that an answer from an older Signal
still decodes. The step fails with the earlier Signal code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 13:42:20 +01:00
NB cfdf04dbd1 Start a sleeping hosted server when a webhook routine gets a delivery (#7232)
* Start a sleeping hosted server when a webhook routine gets a delivery

Signal answers 503 when the host is not connected, as before, and now also
asks the account service to start a sleeping hosted server. The sender's
retry then reaches the server. A per-host wake interval of 30 minutes and a
per-address lookup limit stop abuse. An older account service rejects the
new route platform, so nothing starts there.

* Let a failed webhook wake try again and limit all webhook lookups

A start that the account service did not confirm no longer blocks the
host for 30 minutes. All addresses together ask the account service at
most the message limit a minute. A route of a host ID that another owner
registered again does not start that host. The docs say that a later
retry, not the next one, reaches the server.

* Ask again to start a hosted server that stays starting after a failed resume

A failed resume keeps the server row running, so the account service
answers starting. A webhook now asks for the start again in that state,
at most once in the same 30-minute interval for each host.

* Count each webhook wake request against the lookup limits

After a failed wake, the cached sleeping answer let each request send a
new wake request with no limit. Each wake request now passes the
per-address and total lookup limits too.
2026-11-11 00:35:14 +01:00
NorbertandDevin 037d447def Keep the phone connected across returns and network moves (#5913)
* Keep the phone connected across returns and network moves

Users say the phone often disconnects and comes back online slowly after a
return to the app. Each return after about 2.5 minutes made a new connection
with all of its steps in a row and loaded the whole workspace again.

- Signal keeps a client connection of a multiplexing host for 10 minutes
  after its socket closes (30 s before), and names the grace in `ready`
  (`reconnectGraceMs`, optional). The phone replaces its connection only
  after that time; with an older Signal it keeps the 160 s rule.
- A return with the kept connection checks the path and reads the open
  chats; it does not load the workspace again. A stopped read, an event
  reset, a refresh or a failed check still load everything.
- A move between Wi-Fi and mobile data (expo-network), also one seen at a
  return, ends the connection, and the recovery makes a new one on the same
  session at once. In support logs an ICE restart after such a move did not
  bring the path back within 6 s, and a new connection was up in 1.5-3 s.
- The peer counts its ICE restarts. After 10 it makes a new connection on
  the same session, because the host drops the connection at the 11th. A
  second restart while one runs is not sent, and a probe waits up to 6 s for
  a running restart before it calls the path dead.
- A new connection to a known host opens its Signal socket during the
  ticket request and gathers ICE candidates before `ready`.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* Refresh TURN credentials of a prepared connection from their age

A connection made before `ready` gathers its relay candidates with the
cached ICE servers, up to 30 minutes old. `setConfiguration` does not
replace them until the next gathering, but the TURN refresh was scheduled
45 minutes after `ready`, so a relay-only path could lose its allocation
before the refresh. The refresh is now due 45 minutes after the cached
servers arrived.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-09 14:51:44 +01:00
Aleksander Dygoń cb1b00e089 Send Discord embeds from the messaging_post tool (#5895)
* Send Discord embeds from the messaging_post tool

An agent can give up to 10 Discord embed objects to messaging_post. The
text is optional when the post has embeds. A long text goes in more
than one post, and the embeds go on the last post. Each embed text and
link is redacted, the same as the post text.

Signal validates each embed with Discord's limits and sends it as it is.
A host sends the embeds key only with at least one embed, so a plain post
continues to work with an older Signal. Deploy Signal before the hosts.

The tool shows an embed as an object with no fixed keys, and decodes the
call with the full schema. The catalog budget goes up by 164 bytes.

Fixes #5882

* Rename the release notes file to the branch name

* Put Discord embeds on the first post of a long text

When Signal or Discord refuses the embeds, nothing is posted now. Before,
the first parts of a long text stayed posted and its last part was lost.
messaging_post also accepts an empty embeds list as no embeds.

* Let Signal read a Discord call with 10 embeds

Signal refused a JSON Discord call larger than 64 KB. A post with 10
embeds can have 60 links of up to 2,048 characters, so a post that both
checks accept got 413. The limit is now 512 KB.
2026-11-09 13:03:57 +01:00
Aleksander DygońandClaude Opus 5.5 2bd7d18eef Ping the Discord user that a new OpenBot post mentions (#5401)
Signal sent every Discord post with no allowed mentions, so a reminder
showed the user but sent no notification. A new text post now allows
user mentions. Roles, @everyone and the replied author still get no
ping. Edits, uploads and private replies stay unchanged.

Fixes #5397

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 17:27:00 +01:00
NBandClaude Opus 5.5 1b5f44bd2f Record webhook use in analytics (#5328)
* Record webhook use in analytics

The host now sends a system_webhook_delivery event for each webhook
request: owner kind, result, reason, status, body size, handle time,
delivery age and the test flag. It sends at most 60 events a minute and
then a skipped_count. It sends no address, secret, event type or body.

Routine run events now show webhook runs with trigger_type webhook.
system_inventory adds webhook_route_count. Routine and workflow actions
report webhook_route_limit when the host refuses a new address.
signal_capacity adds the webhook answers by status and the wait time.

Generations: desktop_host 16, desktop 13, signal_capacity 2.
scripts/webhook-analytics-e2e.ts checks the events and the redaction.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Count Signal webhook waits of 5 s or more as slow

ANALYTICS.md says 5 s or more; the code counted only waits over 5 s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Count a Signal webhook wait only after Signal sends the frame

Signal timed each generic webhook answer from app.ts, so a request that
deliverWebhook refused or could not send (no peer, full pending budget,
refused format) counted as a wait of about 0 ms. #deliver now times the
wait from the frame to the answer, timeout or cancel.

Also stop exporting WebhookDeliveryResult and WebhookIgnoredReason,
which knip reports as unused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Leave out absent webhook analytics values with exact optional types

types:ratchet allows no exactOptionalPropertyTypes errors in
src/main/analytics.ts. The webhook delivery and routine run events now
add an optional value only when it is set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 12:30:54 +01:00
NBandClaude Opus 5.5 18c421d1fd Accept Standard Webhooks requests on webhook routines (#4788)
* Accept Standard Webhooks requests on webhook routines

Composio, Svix, Clerk and Resend sign webhooks in the Standard Webhooks
format and make their own signing secret. Before this change, a webhook
routine accepted only the X-OpenBot headers, so an agent told the user
that a Composio trigger could not connect to OpenBot.

- Signal accepts the webhook-* and svix-* headers. It relays them only to
  a host that names "standard-webhooks" in its ingress hello. An older
  host gets 401.
- The host checks the v1 signature with the raw secret or the base64 key
  after whsec_. The complete body becomes the event data, so a filter can
  read /metadata/trigger_slug.
- A person can paste the sender's secret in the routine editor or on the
  chat card. Remote hosts advertise this with webhook-sender-secret-v1.
  The secret goes in the existing encrypted column: no migration.
- Agent guidance names Composio, and request_api_key also covers
  passwords for local services such as IMAP or Proton Mail Bridge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Fix the review findings of the Standard Webhooks change

- Signal checks the webhook format on the socket that gets the frame, not
  only before it reads the body.
- Signal drops a webhookFormats list that it does not know, not the hello.
- A whsec_ secret gives a base64 key only when it is exact base64 of at
  least 16 bytes.
- A Standard Webhooks timestamp sets occurredAt only when it is ISO 8601.
- The joined-server capability check needs webhook-sender-secret-v1.
- The sender-secret dialog focuses its field, submits on Enter, disables
  the field while it saves, and has no delete icon. The action also shows
  beside a new secret, and a saved sender secret finishes step 2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep the secret row actions in one cell

The secret row had four grid items in three columns, so the sender-secret
action went to a new line. The actions now share the last column.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Do not export the Signal webhook delivery response type

Knip reports it as an unused export.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 21:52:25 +01:00
NBandClaude Opus 5.5 7cb7967f63 Copy the WhatsApp package manifest into the Signal image (#4771)
The Signal image runs bun install --frozen-lockfile with only the copied
workspace manifests. packages/whatsapp (#4079) was missing, so the build
failed for v0.60.0.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 19:50:45 +01:00
Aleksander DygońandClaude Opus 5.5 be681fd00f Give the agent the embeds of a Discord message (#4741)
* Give the agent the embeds of a Discord message

Discord bots, such as ticket bots, put their text in embeds. Signal read
only the text and files of a message, so a reply to a ticket form gave
the agent only "@user Welcome".

Signal now reads the embeds of the replied-to message, of a forward and
of `listMessages`. It sends each embed as text in the new optional
`embeds` field: author, title, link, description, fields, footer, and
the image, thumbnail and video links. It leaves out empty parts. An
older Signal sends no field, and the host then uses an empty list. The
host puts each embed in the context, and keeps an earlier message that
has only embeds.

The Discord access E2E check now covers a reply to a ticket form and an
earlier link preview.

Fixes #4732

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Limit Discord embed text and name its mentions

Signal now limits the text of all embeds of one message to 6,000
characters, Discord's own limit. The quote and the history then stay in
the host's context limits and in the frame limit.

An embed of an unexpected shape no longer fails a page of history:
Signal leaves out the embeds of that message.

The host puts the file names before the embeds, so that a cut of a long
reply keeps them, and it names the people that an embed mentions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 17:23:32 +01:00
NBandClaude Opus 5.5 984971190f Add Discord triggers and outputs to workflows (#4531)
* Add Discord triggers and outputs to workflows

A workflow can start when a person mentions OpenBot in a Discord server.
The trigger can filter by channel, role and text. A mention that a
workflow takes does not go to the agent. A Discord output can reply to
the message, post in a channel, or add a reaction.

Migration 50 adds the 'discord' run source to workflow_runs. Only the
owner or an admin can edit Discord nodes through the Team API.

Signal now also passes on a mention of the bot's own role, which
Discord's autocomplete often chooses instead of the bot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Fix the Discord workflow review findings

- A Discord output acts on a trigger message only in a run that a
  mention started. A webhook payload with the same frame cannot make
  OpenBot reply or react in Discord.
- A Discord reply or post does not send the trigger's raw event. When
  the text is only that event, the step fails and tells the user to put
  an agent between the trigger and the output.
- A mention that Signal gives again while its run is open is not
  skipped. After one run started, a later store failure does not send
  the mention to an agent too.
- The Discord reply and post use the shared outbound post path.
- Add scripts/workflow-discord-e2e.ts and run it in CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 17:29:45 +01:00
Aleksander DygońandClaude Opus 5.5 ee14ad9424 Answer 200 to Slack chatter for a host that is not connected (#4436)
* Answer 200 to Slack chatter for a host that is not connected

Signal answered 503 to every Slack event of a workspace whose host had no
ingress socket. The OpenBot app gets every message of every public channel,
so one busy workspace with its computer off made more than 95% of the
deliveries fail for 60 minutes, and Slack turned off events for the whole
app. Mentions and direct messages then stopped in every workspace, with no
error in OpenBot.

Now only an event that addresses OpenBot (mention, direct message, thread
reply, button) gets 503, so Slack still sends it again to a host that comes
back. Any other event gets 200.

Fixes #4345
Fixes #4404

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep Slack retries for events that are not chatter

Only a message that does not address OpenBot gets 200 when no host socket
holds the workspace. Other events, such as app_uninstalled and
channel_created, keep 503, so a host that comes back soon still gets them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 11:16:19 +01:00
NBandClaude Opus 5.5 39b2a95052 Start workflows from GitHub events and change GitHub from workflows (#4288)
* Fix workflow node fades and ports in browsers without scroll timelines

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Add the GitHub workflow contract and the workflows-github-v1 capability

GitHub is a trigger type, an output target and a run source. The new
capability carries the GitHub catalog, repository options, event history
and a run with the last event. A client shows a workflow with a trigger
type or an output target that it does not know as read-only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Add migration 49 for GitHub workflow runs, deliveries and actions

Migration 49 rebuilds workflow_runs to accept the github run source and
keeps every run id. It adds three tables:

- workflow_github_runs: the item of each run that a GitHub event started.
- workflow_github_deliveries: the event history of each GitHub trigger,
  and the per-item queue (a waiting row keeps its payload until it starts).
- workflow_github_actions: each change that a GitHub output made, so a
  retry does not repeat it and the loop guard can find its own events.

The latest schema takes the same run source line and tables. Tests cover
schemas 46 to 48, a late failure and retry, newer and missing histories,
constraint refusals and cascades.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Route GitHub App events through Signal to the hosts that watch them

Signal gets POST /v1/github/events. It checks the App signature, reads only
the installation and repository IDs, and sends the exact body to every host
whose GitHub route ticket names the repository. It keeps no body.

The account service signs the 5-minute route ticket after it checks, with
the host's GitHub sign-in, which watched repositories that sign-in can see.
D1 keeps no GitHub route.

The host ingress socket holds a GitHub route through the new GitHubRelay,
answers github-delivery frames, and records the offline gaps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Start workflow runs from GitHub events, one run per item

- Match GitHub events to triggers by repository, event and filters.
- Queue an event when a run of its item is open; start it when that run ends.
  Runs of other items start at the same time.
- Skip echoes of the workflow's own actions (self) and the fourth run in
  10 minutes that OpenBot's bot caused on one item (chain).
- Keep the newest 50 events per trigger and record offline gaps.
- Add the refused skip reason and caused_by_bot to the unreleased v49 table.
- Add scripts/github-workflow-e2e.ts (host level).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Make the changes of GitHub outputs as OpenBot's bot

A GitHub output makes one of the 10 changes through the GitHub REST API with
the App's installation token. "Agent chooses" asks a model once and keeps only
the repository's own labels and people. Each change writes a `sending` row
before the call and a `done` row after it, so a retry does not post twice and
the loop guard knows the change's events. A restart sends again only a change
that a second call does not repeat. "Run with last event" starts a run with
the newest matching item.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Show GitHub triggers and outputs on the workflow canvas

The trigger and output cards get GitHub rows: repository, event,
filters, action, labels and people, with "Agent chooses". The Events
row lists what GitHub sent. Access and event alerts open GitHub, and
Connect opens the connect dialog of the GitHub settings page.

The run bar lists the open runs and the waiting events, and the canvas
shows the steps of the open run that the user views.

The renderer reads the catalog, labels, people and event history from
the host through new IPC reads and Team API routes. GitHub shows only
for an owner or admin on a host with workflows-github-v1.

Stories replace the prototype stories.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Translate the GitHub workflow text into 12 languages

Name the GitHub event and action labels as literal catalog keys, and
remove two keys that no code uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Test the redaction of GitHub errors, and document GitHub workflows

Add a Vitest that checks that GitHub's error text and a failed request
put no token into a step's failure. Document the GitHub trigger path,
the delivery outcomes and the Team API routes, and add release notes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Remove unused GitHub exports, and fix an optional field in the e2e

Knip and the exactOptionalPropertyTypes ratchet failed the Check job.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Send not_planned to GitHub when an output closes an issue as not planned

The saved close reason is notPlanned. GitHub refused it with
"Please specify a valid state reason." The adapter now maps each saved
reason to the state_reason that GitHub accepts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep trigger events off GitHub, and add repository search and loading rows

- A GitHub output removes the framed trigger event from its text. A comment
  that has only the event fails with a clear error and posts nothing.
- The repository menus have a search field.
- The Labels and Person menus show "Loading…" while the host reads them.
- The log says that the GitHub output failed, not that it made no change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Make each loop pass change GitHub, and keep Telegram when a ticket fails

- A GitHub output keys its change by run, node and pass. A loop pass
  makes its own change. A retry or a restart of the same pass does not
  make the change again.
- When the trigger event comes back in a loop, the output also removes
  the empty "Input N:" names of the event.
- A failed GitHub or webhook ticket does not stop Telegram or the other
  routes on the shared socket.
- The connector reads the App events from GITHUB_ROUTE_EVENTS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Let Signal pass GitHub events of up to 512 KiB

An issue_comment or pull_request event can hold two texts of 65,536
characters each. Signal refused such an event with 413, and GitHub does
not send it again.

- GITHUB_DELIVERY_BODY_BYTES_LIMIT is 512 KiB.
- The pending budget for each host is 768 KiB, and the socket
  backpressure limit is 1 MiB, so the largest event fits.
- nginx gets a /v1/github/events location with the same body limit, no
  access log, and the 10-second wait of GitHub.
- The Signal e2e sends the largest event and one above the limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep an end marker in a comment inside its event, and stop loading after a failed options read

The event frame ends only at the marker on its own line. The JSON of the event keeps no line
break, so a commenter cannot end the frame early and get text posted as the bot.

A failed read of repository labels and people now stores empty options. The menus stop
showing "Loading". A change on GitHub reads them again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 00:19:46 +01:00
NBandClaude Opus 5.5 5eaed0696f Run Signal on two machines at the same time (#4209)
* Run Signal on two machines at the same time

The account service gives each server a home Signal machine
(`REMOTE_SIGNAL_HOMES`). When the home stops, the server and its
devices ask for a new home and move to the other machine. Auth
events go to each Signal, and only failed targets get a retry.
A cron checks the entry name `signal.openbot.run` and moves it to a
healthy machine. TURN relays spread over more than one machine.

All of this stays off until the production settings are set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Do not export the entry check types that only its file uses

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep device peers when no other Signal can take the host

- The host and its devices ask for a new Signal machine only when their
  ticket names a home. The entry Signal moves by DNS, so a new ticket
  for it names the same URL, and the host kept its device peers before.
- When the account service gives the same home again, the host keeps
  its device peers and lets the hidden window connect again.
- A released host build sends no signalHome. Its ticket request now
  removes the stored home, so its members do not wait on the old home.
  Ingress and the webhook relay send signalHome false and keep it.
- A REMOTE_SIGNAL_URL that is not a ws or wss URL fails closed, so the
  entry check does not throw.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Wait longer between host checks while a device waits

- A device that waits for an offline host doubles the wait after each
  ticket check that finds no move, up to 5 minutes, and starts again at
  10 s after `ready` or a move.
- The deployment note now says that a released host build removes its
  stored home.
- The entry check e2e passes an empty zone instead of undefined.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 13:15:23 +01:00
NBandClaude Opus 5.5 0d9dbdbb5e Make the Signal restart burst smaller (#4129)
* Make the Signal restart burst smaller

After a Signal restart, every peer connected again in the same half second,
and each hello asked the account service with no limit. On 2026-10-30 one
restart gave 9443 resumes that the account service did not confirm.

- Signal sends at most 64 resume checks to the account service at the same
  time. A check that waits more than 12 s fails as unavailable (close 1013),
  before the 30 s hello deadline.
- Clients and hosts spread the first retry after a Signal close over
  0.5-4 s (before: 0.25-0.5 s). Later retries double up to 30 s.
- The Signal security E2E checks the limit with a burst of 100 hellos.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep later Signal retries and fix the resume check deadline

- Only the first retry after a Signal close gets the 0.5-4 s spread.
  Later retries keep the old steps.
- The resume check deadline is 7 s. A started request can end 5 s later,
  so two checks still end before the 30 s client connect deadline.
- Correct the comment: the hello deadline stops when the hello arrives.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 22:26:15 +01:00
NBandClaude Opus 5.5 54de3927c1 Add a Signal TURN allocation health route (#4110)
* Add a Signal TURN allocation health route

/health/turn makes one real TURN Allocate over UDP with the TURN REST
secret and frees it with a Refresh of lifetime 0. On 2026-10-30 coturn
answered STUN but refused every Allocate with 486 at total-quota, and
the status page stayed green. The result is cached for one minute.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Stop a failed TURN probe send from stopping Signal

Each probe send is guarded, and the UDP socket has an error handler.
When coturn is down, ECONNREFUSED now ends the probe at once with
no-answer. Before, Bun reported it as an uncaught error. Also remove
the unused TurnProbeError export that knip reported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 21:42:38 +01:00
NBandClaude Opus 5.5 48f6fbde69 Send Signal and TURN capacity to OpenPanel (#4114)
* Send Signal and TURN capacity to OpenPanel

A host-network sidecar reads the coturn metrics and the Signal metrics every
5 minutes and sends one signal_capacity event with counts only. Signal now
publishes its metrics on host 127.0.0.1:9642 for the sidecar.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Run the capacity smoke against the real Signal server

Knip now knows the capacity-report entry, and the smoke starts the reporter
by an absolute path. The smoke uses the real Signal server with two open
sockets and checks that the reporter stops and sends nothing without the
OpenPanel client.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Send only live capacity counts and deploy the reporter with Signal

coturn adds relayed bytes to its metrics only when an allocation closes, so
the traffic value did not show the live load. Remove it. Send 0 for a
transport with no allocations, read the two metric pages at the same time,
and match only the "type" label. remote:update now builds and starts the
capacity reporter with Signal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 21:24:31 +01:00
Aleksander DygońandClaude Opus 5.5 3d7328dbd2 Revert "Add Google Workspace apps with the OpenBot Google sign-in (#3870)" (#3993)
This reverts commit 1b28c67e7f.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 11:45:49 +01:00
Aleksander DygońandClaude Opus 5.5 1b28c67e7f Add Google Workspace apps with the OpenBot Google sign-in (#3870)
* Add Google Workspace apps with the OpenBot Google sign-in

Add Gmail, Google Drive, Google Docs, Google Sheets, Google Slides and
Google Calendar to the Marketplace. They use Google's official MCP
servers. The user signs in with Google and does no Google Cloud setup.

- Signal holds the client secret of the OpenBot Google sign-in app and
  does only the code exchange and the token refresh
  (POST /v1/google/oauth/token, with the host's remote ticket). It
  stores and logs nothing. MCP traffic goes from the host to Google.
- The host gives the OpenBot app to the known Google MCP URLs, with the
  read and write scopes of each server. A sign-in app that the user
  saved still wins. The stored record shape does not change.
- Add the listings, the guides, 13 locales, docs, PRIVACY.md and
  release notes. Add GOOGLE_OAUTH_CLIENTS to Signal's encrypted env.
- Tests: test:signal (Google broker checks) and test:mcp-google-broker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Fix the review findings of the Google sign-in

- Forward the exchange's abort signal to the Signal request and the
  ticket request.
- Give the OpenBot app only to a host with an OpenBot account, so a
  sign-in does not send the user to Google for nothing.
- Treat an app with no secret on a Google server as the OpenBot app, so
  an app of an earlier client ID gets the current one, and keep
  removeSignInApp from removing it.
- Show a sentence when Signal refuses a token request
  (error.backend.googleSignInUnavailable).
- Move the token endpoint and the client ID pattern to the contract.
- Check the ticket before Signal says whether it has the Google app.
- Drop the exports that knip reports as unused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 11:38:31 +01:00
Aleksander DygońandClaude Opus 5.5 2ff99b5eca Let Telegram group mentions reach OpenBot when the bot is not an admin (#3988)
* Document Telegram bot privacy mode off so group mentions reach OpenBot

With BotFather privacy mode on, Telegram did not send a plain
"@meetOpenBot" mention to the bot in a group where it is not an admin.
Signal got no update, so only replies to the bot worked. Privacy mode
of @meetOpenBot is now off. Update the BotFather settings, the
messaging docs, PRIVACY.md and the parser comment to match: Telegram
now sends every group message, and OpenBot still answers only a
mention, a reply to the bot, or a message of an answered reply chain.

Fixes #3974

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Name the release notes after the branch

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Say that any Telegram message wakes and queues for a hosted server

With privacy mode off, Signal wakes a sleeping hosted server for every
message of a linked chat and keeps it until the server connects.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Wake a hosted server only for a Telegram message that can address OpenBot

With privacy mode off, Telegram sends every group message. Signal woke a
sleeping hosted server for each one, and the host dropped most of them.
Signal now wakes it only for a button press, a direct message, a reply,
a message in a thread, a message with a mention or command entity, or a
rename or removal. Signal reads only these flags and entity types,
never the text. The Signal E2E checks each case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 11:34:13 +01:00
Aleksander DygońandClaude Opus 5.5 4f8269d99c Give the agent the text and files of a forwarded Discord message (#3619)
* Give the agent the text and files of a forwarded Discord message

Discord puts the text and files of a forward in `message_snapshots`.
The top-level `content` and `attachments` of a forward are empty.
Signal read only the top-level fields, so a reply to a forward had no
quote, and the history and earlier-message context left the forward out.

Signal now reads the snapshot of a forward for the replied-to message
and for `listMessages`, and sets the new optional `forwarded` flag.
The host marks the text as forwarded. When Discord gave no text or
files, the host tells the agent so. An older Signal sends no flag.

The Discord access E2E check now covers a reply to a forward with an
image, a forward with an empty snapshot, and an earlier forward.

Fixes #3582

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Do not show a Discord forward as a reply in history

A forward refers to the message that it copies. History gave that id
as `replyToId`, so a forward of the first message of a conversation
could join its reply chain. History now gives no `replyToId` for a
forward. Also keep one `message_reference` type and fix a comment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 12:26:47 +01:00
NBandClaude Opus 5.5 c57a9aaa25 Update compatible dependencies (#3225)
* Update compatible dependencies

Apply the Dependabot compatible-updates group (#3159) on current main with a
fresh lockfile. The fresh install removes the nested @types/node 26 and the
second Vite 8 that the Dependabot lockfile added.

Move the dmg-builder, expo, expo-router and expo-splash-screen patches to the
new versions. The old patches apply without change.

Keep these packages at their current versions:
- @biomejs/biome 2.5.13: 2.6 adds rules with false positives and formats
  Markdown and YAML.
- lucide-solid 1.33.0: the Solid 2 patch does not apply to 1.61.
- storybook-solidjs-vite 10.7.1: 10.7.4 types fail 115 stories.
- react and react-dom 19.3.0, react-native-gesture-handler 3.3,
  react-native-keyboard-controller 1.22.7: Expo SDK 58 and React Native 0.88
  pin these versions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep jsdom 30.0.1 and @paper-design/shaders 0.0.80

jsdom 30.1.3 keeps focus on an iframe after blur(), so the ChatVisual
activation test fails. The site artwork hash includes the shaders version,
so 0.0.82 marks all committed article images as out of date.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 13:44:27 +01:00
Aleksander DygońandClaude Opus 5.5 19b2145df1 Give the agent the files of earlier Discord messages (#2669)
* Give the agent the files of earlier Discord messages

A person can post an image without a mention, and then another person
asks OpenBot about it. Before, OpenBot did not see that image: Signal
gave no files for earlier messages, the history dropped a message with
no text, and a new conversation had no earlier messages.

- Signal `listMessages` gives the attachments of each message. An older
  Signal gives none.
- A message with only files stays in the context and names its files.
- A new conversation has the channel's last 10 messages of the 15 minutes
  before it as context.
- The agent gets the files of the earlier messages, after the message's
  own files, within the attachment limits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Do not give the files of a delivered message again

- In a conversation, an earlier message that reached OpenBot already
  gave its files. Do not download them again for a later message.
- Name the files of earlier messages that the limits did not let in.
- Say why Slack does not read earlier messages when a message arrives.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Accept an undefined content type of a Discord attachment

The history schema gives `content_type` as `string | undefined`. The
`exactOptionalPropertyTypes` ratchet refused it for `attachmentsOf`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 14:44:10 +02:00
Aleksander DygońandClaude Opus 5.5 8684bf19b8 Give the Discord agent the files of the replied-to message (#2642)
* Give the Discord agent the files of the replied-to message

Signal kept only the text of the message that a mention replies to, so
the agent did not get its images or files. A message with only an image
gave no context.

Signal now passes on the replied-to attachments. The host adds them to
the files of the message. An older Signal sends no attachments, and the
host then reads an empty list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* State in PRIVACY.md that Signal passes on the replied-to files

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Name the replied-to files in the reply context

The agent now sees which files came from the replied-to message, and a
replied-to message with only files no longer gives an empty line. The
quote decoder refuses null attachments, as the message decoder does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 11:49:50 +02:00
NBandClaude Opus 5.5 bd5cf3c703 Keep sessions when Signal restarts and the account service fails (#2604)
* Keep sessions when Signal restarts and the account service fails

After a Signal restart, each resume asks the account service. A 5xx, a
429 or a timeout made Signal send authentication_required and close
with 1008. The client then closed its peer, and the host went to the
error phase and did not connect again.

Signal now closes with 1013 and no error frame when the account service
does not answer. Released hosts and clients connect again after their
backoff and keep their data channels. An inactive session is still
refused with authentication_required.

Host and client Signal backoff now has jitter, so that the peers that a
restart disconnects do not all connect again at the same time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Refuse a revoked session when the account service is unavailable

Signal now closes with 1013 only when it does not know that the session
is revoked or ended. Add a metric for these closes and an E2E check for
the revoked case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 22:47:02 +02:00
NBandClaude Opus 5.5 2cfb776069 Run type checks with tsrs (#2597)
* Run type checks with tsrs

The typecheck scripts and the type ratchet now start scripts/type-checker.ts.
It runs tsrs, the Rust port of TypeScript, on macOS arm64 and Linux. On
Windows and Intel Macs, tsrs has no binary, so it runs tsc.

The 14 projects take about 2.6 seconds with tsrs and 13 seconds with tsc.
A large project uses about 1 GB, not 2.5 GB.

tsrs follows TypeScript 7.1, which reports TS5115 for
z.record(z.string(), z.json()). Two e2e scripts now use z.unknown() for the
record values. The values come from JSON.parse, so the scripts accept the
same input.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Show why the type checker did not start

scripts/type-checker.ts now throws the spawn error, so a missing or blocked
checker gives a message, not a silent exit 1. The check notes give the
ratchet time for tsrs and for tsc, and the paragraph is wrapped again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Check release types only with tsrs

The Windows release job ran `bun run typecheck`, which uses `tsc` because tsrs has no Windows binary.
PR CI uses tsrs, so a difference between the two TypeScript versions could stop a release that CI
passed. The Linux release job checks types with tsrs, and the publish job needs it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 20:50:57 +02:00
Aleksander DygońandClaude Opus 5.5 19599c8212 Connect more Discord and Slack servers, add Discord role lists, read replied-to messages (#2502)
* Connect more Discord and Slack servers, add Discord role lists, read replied-to messages

- One OpenBot server can add a second and later Slack workspace or Discord
  server. The connect dialog follows the workspace that it adds.
- Each Discord server can have a list of roles. OpenBot ignores a mention
  from a member who has none of them. An empty list lets everyone. Signal
  sends the author's role IDs and lists the guild's roles (listRoles). The
  host keeps the list in projection_messaging_allowed_roles (migration 44).
  A joined server uses the new optional capability discord-access-v1.
- Signal passes the text, author and time of the message that a person
  replies to. The host gives it to the agent as context. Signal asks for the
  Message Content intent when DISCORD_MESSAGE_CONTENT is true, and connects
  without it when Discord refuses it (close code 4014).
- Add the E2E test test:messaging-discord-access.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Cut long Discord role names and fix knip findings

- A Discord role name can have more than 100 UTF-16 units (emoji), which
  made the IPC and Team decoders refuse the whole role list. The host cuts
  each name to the limit without splitting a surrogate pair. The E2E test
  covers a name of 60 emoji.
- The E2E script takes the Gateway payload type from DiscordState, so the
  root package does not need discord-api-types. InboundQuote is not exported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep the Signal Discord helper within the exactOptionalPropertyTypes ratchet

discordAuthorName takes its own parameter type, which accepts the optional
fields of a REST message as zod reads them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Use one orchestrator for each messaging platform

One Slack Orchestrator answers every Slack workspace, and one Discord
Orchestrator answers every Discord server, as one Telegram Orchestrator
already answers every Telegram chat.

- A workspace or server connected later gets the orchestrator that exists.
  "Add agent" gives it to each place that has none, and makes one only when
  the platform has none.
- An orchestrator that an earlier build gave one workspace stays with it.
- Disconnect deletes the orchestrator only with the last place that uses it.
- The page shows one orchestrator section, and one "Who can use OpenBot"
  section with a row for each Discord server.
- The orchestrator memories no longer name one workspace.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Name one orchestrator in the summary of many workspaces

The summary of two or more Slack workspaces or Discord servers names the one
orchestrator that answers them. Remove the notes of the deleted per-workspace
title key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Ask for the Discord Message Content intent by default

Signal asks for the intent unless DISCORD_MESSAGE_CONTENT is false. When the
Developer Portal has it off, Discord refuses it, and Signal logs one line and
connects without it, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Stop the connect retries of a Discord Gateway manager that the fallback replaced

When Discord refuses the Message Content intent, the first connect of the
manager fails too. Its retries then connected the released manager again, which
asked for the refused intent again. A connect attempt now runs only while its
manager is the current one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 00:03:09 +02:00
NBandClaude Opus 5.5 73084a1f17 Fix authorization gaps in the account service, Signal and the site router (#2438)
* Stop old invitations from undoing a member removal

acceptInvite reactivated a revoked membership with any live invitation,
so a removed member could rejoin with a permanent team link or a spare
single-use invite. An invitation also stayed valid after the admin who
made it was removed or demoted.

An invitation now admits a user only while its creator is an active
owner or admin, and only if the user was not removed after the
invitation was made. The guard is in the batch statements too, so a
concurrent removal cannot race it. A new invitation or a reactivation
still lets a removed member back.

Adds apps/auth-api/scripts/cloud-authorization-e2e.ts
(bun run test:cloud-authorization).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Never publish private JWK members in the ticket key set

Copy only the public members of each configured key into
/.well-known/jwks.json, so a private key that was put in
REMOTE_TICKET_PUBLIC_JWKS by mistake stays secret.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep checkout return addresses on the account site

validReturnUrl accepted `//host/app` and `/\host/app`, which resolve to
another origin. Require the same origin as well as the path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Look up only own files in the site router

route.files is a plain object, so `/constructor` or `/__proto__` found a
member of Object.prototype and the router read the R2 key "undefined".
Use Object.hasOwn for each lookup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Use only the Cloudflare address for rate limit keys

A client sets X-Forwarded-For itself, so a new value for each request gave
it a new rate limit when CF-Connecting-IP was missing. requestSourceIp now
reads only CF-Connecting-IP, and the marketplace limit uses the same
function. The function is in its own module, so the E2E test can load it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Count one IPv6 /64 as one client in rate limits

One IPv6 subscriber usually has a full /64, so a new address for each
request gave it a new per-address limit. requestSourceIp now returns the
/64 prefix of an IPv6 address. All per-address limits, and the address
hashes of sign-in challenges and site reports, use this value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Stop reading Signal request bodies at their limit

The account event route read the full body with no limit, and the Slack
route read the full body before it checked the size. A body with no
declared length could fill memory. Both routes now read with the bounded
reader and answer 413 at the limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* List hosted sites, skills and site reports in the privacy policy

The account service section said R2 holds only avatar files. It also holds
published site files, marketplace skill bundles and icons, and template
images. D1 also holds site and skill records and site reports.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Let a member who left rejoin with an earlier invitation

The block on old invitations used updated_at of a revoked membership. A
member who left also got a revoked row, so the member could not rejoin
with the team link. A role change of a removed member also moved
updated_at and stopped a newer invitation.

Migration 0036 adds remote_memberships.removed_at. Only a removal by an
owner or admin sets it. A leave and an activation clear it. A role change
keeps it. Revoked rows from before the migration count as removals.

The site report hash in PRIVACY.md now says that IPv6 uses the /64.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep a removal when the removed member leaves again

A removed member could revoke their own revoked membership. That counted
as a leave, which skips the role check and cleared removed_at, so the
earlier invitation admitted the member again.

Now a leave writes 0 only from an active membership. A leave from a
revoked membership keeps the value, and a repeated removal keeps the
first removal time. The invitation check reads
COALESCE(removed_at, updated_at), so a revoke from the Worker before
migration 0036 counts as a removal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Run the cloud authorization E2E in check:api

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Decide removed_at from the row that the update finds

The leave and the removal chose removed_at from the status that
changeMembership read first. A leave that raced a removal could write 0
over the removal time. Now the UPDATE reads the current status, so a
leave keeps a removal and a removal replaces only a leave or no time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Close the invitations of an admin who can no longer invite

An invitation from a removed or demoted admin admitted nobody, but it
still counted against the invitation limits, showed as open in the list
and passed the preview.

Now changeMembership revokes the open invitations of an admin who
leaves, is removed or is demoted, in the same batch. Migration 0037
revokes the open invitations whose creator is not an active owner or
admin. The creator check in acceptInvite stays for a revoke that the
Worker before this deploy writes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 23:50:23 +02:00
NBandClaude Opus 5.5 25091a4c87 Close idle Signal sockets and block more TURN relay targets (#2330)
* Close idle Signal sockets and block more TURN relay targets

Signal closes a socket that sends no hello in 30 s. A turn-refresh in 5
minutes after the last one gets the same TURN credentials, so a peer
cannot make many usernames to get around the coturn quota. coturn now
refuses relay to its own public address, 198.18/15, IPv4-mapped and
NAT64 ranges.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Let two relayed peers on one TURN server reach each other

When both peers relay through the same coturn server, each peer address
is the public IP of that server. A denied-peer-ip rule for that address
stopped these calls. The reserved ranges stay denied.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 20:08:35 +02:00
Aleksander DygońandClaude Opus 5.5 d581de58d6 Stop Slack, Discord and Telegram conversations from holding an agent's queue (#2130)
* Stop messaging conversations from holding an agent's queue

A turn that no event ended held the agent's queue until OpenBot
restarted, and status posts in Slack, Discord and Telegram stayed on
"Working" or "Waiting" after a restart or a failed post.

- Muse ends a turn whose turn/start failed after turn/started.
- A provider exit ends the turns of that client that have no message
  left for the delivery recovery, such as a turn the CLI started.
- The drain does not mark a turn active that already ended, and settles
  the messages that such a turn left running.
- Messages of an unconfirmed turn/start that no turn took in 5 minutes
  end as interrupted, and the queue continues.
- A question card in a messaging thread is refused: nobody there can
  answer it.
- An approval that did not reach the platform is posted again.
- Discord and Slack name lookups no longer hold the prompt deadline.
- The delivery recovery tells the conversation that a request ended.
- Status posts and Stop buttons are kept in a file. A connection that
  is connected again sends each last post that did not reach the
  platform, and stops the posts of requests that ended meanwhile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Handle kept deliveries in order for each route only

Signal keeps the order of kept deliveries for each route (Slack team,
Discord guild, Telegram chat). The host opened and handled them under
one global permit. Thus a connection that could not start held back
the kept deliveries of all other connections, and each of its
deliveries waited 60 s for the transport.

- signal-ingress: open kept deliveries one at a time, in send order.
  Then each delivery waits only for the earlier deliveries of its route.
- messaging-service: the kept deliveries of one connection share one
  transport deadline for each socket. A connection that does not start
  costs one 60 s wait, not one wait for each event.

Ack and 503 behavior do not change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep a Telegram link for the host's next Signal socket

A `/start <code>` link could land while the host's ingress socket
connected again. Then no socket, or a socket that closed, held the
chat, and Signal sent the linked update only once, live. The host
dropped it, and the route ticket of its next socket did not name the
chat. The chat did not show in OpenBot until the user linked it again.

- Signal keeps the linked update, sealed and with `linked: true`, in
  the ingress queue for the host until a socket acknowledges it. A
  host with no queue key, or a Signal with no queue, gets the live
  frame as before.
- Signal remembers each new link for the route ticket TTL, and routes
  the chat to a new socket of that host whose ticket does not name it.
  The route floor still applies.
- `IngressQueue.keep` keeps an event for a known host and starts no
  host. `offline` uses the same code.
- The Signal E2E check links a chat between two sockets of one host.

No frame changes meaning. The Signal change needs its own deployment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Merge the release notes of the messaging stall fixes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Fix the local review findings of the messaging stall fixes

- A last post goes out once: a copy that a settle and a wait both
  queued stops when the post is no longer the current one.
- The last post is saved before it is sent, so a restart still has the
  answer when the send failed.
- A settle stops only posts from before the restart. The end of a
  request in this run comes as an activity, which can still be on its
  way.
- A turn with no known requester does not count as told, so the
  delivery settle still tells the conversation.
- The status file is read at once, before the activity listener, so no
  activity is lost while it loads. Posts of a removed connection are
  left out.
- A failed edit is sent again as an edit. Only the last attempt posts
  anew, so a temporary error leaves no second "Working" post.
- A new message waits at most 5 seconds for its author and place names.
- The reason of an unstarted turn uses a catalog key.
- interruptTurnsOf takes keepRecoverable in place of a copy of its loop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Name the kept Telegram link in the Signal store rules

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Do not send a failed answer again

An answer goes out in parts. When a later part failed, the retry sent
the parts that were on the platform already. Now a failed answer is
not sent again: the status post gets the fixed failure notice, and the
host keeps the answer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 20:22:38 +02:00
Aleksander DygońandClaude Opus 5.5 212eff2a80 Remove unit tests and keep E2E and protected tests (#2051)
* Remove unit tests and keep E2E and protected tests

Delete 591 vitest unit test files and their test-only harnesses. Keep
E2E and smoke scripts under scripts/, and keep vitest files only for
migrations, schema parity, the renderer-to-main trust boundary, secret
redaction, and check-rule fixtures.

Remove the test runners that have no tests now (site-router, remote/api,
contracts, brand, auth-api client), their CI jobs, and the transfer
budget report. Remove code and dependencies that only the deleted tests
used.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Set the E2E-only test policy and remove references to deleted tests

AGENTS.md now permits vitest files only for migrations, the trust
boundary, secret redaction and check-rule fixtures. All other behaviour
gets an E2E script under scripts/.

Remove references to deleted tests, harnesses and commands from docs,
AGENTS.md files and skills. The release-upgrade-safety gates that ran a
deleted test now use a manual check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep migration tests and fix CI checks after the test removal

Move the migration cases out of the deleted mixed test files into
three migration test files: the v15 agent usage upgrade and rollback,
the read-state baseline from schema v2, and the remote control plane
and permanent invitation D1 migrations.

Keep error.agent.noStartingModel for the text that older hosts send,
and let i18n-check accept it. Lower two type baseline entries. Correct
comments and docs that named removed tests or test commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Remove the empty test patterns from the knip configuration

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Add E2E checks for Signal secrets, IPC input decoding and analytics redaction

- scripts/signal-security-e2e.ts starts the real Signal service with
  throwaway secrets. It checks the Telegram secret header, the Slack
  signature, signed account events, remote and route tickets, webhook
  headers, and that no frame or log line holds the bot token. CI runs
  it in the new Signal E2E job.
- scripts/ipc-input-e2e.ts sends malformed requests from a running dev
  app and checks that the main process decoders refuse them.
- scripts/analytics-redaction-e2e.ts checks that no captured analytics
  or failure report request holds a seeded secret. For this,
  OPENBOT_ANALYTICS_CAPTURE_URL sends analytics to a loopback capture
  server. Only an unpackaged build reads it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Check the renderer analytics path and path traversal in the E2E scripts

The analytics E2E now loads the window again and waits for the renderer event, so the renderer send path cannot pass with no request. The IPC input E2E now sends an attachment id and a shared file path that try to leave their folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Remove an unused optional parameter from the read-state migration test

The parameter gave one exactOptionalPropertyTypes error, which the type ratchet refuses for a new file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 15:25:48 +02:00
Aleksander DygońandClaude Opus 5.5 4c4504e0a0 Let agents post to Slack, Discord and Telegram places on their own initiative (#1976)
* Let agents post to Slack, Discord and Telegram places on their own initiative

Add two deferred openbot tools that work in any turn:
- messaging_list_places lists the enabled connections, or the places of one.
- messaging_post posts redacted markdown to a place, or in a thread.

A routine run or a desktop chat can now report to a connected channel.
Discord listing uses a new additive Signal op, listChannels. Signal must
be deployed before the desktop release. Posting needs no Signal change.

A top-level Telegram post now starts its own reply chain. Before, a reply
to it went to the "dm" conversation key of the group.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Fix review findings for agent posts to messaging places

- Signal lists only the Discord channels and threads that the bot can
  view and post in, so a hidden channel name does not reach the host.
- Slack lists places with users.conversations, which gives only the
  bot's own channels.
- A Telegram connection posts only in its own chat.
- A failed post tells the agent that a part can be posted already.
- Do not show every Discord invalid_request as an outdated Signal.
- Correct the mention text: a Telegram @username notifies the person.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 15:09:30 +02:00
Aleksander DygońandClaude Opus 5.5 7825c10b50 Let hosted servers sleep with connectors, and wake them from Signal (#1669)
* Let hosted servers sleep with connectors, and wake them from Signal

A hosted server with a Slack, Discord or Telegram connection stayed on all the time. Now it sleeps
like other hosted servers. When a connector event comes for a route with no host socket, Signal
asks the account service (`/v2/remote/route-wake`, signed) to start the host. For an event that
addresses OpenBot, Signal keeps the delivery in memory for at most 10 minutes, sealed to the host's
queue key, and sends it as `queued-delivery` when the host connects.

- contracts: `ingress-queue` seal and open, hello `queueKey`, frame `queued-delivery`.
- Worker: `RemoteControlPlane.routeHost`, `HostedServerService.routeWake`, route `route-wake`.
- Signal: one `IngressQueue` for Slack, Discord and Telegram. Slack gets 200 for a hosted route.
- Host: a lasting queue key, encrypted by the operating system; opens kept deliveries in order.
- Renderer peer ignores `queued-delivery`, as it ignores the other ingress frames.
- Docs, PRIVACY.md and release notes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep the Signal queue limits and outcome types inside their module

Knip found exports that no other module uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Make the Signal queue keep every addressed message, in order

Fixes from the NorbiAI review and a local code review:

- A message that comes during a lookup with no start asks again with a start.
- A failed account-service call is not remembered.
- A flush keeps the later events of a route behind an earlier event that is still sealed.
- Expired events go on a timer. A queued event cannot be interrupted while it is sealed.
- A hello with no queue key removes the old key. A Discord removal does not look up the route.
- Slack edits and deletions do not start a server.
- The Worker refreshes a server that says it runs, and reports a failed start.
- The host waits up to 60 seconds for the connection of a kept delivery.
- A hosted server with a live connection sleeps only when Signal says `ingress-queue` and the host
  has a queue key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep each kept event until the host acknowledges it

Fixes from a second local code review:

- Signal keeps a kept event until `queued-delivery-ack`, and sends it again on the host's next
  hello. The host handles a kept event also after its socket changed, and acknowledges it.
- A flush stays under the socket's backpressure limit: 192 KB of kept events for each host.
- The account service answers route-wake before the server starts; the start runs in `waitUntil`,
  so Slack gets its answer within 3 seconds.
- Signal says `ingress-queue` only when the account service has route-wake when Signal starts.
- A flush checks that the socket still holds each Telegram chat.
- Signal runs the queue work in its managed runtime. The host loads its queue key once.
- A kept delivery waits only for a connection that can still start, and stop releases it. It also
  waits for a connection whose identify failed and that starts again.
- The route and host-state types are in the shared contract.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Ask again for the start of a host that keeps events

The account service answers route-wake before the start, and a start can fail. While a host has
kept events, Signal asks for its start again once a minute, until the host acknowledges them or
they expire. The account service retries a server whose start failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Cap Signal's remembered routes and queue keys, and wait 30 s for route-wake

- The remembered routes could grow past 100,000 when all answers were recent. The oldest answer
  now goes.
- The queue keys had no limit. Past 100,000, the key of the host whose last hello is oldest goes.
  A host that sleeps keeps its key, because it has no socket when Signal needs it.
- route-wake waits 30 s. The other account service calls keep 5 s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Stop a kept delivery waiting for a connection that does not start

A connection with no credentials or a removed chat gets no live entry, so its kept delivery waited
the full 60 s inside the one queued-delivery lock, and every later kept delivery waited behind it.
It now waits only until `start` has asked every connection to start.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Document that a Signal restart loses the waking event of a sleeping server

Signal keeps the queue keys only in memory, so after a restart it starts a sleeping server for an
event but cannot keep the event until the host connects again. This is accepted for now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:09:41 +02:00
NBandClaude Opus 5.5 fbb8ba95cc Keep remote connections coming back after a server restart or outage (#1809)
* Keep remote connections coming back after a server restart or outage

- Signal holds a web client that opts in with `waitForHost` while the host
  is offline, sends `host-waiting` with a resume token, and sends `ready`
  when the host connects. The client has no connect deadline while it waits.
- When a host hello did not resume, Signal sends `disconnect` to the clients
  that the older host socket held, so they make a new peer connection.
- A host Signal peer that closed for good sets the host phase to `error`, so
  the existing start retry publishes the host again.
- The host logs Signal close codes, error codes and the online -> error
  phase change, with no tokens or message text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Resume page recovery when a held attempt comes online

When the lifecycle suspends recovery for a sleeping or ended server, Signal
still holds the attempt. If another device wakes the server, the attempt
comes online, so clear the block and start a new recovery.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep the held attempt after a rate-limited Signal reply

A `connecting` update without `hostOffline` no longer clears the held host,
so a switch to another server still replaces the held attempt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 17:55:44 +02:00
NBandClaude Opus 5.5 8e3553c4b4 Do not let device connections keep a hosted server from starting (#1805)
* Do not let device connections keep a hosted server from starting

Signal counted host sockets in the owner's connection limit. The
clients of an account could fill the limit, and Signal then refused
the hosted server's own host hello, so the server stayed at "Starting"
with "Too many active remote connections.".

The limit now counts only client sockets. A host hello replaces the
older sockets of the same host and moves their clients to the new one.
The server connection screen shows Signal errors in the reader's
language, and Spanish now has the server connection text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep older host sockets open when a host says hello again

A host treats close code 4000 as final. When two instances of a hosted
server overlapped and the older one said hello last, Signal closed the
newer socket, and the host stayed offline after the older instance
exited. A host hello now only moves the clients of the older sockets.
The older sockets stay registered, so the last remaining one takes the
clients when the newer socket closes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Limit the open Signal sockets of one host

Host sockets are no longer in the account connection limit, and older
host sockets stay registered. So one host could keep any number of
sockets, limited only for each IP address. A host now keeps at most 4
sockets. A fifth hello closes the oldest with code 1013, which a host
treats as a reason to connect again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 16:40:14 +02:00
NB fb8a499393 Fix Signal reconnect quota accounting (#1775) 2026-10-10 12:24:53 +02:00
Aleksander DygońandClaude Opus 5.5 bf4c453a44 Show the Signal commit and deploy Signal with each release (#1697)
* Show the Signal commit and deploy Signal with each release

Production Signal stayed older than #1520 after v0.33.0, so webhook
routes answered 404 and webhook-only ingress sockets got
authentication_required (#1661).

- Signal shows its source commit in /health/live (OPENBOT_SOURCE_COMMIT
  build argument, "unknown" when not set).
- The release checklist deploys Signal from the new tag when remote/ or
  the Signal protocol changed.
- The deployment procedure sets the commit at build time.
- release-upgrade-safety gets gate H: Signal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Add the signal-deploy skill to the repository

The skill checks and deploys Signal from a release tag. The release
checklist now names it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Deploy Signal before the release tag is pushed

Pushing the tag starts the release workflow, which does not wait for
Signal. Create the tag locally, deploy and check Signal, then push it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Compare the release with the running Signal, not the previous tag

An earlier release can leave Signal behind, so the release step and
gate H now compare the running Signal commit with the release. The
build passes the commit with --build-arg and stops when the directory
name is not a commit SHA. The commit layer comes last in the image, so
the layers above stay cached.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 19:06:58 +02:00
Aleksander DygońandClaude Opus 5.5 8bc5b24125 Answer in Telegram with one shared OpenBot bot (#1448)
* Answer in Telegram with one shared OpenBot bot

People mention the OpenBot bot in a Telegram group, or reply to it, and the
Telegram Orchestrator asks the right agent, as in Slack.

- Signal holds the bot token. It receives the webhook, routes each update to
  the host of its chat over the ingress socket, and makes the host's Bot API
  calls from a fixed list, only for chats routed to that host.
- The Worker links a chat to a host with a one-use code (D1 0026) and signs
  the Telegram route ticket.
- The host adds a Telegram driver, the Telegram Orchestrator and a settings
  page under Connectors.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Fix Telegram link, disconnect and removed chats

- Hold the ingress socket while a link code is open, so Signal can route
  the first chat when no connection runs.
- Link a chat only on a `/start` that Signal marks `linked`: a made-up code
  in a routed chat no longer resumes a paused chat.
- Validate Telegram route tickets by bot, chat and link time, so a revoked
  route of one bot does not come back on the chat ID of another.
- Hold the socket until the bot leaves the chat on disconnect.
- Keep a chat that removed the bot removed across reconnects and restarts.
- Remove unused exports that knip found.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Wait for Signal before a Telegram link, and end rate limits

- Open the `t.me` link only when the socket is ready with a Signal that has
  Telegram, so the chat's `/start` always finds this host.
- Allow 64 chats in the Telegram overview, as the account service does.
- Send an answer as plain text when its HTML is over the call text limit
  that Signal checks, so Signal does not close the shared socket.
- Retry a rate-limited Telegram call like the Slack client, and restore the
  connection state when the wait ends, for Slack too.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Fix four Telegram review findings

- Retry a failed Telegram route ticket with its own backoff, as for webhooks.
- Mark a paused chat as removed, and unlink it, when the bot leaves it.
- Look up the bot's username again when the link could not get it.
- Let a reply to the bot start a conversation in a group.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Hold the Telegram socket while a chat looks up the bot's username

After a restart, no transport holds the socket before identify() ends,
so the getMe call waited for a socket that did not open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Add the OpenBot Telegram bot settings, and deploy them to the Worker

- Encrypt TELEGRAM_BOT_ID and TELEGRAM_BOT_USERNAME into the auth-api
  .env.production and .env.dev, and the bot token, webhook secret and
  webhook origin into remote/.env.production.
- api:deploy now sends TELEGRAM_BOT_ID and TELEGRAM_BOT_USERNAME to the
  Worker, as it does the Slack and Discord settings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep the Telegram bot token away from the dev app

The dev stack passed TELEGRAM_* shell values to every child. The bot token,
the webhook secret and the webhook origin now go only to Signal (and the
account API, as for Discord); the bot ID and username only to the account API.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Use the new OpenBot Telegram bot, @meetOpenBot

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Document the OpenBot Telegram bot settings

Add apps/telegram-app/README.md, as for the Discord and Slack apps: the
BotFather settings and texts of @meetOpenBot, its secrets, and the limits
of Telegram.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-09 13:14:56 +02:00
NB f2e52bc49f Update the Bun toolchain to 1.4.2 (#1575)
* Update the Bun toolchain to 1.4.2

* Fix the remote desktop dependency audit

* Pin the verified recipe 15 runtime artifacts
2026-10-08 12:39:40 +02:00
NB 9e019602c6 Add webhook triggers to routines (#1520)
* Add webhook triggers and routine notifications

* Name webhook release notes for the feature branch

* Make each webhook part of its routine

Remove the host-level event source. A webhook trigger now belongs to its
routine. The host makes the URL and the secret. The editor shows the secret
one time, and the user can rotate it.

- Split the event store into RoutineStore triggers, WebhookRouteStore and
  WebhookDestinationStore. Connect destinations to routines with a link table.
  Add RoutineRecords, so that main does not call AgentService for routine
  records.
- Revoke the relay route in the same transaction when a routine is deleted or
  changed to a schedule. Retry the revocation until it succeeds.
- Tell open editors when a background sync stores a webhook URL.
- Use one inline webhook trigger, notifications and activity in the desktop,
  web and mobile routine editors. Remove the Events server settings page.
- Add "webhook" as a routine analytics trigger type.
- Update contracts, Team API events-v1, i18n, docs, PRIVACY.md and the
  release notes.

* Fix the knip and channel test failures of the webhook routines

- Remove the export from 23 webhook names that no other file uses.
- Use the backend event type limit in main instead of a second copy.
- Stub the events group in the app test harness. A channel on this
  computer reads its routine count through it.

* Use one trigger menu and a webhook card for routines

Replace the Schedule/Webhook toggle with a grouped trigger menu on
desktop and mobile. Each schedule and the webhook have an icon and one
line that tells when the routine runs. Show the webhook trigger as one
card with Endpoint, Signing secret and Events rows.

* Simplify the routine editor

Merge the webhook activity into the routine history: it shows runs,
ignored webhook requests and failed notifications with a Retry action,
and reloads when the runs change. Show notifications as a plain field
with compact rows and icon actions. Hide the event filters of a webhook
routine until the user selects Filter events. Align the history rows
with the field labels and remove dead run row styles.

* Keep the schedule row as tall as an input with the trigger menu

* Make the webhook card rows full width

* Remove routine run notifications from webhook routines

Webhook routines keep the endpoint, the signing secret, event filters,
receipts and the ignored requests in the routine history. Outbound
destinations, the delivery outbox and its retry worker are removed.
Migration 29 is not released, so it is edited in place.

Also align the webhook card header icon with the row labels.

* Fix review findings and remove unused webhook code

- Keep the stored timezone when a routine is saved again.
- Let a webhook routine with the "skip" policy drop its held runs.
- Never free a webhook route ID in the account service. Give a routine a new route ID when the
  account service refuses the old one.
- Check route ownership before the Signal rate limit and body read. Share one Slack and webhook
  delivery budget for each host.
- Keep Slack and Discord ingress when the webhook ticket fails.
- Run one route sync at a time, and only when routes can change.
- Return 503 when the host cannot decrypt a secret, and 500 for internal events-route failures.
- Use one filter value codec on desktop and mobile. Keep filter inputs focused while typing.
- Remove unused types, exports, decoders, signers and repeated checks.
- Add `| undefined` to new optional props for the types ratchet.

* Fix NorbiAI findings for webhook routines

- The released agent and channel routine routes do not delete or test a
  webhook routine. These routes have no administrator check. Only the
  events surface sets the webhook access.
- A route sync that fails runs again after 30 seconds. The delay doubles
  up to 15 minutes until a sync succeeds.
- An ignored channel webhook publishes a routine change, so an open
  editor shows it in History.
- A receipt older than 7 days does not count as a duplicate.

* Use event routes only for web admins and keep one ingress socket

- The web client uses the events routes only for an owner or admin. A
  member keeps the released routine routes, so the routine list does not
  fail with 403.
- The first Slack or Discord holder reconnects the ingress socket when
  webhooks already hold it. Before, it opened a second socket and did not
  close the first one.

* Fix NorbiAI findings for webhook size, mobile refresh, and route retention

- Answer 413 with no receipt when the routine instruction and the event are longer than the message limit.
- Reload mobile channel webhook routines and webhook history on routine change events.
- Say in PRIVACY.md that revoked route rows stay permanently.

* Retry the webhook ticket on a shared socket and hold webhook runs during a restart

- When Slack or Discord share the ingress socket and the webhook ticket failed, open the socket again with a backoff until Signal confirms the webhook route.
- While a restart waits for idle agents, answer 503 to webhook requests and write no receipt.
2026-10-07 20:57:46 +02:00
NB 2df4f66999 Add reliable error reports across app surfaces (#1533)
* Add reliable error reports across app surfaces

* Report structured provider failures once per turn

* Exclude confirmation dialogs from notification reports

* Keep saved mobile reports until the account is loaded

* Omit absent optional fields from failure reports
2026-10-07 20:03:19 +02:00
Aleksander DygońandClaude Opus 5.5 9b669e9c28 Connect Discord servers through a central OpenBot Discord bot (#1449)
* Connect Discord servers through a central OpenBot Discord bot

Signal holds the bot token, keeps the Gateway connection, passes each
guild's mentions of OpenBot to the linked host's ingress socket, and makes
typed Discord calls for that host. The account service links a guild to a
host and seals the link to it. Each guild gets a Discord Orchestrator, and a
conversation is a reply chain.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Match the generated auth-api route tree to the router generator

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Unlink removed Discord guilds without the host, and keep failed disconnects

- Signal tells the account service when the bot leaves a guild, and drops
  the route at once, so an offline host does not keep the link.
- A Discord disconnect unlinks first and changes nothing when that fails.
- Reconnect of a guild that removed the bot starts the install again.
- nginx streams Discord uploads to Signal instead of buffering them to disk.
- Remove two unused exports that knip reports.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Recover Discord guild removal when the unlink or the host misses it

- Signal knows the bot's guilds from the Gateway. A route ticket that names
  a guild the bot left is not routed, and Signal asks for the unlink again,
  also after a restart. New links get five minutes for the Gateway to catch up.
- The discord-session frame lists the guilds routed to the socket. A host
  connection whose guild is not listed stops, so Reconnect starts the install.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Reconcile Discord guild links from the Gateway, and restore a README heading

- Signal sends the account service the guilds that the bot is in, after the
  Gateway lists them and every 30 minutes. The account service unlinks each
  older link of another guild, so a failed unlink recovers without a host,
  also after a Signal restart. Membership is tracked per Gateway shard.
- Restore the "Production requirements" heading of remote/README.md, which
  docs/self-hosting.md links to.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Pause the Discord guild reconcile while a Gateway shard is closed

A closed shard can miss a guild that installs the bot, so its guild list
is stale until the shard resumes or is ready again. The reconcile sends
nothing until every shard has a current list, so it cannot unlink a new
guild.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* Retry rate-limited Discord calls, retry the Gateway connect, bound uploads

- A Discord call that Signal answers with rate_limited waits and tries
  again, at most 3 times and at most 60 seconds each, as a Slack call does.
- A first Gateway connection that fails is tried again with a backoff of
  5 seconds to 5 minutes, until Signal stops.
- An upload reads at most one byte more than Discord's 10 MB limit, so a
  large attachment is not read into memory.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-07 12:35:15 +02:00
Aleksander DygońandClaude Opus 5.5 d1ce0ee68f Migrate service runtimes to Effect 4.0.0 (#1283)
* refactor: migrate service runtimes to Effect 4

* refactor: make Effect the canonical service runtime

* fix: preserve typed Effect failures and align CI test boundaries

* test: await Effect test boundaries and lower lint baseline

* fix: handle early provider exit and retain remote send errors

* Simplify Effect composition and failure handling

* Fix review findings in hosted sites, updates and WebRTC requests

- Release a hosted-site idempotency claim on any failure, defects included.
- Keep update downloads running after stop(), as before the migration.
- Clean up a pending WebRTC request when the send is interrupted.
- Compose the account switch in one Effect, without nested runPromise.
- Remove single-effect generators in the WebRTC client transport.
- Put the atomic-write JSDoc on writeFileAtomically; reuse writeJsonFileAtomically.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Run Effects at Promise boundaries through one runCauseEffect

Replace the inline Effect.runPromise(x.pipe(Effect.mapError((error) => error.cause))) calls and
the per-domain runners (runBrowserEffect, runMcpEffect, runArchiveEffect, runRemoteWorkflow,
runDesktopEffect, runProviderClientEffect, runTestEffect) with runCauseEffect in
src/backend/effect-boundary.ts. Behavior is unchanged: expected failures reject with their cause,
and defects and interruption reject as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Mark concurrent test starts as not awaited

runCauseEffect returns a Promise, so Biome now finds the operations that
these tests start and do not wait for. Mark each with void. The start
stays concurrent, and a rejection still fails the run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Send CentralAuth requests through the network-block detector

The merge of main wrapped the options fetch, but CentralAuth sends its
requests through the Effect transport. Build the transport from the
wrapped fetch, and run the new test through Effect.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Run each account API entry point as one Effect

Route handlers, the browser API, the Worker pre-routing and the cron
now run one Effect each. Request body readers, the SMTP socket close
and the remaining R2 and D1 calls are Effects. The skill icon read is
now part of its Effect; before, the Effect returned a Promise.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Run the remaining service runtime in Effect

Main: the automation server, Team API server start and stop, duplicate
requests, Dynamic Island, the Computer Use highlight, trace flushes,
update background work, sibling scans, upload slots, server mode, window
bounds, attachment archives and uploads, and remote transport callbacks
are Effects forked into their owner's scope.

Backend: usage limit hooks and the channel requeue are Effects.

Team client: request frames, Signal notices and connection failures run
in the peer's work scope, and recovery loops inside its run.

Site router: one Effect per request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Run the picture-in-picture and permission help windows in Effect

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Remove the unused analytics runner

The trace file forks its flush into its own scope now, so nothing calls
runAnalytics.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep cron jobs, session ends and host starts complete after a failure

- The cron waits for every job before it reports the first failure, so a
  failed delivery does not stop retention or a site cleanup midway.
- A connection failure ends the logical session in an uninterruptible
  fork, so dispose does not stop it.
- A dependency that throws while the Team API listener starts fails the
  start, so the host stops the listener.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 15:06:54 +02:00
NBandClaude Opus 5.5 8499f67523 Let more Signal connections share one account (#1334)
* Let more Signal connections share one account (#1310)

Signal limited one account to 8 authenticated sockets. Published hosts and
clients share this limit, so a few computers and devices filled it, and a new
phone or browser got rate_limited and close 1008. Set the default and the
production value to 32. Keep the IP and message limits.

At the limit, a client that reconnects the same session was also refused,
because its old half-open socket still counted until the idle timeout. Do not
count the socket that the reconnect replaces.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Say that each open device keeps a Signal socket for each saved host

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 11:46:09 +02:00
ANIRUDDHA ADAKandAniruddha Adak 449bc634d5 Do not register a Signal peer whose socket already closed (#1327)
Verifying the ticket awaits, so a socket can close during that wait. disconnect runs first and finds no peer, so it cannot clear what #authenticate creates. The service then registered a peer, an expiration timer and a peer-ready event for a socket that is gone. Repeating the race used up the account connection limit and refused a real device with rate_limited.

The check reads the live socket map, which disconnect clears first. No await runs between the check and the registrations, so the socket cannot close again in between.

Co-authored-by: Aniruddha Adak <aniruddhaadak80@users.noreply.github.com>
2026-10-03 11:02:37 +02:00