11 Commits
Author SHA1 Message Date
Aleksander DygońandClaude Opus 5.5 f292d7cf3e Let agents read one full routine before they change its instruction (#13668)
* Let agents read one full routine before they change its instruction

list_routines sent every routine with its full instruction in one tool
result. Codex CLI cuts long tool output, so an agent could see only part of
a long instruction, and update_routine replaces the full instruction.

list_routines now takes an optional routineId and returns only that routine
with its full instruction (a webhook routine also gets its instruction). In
the full list, an instruction longer than 1,000 characters is cut and marked
with instructionTruncated and instructionLength. The tool texts tell the
agent to read the full routine before it replaces an instruction.

The agent-webhook-routine E2E checks the one-routine read, the cut and mark
in the full list, and an unknown routineId.

Fixes #13633

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

* Keep the routine tools inside the agent context budget

The check:agent-context ratchet failed: the new tool texts added 422 bytes
to the tool descriptions and 99 bytes to the tool schemas.

The hint to read the full routine is now in the list_routines result, as
truncatedInstructions, only when the list cuts an instruction. Tool results
do not count toward the budget. The added description text and the
routineId description are removed. The update_routine schedule description
is now "Routine schedule.": the 3-minute rule is already in the tool
description. The schema baseline goes down by 16 bytes.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 19:07:35 +01:00
NB 6fbd8bfc20 Let the main chat and side threads of an agent use each other's browser tabs (#13433)
* Let every chat of an agent use the browser tabs of the agent

Main chats and side threads of an agent can now use all browser tabs of
that agent. list_tabs shows the chat that opened each tab and tells when
another chat uses a tab now. Takeover, submit_secret and list_logins use
the same rule. Channel and messaging threads still use only their own
tabs and the tabs shared with an @ tag.

* Keep channel tabs out of other chats and make the working hint reliable

The main chat and side threads use only the tabs that the main chat, a
side thread or no chat opened. Tabs of a channel or a messaging thread
stay out of these chats unless a person tags them with @.

otherChatWorking now also uses the last chat that used each tab in the
last 2 minutes, because control sessions end 1.2 s after a call.

A takeover from one chat no longer deletes the held takeover result of
another chat. list_tabs looks up each chat once per call.

The browser user-control E2E now covers the cross-chat access.

* Keep a held takeover result for each chat of a tab

Held takeover results used only the tab id as the key. When two chats of
one agent took over the same tab, the second result replaced the first.
The key is now the tab id and the thread id.
2026-11-20 13:51:50 +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
NB 3e79b85d4a Give a webhook routine's signing secret to its agent (#12242)
* Give a webhook routine's signing secret to its agent

A person who manages webhook routines can now press "Give the signing
secret to <agent>" on the signing secret row. After a confirm, the host
makes a new secret, saves it as an API key of the agent that owns the
routine (WEBHOOK_SECRET_<routine ID>), and then replaces the routine
secret. The answer has only the key name. Nobody copies the secret.

- The key is saved before the secret changes, so a failed save keeps
  the old secret.
- A regenerate or a sender's secret updates the key when the agent has
  it. Delete removes the key.
- New optional Team API capability webhook-agent-secret-v1, so the
  desktop with a joined server, the web client and mobile show the
  button only when the host has it.
- A channel routine has no single owner agent, so it has no button.

Refs #11895

* Keep the agent key and the routine secret the same

- Replace the routine secret first. When the key write fails, give the
  routine its old secret back, so the sender and the agent keep one secret.
- Remove the key in the routine delete hook, so each delete path removes it.
- Remove an old key when a save changes the trigger kind.
- Read the key with a new AgentApiKeys.has, which writes no file.
- Reset the "given" result when another routine opens.
- Correct the key name in the docs.

* Use one helper to remove a webhook secret key

The delete hook and the trigger change used two copies of the same
steps. Both now call removeWebhookSecretKey in webhook-routine-tool.ts.
2026-11-18 20:18:29 +01:00
Aleksander DygońandClaude Opus 5.5 562241ba85 Make webhook routine secrets work with Standard Webhooks senders (#7336)
* Make webhook routine secrets work with Standard Webhooks senders

New webhook routine secrets are whsec_ and 32 random bytes in standard
base64, as the Standard Webhooks specification says. Before, they were in
base64url without padding. Senders such as PostHog refused them, and the
Standard Webhooks check never used their decoded key, so each request got
401.

The check also accepts the exact base64url decoding of a stored secret, so
a secret that an older host made works after the user converts it to base64
in the sender. The stored secrets do not change.

The whsec_ log redaction pattern now also matches +, / and =, so it hides
the complete base64 secret.

Fixes #6638

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

* Check that Standard Webhooks senders can use the routine's own secret

The agent webhook routine E2E now checks that the card's secret is
standard base64, that a Standard Webhooks request signed with its decoded
key starts the routine, and that a base64url secret from an older host
still works after the sender converts it.

Refs #6638

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

* Say in the release notes that a joined server also needs this version

Refs #6638

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 03:17:00 +01:00
Aleksander Dygoń 3178ed6350 Give webhook routines an endpoint on a computer that is not published (#6567)
* Register the host for webhook routes without publishing it

A webhook route needs this computer registered for the signed-in account: a server ID and a
machine token. Only Publish and phone connect gave them, so a computer that was never published,
or that lost its token after a sign-out and sign-in, kept a routine without a URL forever. The
relay now registers the host before it registers a route when the ID or the token is missing. A
computer with no server gets the name "OpenBot", as phone connect gives it. The host stays
unpublished. Right after a sign-in, the registration waits until the account's host is bound:
the status change of that host starts the next sync.

Fixes #6029

* Register the host once per sync, as an automatic registration

- The registration of an existing host sends `automatic`, so the account service refuses a host
  that its owner removed (#5273).
- A sync calls `ensureHost` once, before the first route that it registers. A revocation does not
  register the host, and a failed registration is not sent again for each route.
- A background `configure` returns a failed registration to the caller and does not set an error
  status that the user did not cause.
2026-11-10 11:10:55 +01:00
NBandClaude Opus 5.5 b18d30f3c4 Let a user tag browser tabs and threads in chat (#5021)
* Let a user tag browser tabs and threads in chat

The @ picker of the chat composer now has sections for agents, browser
tabs and threads. A tag becomes a chip in the message.

- A tab tag lists only the tabs of the agent of the chat. When the user
  sends it, the host shares that tab with the target thread of the same
  agent, so a side thread can use a tab of the main chat.
- A thread tag gives the agent one short line: the title, the task id,
  the state and the start of the result. The agent reads more with
  history_read or history_search and the new optional taskId.
- The stored text keeps the marker. The marker expands at delivery, so
  the agent gets the current title and state.
- A click on a chip opens the tab page or the thread.

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

* Share a tagged tab when its prompt is built

- Share the tab with the public thread that gets the prompt, not when
  the message is queued. A queued message can move or change.
- Use the strict name rule for tab and thread titles.
- A popup keeps the shares of its opener tab.
- A tag from a teammate shows as a name only.
- The picker lists only tabs that have an owner agent.
- Use browserDisplayUrl in the picker.
- Make the thread question in chat-tags-e2e exact.

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

* Keep TaggedThreadState private to delivery-content

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 19:43:21 +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
Aleksander DygońandClaude Opus 5.5 43a7dcac57 Let delete_routine delete a webhook routine (#4664)
Before, delete_routine said that a webhook routine no longer existed,
although list_routines showed it. Now it deletes the routine through
the events service, as Routines settings do, so the route sync revokes
its relay route. As for the other webhook routine tools, only a turn
that a person's message started can do it. test_routine still does not
test a webhook routine, and now says that the user tests it in Routines
settings. The webhook routine E2E checks both tools.

Fixes #4509

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 12:56:22 +01:00
Aleksander DygońandClaude Opus 5.5 357f168fc9 Let an agent use a browser session of its own (#2907)
* Let an agent use a browser session of its own

Add the per-agent setting "Own browser session" (local only, off by
default). When it is on, new tabs of the agent open in the persistent
partition persist:openbot-browser-agent-<key>. The key is a hash of the
agent id. Two agents can then use different accounts on the same site.

- A tab keeps its session for its life. Popups use the session of the
  opener. The state file saves the key, and a restart restores each tab
  in its saved session. A tab without a key opens in the shared session;
  a tab with a malformed key is dropped.
- Every partition gets the same session configuration. Shutdown and
  flushPersistentStorage flush every persistent partition.
- A change of the setting closes the agent's tabs. Deleting an agent
  clears its own session.
- Add the browser-agent-session E2E check.

Part of #2646.

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

* Apply the local review findings to agent browser sessions

- Count active downloads across all sessions, so an agent's own session
  does not raise the download limit.
- Make clearAgentSession fail when a tab still uses the session, so the
  agent deletion logs it.
- Do not configure or keep a session only to clear it.
- Choose the session of a tab in one place.
- Run the agent browser session E2E in the Browser smoke CI job.

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

* Keep the agent session key check inside browser-state

knip reported isAgentBrowserSessionKey as an unused export. Only
browser-state.ts uses it.

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

* Add clearAgentSession to the channel manage E2E browser host

main added this fake after the branch point.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 14:11:25 +02:00
Aleksander DygońandClaude Opus 5.5 5876141ce6 Let agents create webhook routines and change their events from the chat (#2792)
* Let agents create webhook routines from the chat (#2785)

Add the openbot.create_webhook_routine tool. It saves through
HostEventsService, so the route limit, the secret encryption and the relay
sync are the same as in the routine editor. The tool result has the URL and
the request format. It does not have the signing secret: the result goes to
the model provider.

The chat records the creation. For a person who can manage the host's
webhook routines, the record is a card with the URL and a button that makes
the signing secret. The card shares the endpoint rows with the routine
editor (RoutineWebhookEndpoint).

Add scripts/agent-webhook-routine-e2e.ts and run it in CI.

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

* Allow the webhook routine tool only for a person's request

- Refuse create_webhook_routine in a turn that a routine run or an agent
  message started. Such a turn can carry a webhook body, which is
  untrusted.
- Say in the result where the user gets the signing secret: the card
  shows only to a person who manages the host's webhook routines.
- Give the full request format: the first character of the delivery ID,
  and the 400, 404, 413 and 503 responses. Share the clock skew limit
  through the contract.
- Remove the timezone argument. It has no effect on a webhook trigger.
- Do not say that a card exists when the chat record failed.
- Shorten the instruction that each turn sends.
- Load the webhook routines of a chat only after its schedule routines.

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

* Let a person change webhook routine events from the chat

- Add the openbot.update_webhook_routine tool. It changes the event type,
  the filters, the name, the instruction and the active state, and keeps
  the URL and the secret. Only a person's message can start it.
- list_routines now also returns webhookRoutines, so the agent can find
  a webhook routine and read its filters.
- The chat card shows the event type and the filters, and the person can
  change them and press Save. The editor and the card share the events
  row (RoutineWebhookEvents).
- Only the newest record of a routine in the chat is a card.

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

* Send a plain routine owner from the webhook chat card

A routine that the card reads from its store is a proxy. The desktop
bridge cannot clone it, so Save and Regenerate failed with "An object
could not be cloned." Copy the owner into a plain object.

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

* Close the gaps that the second review found in webhook routine tools

- Allow the webhook routine tools only in the agent's own chat, and only
  when every delivery of the turn is a person's message. A message that
  steers into a routine run, a channel task and a Slack or Telegram
  message no longer pass.
- Trim the event type that the agent sends, as the editor does.
- Leave the policies out of the update and the card save, so the host
  keeps the saved ones.
- On the card, take a newer saved value when the person took back an
  edit, and keep a new secret for the chat, not for the card row that
  the timeline can remove.
- Load the card list again when the host's routine routes change.
- Remove the guidance that sent every change to the settings.

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

* Keep Save after a failed card save, and open older webhook records

- After a failed save on the webhook card, the card keeps Save and shows
  the error beside it, so the person can try again.
- An older chat record of a webhook routine opens the routine. The
  available routine list had schedule routines only, so it showed
  "Unavailable".

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

* Type the webhook writer's limit policy without undefined

The indexed type EventRoutine["limitPolicy"] includes undefined, so the
save input failed the exactOptionalPropertyTypes ratchet in
host-events-service.ts.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 17:06:15 +02:00