Skip to content

T3code/webhook automations - #14600

Closed
pzep1 wants to merge 5 commits into
pingdotgg:t3code/codex-turn-mappingfrom
pzep1:t3code/webhook-automations
Closed

pzep1 wants to merge 5 commits into
pingdotgg:t3code/codex-turn-mappingfrom
pzep1:t3code/webhook-automations

Conversation

@pzep1

@pzep1 pzep1 commented Oct 1, 2026 •

Copy link
Copy Markdown

Problem

Automations will only run on a clock. I don't want to be the meat bag pasting in sentry issue links so i want to add webhook support.

Changes:
Scheduled tasks gain a webhook schedule backed by a T3 Connect inbox.

  • Relay: POST /v1/inbox/:id stores the request and returns 202. A queue consumer pushes it to the environment over the managed tunnel as a relay-signed request to /api/t3-connect/webhook-delivery, verified the same way as the health check, with a digest binding the proof to the delivery. The relay deletes a delivery only after the environment's signed ack verifies. Queue retries and the five-minute cron cover offline machines; deliveries expire after 7 days.
  • Server: each delivery starts one run. The message is the task's instructions plus the request as received, marked as untrusted data. The command id is keyed on the delivery id, so a redelivery can't start a second thread. Agents can't create webhook URLs through MCP.
  • Clients: "On a webhook" in the task editor on web and mobile, a URL card with copy, and a project-settings entry.

Limits: bodies up to 256 KB, at most 100 pending deliveries per inbox, and delivery only to tunnel-linked environments.

Uses the existing T3 Connect relay Worker. There's no new service. Deploying the relay adds one migration (two tables), one queue with a dead-letter queue, and a step in the existing five-minute cron.
Needs T3 Connect with remote access. Deliveries arrive over the environment's managed tunnel, the same channel as the health check. Machines that aren't linked, or are linked for notifications only (publish_only), can't use webhook schedules. The server refuses to create an inbox for them, and the editor says the machine must be linked to T3 Connect with remote access. Local and Tailscale-only setups need a direct ingress path, which isn't part of this PR.

Screenshots

Task list: the webhook task shows as listening
01-task-list

Row actions: "Copy webhook URL" replaces "Run now"
02-row-menu

Editing a webhook task: the URL card (inbox id blurred)
03-edit-webhook-task

New task with "On a webhook" selected: the URL is created on save, and instructions are prefilled
04-new-webhook-task

Project settings → Automations entry
05-project-automations-row

Thread started by the first webhook: the request as received, and the agent's answer
06-thread-online

Thread started by the webhook sent while the machine was offline: delivered after restart
07-thread-offline-catch-up

pzep1 and others added 3 commits October 1, 2026 12:32
Adds a `webhook` schedule. Saving one creates a T3 Connect inbox and keeps
its URL across edits; switching away or deleting the task removes it.

Deliveries arrive the way the Connect health check does: the relay sends a
signed request to `/api/t3-connect/webhook-delivery` over the managed tunnel.
The server verifies it against the cloud mint key with the same lifetime,
scope and replay checks, confirms the delivery matches the digest in the
proof, and answers with a proof signed by the environment key. Each delivery
starts one run whose message is the task's instructions plus the request as
received, marked as external data. The run's command id is keyed on the
delivery id, so a redelivery cannot start a second thread. A busy task
answers 409 so the relay retries; paused or deleted tasks drop deliveries.

Agents keep scheduling time-based work only: the orchestrator MCP schedule
schema excludes webhooks, since a webhook URL starts agents from outside.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…channel

Adds a public `POST /v1/inbox/:inboxId` that stores whatever is posted to it
(body plus non-credential headers) and queues it for the owning environment.
A queue consumer pushes each delivery over the environment's managed tunnel
with a relay-signed request, the same way the connector checks health, and
deletes it once the environment's signed ack verifies. Failed pushes retry on
the queue and the five-minute cron requeues anything still pending, so a
machine that was asleep catches up when it is reachable again.

Inbox ids carry 256 bits and are the only credential a sender needs. Bodies
are capped at 256 KB, each inbox holds at most 100 pending deliveries,
deliveries for unlinked environments are refused, and anything older than
seven days is dropped.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Adds "On a webhook" as a schedule choice in the task editor on web and
mobile. Saved webhook tasks show their URL with a copy action, list as
"Listening" or "Paused", and offer "Copy webhook URL" instead of "Run now",
since a webhook run needs a request to act on. Project settings gain an
Automations row that opens the task list scoped to that project.

Docs cover using the URL and the T3 Connect remote-access requirement, and
record why deliveries reuse the health-check channel.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XXL 1,000+ changed lines (additions + deletions). labels Oct 1, 2026
Comment thread infra/relay/src/worker.ts Resolved
Comment thread infra/relay/src/persistence/schema.ts Resolved
@macroscopeapp

macroscopeapp Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR introduces a distributed webhook-triggered automation capability with public ingestion, persistent queues, production schema changes, managed-tunnel authentication, and agent execution from external requests. Several unresolved correctness and resource-safety risks remain in concurrency, delivery routing, request-size enforcement, and payload handling.

Not approved because:

  • 7 blocking correctness issues found at or above your repo's Minimum Blocking Severity

Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more.

pzep1 and others added 2 commits October 1, 2026 14:19
…mission

- Relay: inboxes record the linked user that created them, and deliveries
  use that user's link and tunnel only. The server sends its linked user id
  when creating an inbox, as tunnel recovery registration already does.
- Relay: the inbox reads bodies as a stream and stops past 256 KB, so a
  sender without Content-Length cannot make the Worker buffer more.
  Non-UTF-8 bodies are rejected with 415 instead of stored mangled.
- Server: saves and deletes of scheduled tasks run one at a time, so
  concurrent saves cannot orphan an inbox or delete one another just kept.
- Server: a webhook run re-checks the fresh task row before dispatch and
  drops the delivery if the task was deleted, paused or re-pointed.
- Server: prompt fences are a fixed length and long backtick runs in the
  payload are split, so a backtick-heavy body cannot inflate the prompt.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

Copy link
Copy Markdown
Member

Note

This comment is posted by Julius' dot

Closing under prior approval. The new webhook schedule, public relay inbox/queue, and web/mobile editor path add event-triggered automations beyond the existing clock-based capability. No explicit maintainer approval of that direction and scope is linked in the description or discussion. Please discuss the webhook workflow and relay/delivery scope with maintainers in Ideas, link their approval, and request reconsideration. The need to act on incoming events without manually pasting links is a useful problem to retain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants