Skip to content

feat(workflows): pick a t3 code machine and project for the t3 code step - #127139

Closed
Silthus wants to merge 45 commits into
feat/t3-code-step-gatefrom
feat/t3-code-thread-picker
Closed

Silthus wants to merge 45 commits into
feat/t3-code-step-gatefrom
feat/t3-code-thread-picker

Conversation

@Silthus

@Silthus Silthus commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Problem

  • To use the T3 Code step, a user creates a webhook task in T3 Code by hand and pastes its URL.

Impact: Grow Workflows: faster setup of the T3 Code step.

Note

Stacked on #127225 (flag gate and catalog entry), and also needs #127118 (Node template, on #127117). Moved from the fork PR #126492, which could not run CI.
Until #127118 merges, this diff also shows its Node template files.

Warning

🟡 Merge risk: medium · two-way door (merge-risk rubric)

  • New endpoints write the step's webhook URL from T3 Code's reply. A wrong URL starts no thread.
  • Limits: workflow-t3-code-step flag, signed-in members only, approval per call, stale replies dropped.
  • Revert: revert the merge commit.

Changes

  • The step gets a setup panel: pick a T3 Code machine and project, then create the task. PostHog fills in the URL.
  • Machines are the T3 Code connections the member can use in MCP servers settings, their own or team-shared.
  • Projects without a default model are disabled, because T3 Code needs one.
  • A machine with more than 100 projects shows "Load more projects". Each page asks for approval, because an approval covers one call.
  • The ready banner shows only while the webhook URL still points to the created task.
  • A project list PostHog can't read asks the member to update T3 Code, instead of showing no projects.
  • Mechanical: generated types, an mcp_store facade function, the skill reference, and a panel split with no visible change (not rendered).
  • The lane-mix warning is expected: the Node files come from feat(workflows): add a T3 Code step that starts a T3 Code agent run #127118, and services/mcp types ship with the serializer.
More than 100 projects Second page Ready URL edited
Load more projects Second page loaded Task ready Banner gone after editing the URL

How did you test this code?

Test rationale: API tests with real MCP installations and a faked T3 Code catch leaked connections, self-approving API keys and hidden errors. Logic tests catch a late reply, or a late page of projects, from a machine the member left. A paging test catches a dropped cursor that hides projects after the first 100.

  • Live run at 47c3b28 on a dev server: the picker paged a real T3 Code machine with 101 projects, created the task, and a saved workflow's test run started a thread whose agent replied.
  • The run used T3 Code's local hook URL, because T3 Connect was off on that machine. The relay hop is not covered.
  • The "Ready" screenshot stubs only the create reply, for the same reason.
  • Not run: a production-build UI walk.

Release status

  • This change is behind a feature flag and is not available to users

Docs update

  • None.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Agent: Claude Code, Claude Opus 5.5

Skills: /improving-drf-endpoints, /writing-tests, /writing-ui-components, /writing-pr-descriptions

More context for AI agents
Question Answer Who Where
What should the step offer? Pick a machine and project, start new threads there 👤 Human comment
Keep #127118's owner rule? No; #127118 drops it, private workflows (#126468) protect credentials. Replaces "yes" 👤 Human comment
How does PostHog reach T3 Code? The member's MCP connection (t3_project_list, schedule_task), not a new integration 🤖 Agent comment
API tokens on the setup endpoints? No, only a signed-in member, so approval stays with a person 🤖 Agent comment
Team-shared connections? Listed, because the admin shared them for members to use 🤖 Agent comment
Change T3 Code's API? No; the default-model limit has an open upstream fix (pingdotgg/t3code#16833) 🤖 Agent comment
One PR or a stack? One PR, because neither half works alone 🤖 Agent comment

Involvement: design pass by GPT-6.1 Sol; qa-swarm panel rounds 1 (7 lenses) and 2 (6 lenses) with GPT-6.1 Sol and Claude Opus 5.5; seven final reads; live run captured, plus a replay-key run at 4492b78. On PostHog/posthog: a GPT-6.1 Sol review at 7101ee3 led to the paging fix; a final read led to the late-page guard.

  • Session: T3 Code thread, Claude Code with T3 Code MCP tools and agent-browser.
  • Decisions: the webhook URL field stays editable, so a pasted URL still works.
  • Follow-ups: machines are keyed by host, like other MCP store member calls, so two connections on one host show as one. Deleting the step leaves its T3 Code task in place. A task created while T3 Connect is off stays unused when the member retries. T3 Code's open fix for model selection in schedule_task (fix(server): scheduled tasks created over MCP can set their model and effort pingdotgg/t3code#23566) would lift the default-model limit.
  • Read closely: workflow_t3_code.py and the approval flow in t3CodeTaskSetupLogic.ts.

🤖 Generated with Claude Code

Silthus and others added 30 commits October 30, 2026 05:10
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Send Data that is not an object as `data`, so instructions never fail the step.
- Tell users what to do on a 410 or 429, and to set the task's replay key.
- Offer T3 Code to generated workflows through the built-in step allowlist.
- Log only the hostname when a fetch connection resets, so a token in the URL stays out of logs.
- Mark Beta steps on the catalog node instead of a separate template id list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A workflow saved through the API or MCP gets no default for an optional input,
so the step sent only the instructions. The agent docs now also cover the 410
reply, keeping the result with output_variable, and what turning the flag off stops.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A T3 Code step runs on its owner's T3 Code account. Only the workflow's
owner, an org admin, or someone the owner shares it with as an editor can
now change a workflow with a T3 Code step, live-test it, or start runs by
hand.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The T3 Code step can now set itself up from a T3 Code connection in MCP
servers settings. The member picks a machine and a project, and PostHog
creates a T3 Code task there that starts a new thread for each run, then
fills in the step's webhook URL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r write paths

