Skip to content

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

Closed
Silthus wants to merge 26 commits into
PostHog:masterfrom
Silthus:feat/t3-code-thread-picker
Closed

Silthus wants to merge 26 commits into
PostHog:masterfrom
Silthus:feat/t3-code-thread-picker

Conversation

@Silthus

@Silthus Silthus commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Problem

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

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.
  • Mechanical: generated types, an mcp_store facade function, the skill reference.
Pick a project Approve Ready
Pick a project Approve the call Task ready

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 that sets the URL for a machine the member left.

  • Live run: a saved workflow's test run started a thread on a real T3 Code machine.
  • 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 #126070's owner rule? No; #126070 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; five final reads; live run captured, plus a replay-key run at 4492b78.

  • 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: 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 9 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>
@trunk-io

trunk-io Bot commented Oct 30, 2026

Copy link
Copy Markdown

Merging to master in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@Silthus

Silthus commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor Author

Note

🤖 Claude Opus 5.5 responding on behalf of Michael

Decisions for this PR:

Silthus and others added 17 commits October 30, 2026 20:28
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>
…o feat/t3-code-thread-picker

# Conflicts:
#	products/workflows/skills/building-workflows/references/graph-schema.md
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>
@Silthus Silthus added posthog-review hogbox-preview Spin up a per-PR PostHog preview on a hogland hogbox labels Nov 2, 2026
@Silthus

Silthus commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Moved to #127139, a branch in PostHog/posthog, so it can run CI. The commits and the decisions comment moved with it.

@Silthus Silthus closed this Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

1 participant