Turning a T3 Code workflow off stays open to every editor. Publishing a
draft, restoring a revision and approving a suggestion now need the owner
or someone they share it with. A transactional email workflow refuses a
T3 Code step, because every send would start a run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
T3 Code creates a task only in a project with a default model. The setup
panel now says so when no project on the machine has one, and says when
the step already sends its runs to a task. The workflow building docs
point agents to the in-app setup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A teammate's save or canvas enable that raced the owner adding a T3 Code
step passed the check on the read state. Both writes now repeat the check
on the locked row. The bytecode refresh command also crashed on workflows
without a creator, because the check read the user of its bare request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A late reply for a machine or project the member left no longer
  replaces the projects or sets the step's webhook URL.
- A failed project load offers "Try again", and a machine retry clears
  its old error.
- Only a signed-in member can use the T3 Code setup endpoints, so an API
  token cannot answer its own approval.

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

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

- A late failure for a machine or project the member left no longer
  clears the current projects or shows the old error.
- The machine and project pickers wait while the task is created.
- The 403 for API keys says that only a signed-in member can set up
  the step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The previous check called the unenforced most-specific resolver, which the
repo guard forbids, and in legacy resolution a teammate with an object-wide
viewer rule and a resource-wide editor rule could act for the owner. The
check now uses the enforced methods, and a share must name a member or role.

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

A teammate could restore a revision or approve a suggestion that stages a
T3 Code step on a workflow without one, and both checks ran before the row
lock. The early check now covers the staged actions, and both services
check the locked workflow again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…th a t3 code step

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…trol is off

Without the access control feature, the legacy resolver returned the
default editor level before it applied specific_only, so every member
counted as shared. Only explicit member or role rules count now.

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o feat/t3-code-thread-picker

# Conflicts:
#	products/workflows/skills/building-workflows/references/graph-schema.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The T3 Code step now sends a webhook-id header that stays the same
across retries, and no longer sends x-posthog-delivery-id.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
t3_project_list returns at most 100 projects and a nextCursor. The
projects endpoint dropped the cursor, so a member could not pick a
project past the first page, and the panel could say no project has a
default model when a later one does.

The endpoint now takes an optional cursor and returns next_cursor. The
panel offers "Load more projects", which asks for approval like the
first page because an approval covers one call with its exact arguments,
and appends the page to the projects already loaded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A hidden Node destination template, template-t3-code. It posts the
workflow's instructions, event and person to a T3 Code webhook task and
signs the body through the webhook fetch's hmac_sha256 option, with a
webhook-id that stays the same across retries.

Connection-reset retry logs in cdpTrackedFetch now carry the hostname
and template id instead of the full URL, which can hold a token.

The flag gate, the step catalog entry and the icon land in the Django
and frontend PR, which must merge first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Silthus and others added 2 commits November 2, 2026 09:23
…t list

A later page that was still loading when the member left a machine and
came back passed the old machine-and-cursor check once the fresh first
page restored the same cursor, so it was appended to the new list. Each
first-page load now gets a new list id, and a later page lands only on
the list it was asked for.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Move the panel's branching into logic selectors, and render the machine
field, project field and status from their own components under
BindLogic. Copy and data-attr values are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Silthus and others added 4 commits November 2, 2026 10:13
…uests

The executor sends no body for GET and HEAD, so every signer must sign
the empty body. Only the HMAC-SHA256 signer had a receiver-side test for
that. Standard Webhooks now verifies against the bytes received for
POST, GET and HEAD, and SigV4 re-signs the received GET and HEAD request
as AWS does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t/t3-code-thread-picker

# Conflicts:
#	products/workflows/backend/presentation/views/hog_flow.py
#	products/workflows/skills/building-workflows/references/graph-schema.md
@github-actions github-actions Bot added the feature/agent-infra Feature Tag: Agent infra label Nov 2, 2026
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit d21bc35.

@Silthus
Silthus changed the base branch from feat/t3-code-workflows-step to feat/t3-code-step-gate November 2, 2026 11:47
@github-actions github-actions Bot removed the feature/agent-infra Feature Tag: Agent infra label Nov 2, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Silthus and others added 2 commits November 2, 2026 15:18
T3 Code is an untrusted upstream. A projects value that is not a list of
objects with a string id and title now gets an actionable 400, like other
failed tool calls, instead of a server error or a project without an id.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ints to it

After a member creates the task, editing or clearing the step's webhook URL
left the success banner up and hid the create button. The banner now
depends on the step's current webhook URL matching the created task's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A reply whose projects field is missing, false or an empty object read as
an empty list, so the picker showed no projects instead of asking the
member to update T3 Code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Silthus
Silthus added this pull request to stack #127967 November 3, 2026 07:31
@scheduled-actions-posthog

Copy link
Copy Markdown
Contributor

This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, please remove the stale label – otherwise this will be closed in another week. If you want to permanently keep it open, use the waiting label.

@Silthus

Silthus commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

Closed in the 2026-11-13 draft triage: no map or thread owns the T3 Code step, and nothing replaced it. The branch stays. Its webhook-signing base, #127117, goes ahead on its own.

@Silthus Silthus closed this Nov 13, 2026

This branch is being deployed

1 in progress deployment
hogbox-preview — 960d58fa Deployed Nov 2, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cross-lane-change Allow for cross lane (i.e. django + rust) changes to merge at once hogbox-preview Spin up a per-PR PostHog preview on a hogland hogbox

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants