Quick reference
1. Opt the agent in before you need it
SetversionSkew: "follow-mid-turn" on the agent and deploy it on its own, before you deploy the fix. Adding it in the same deploy as the fix is too late: it’s the old run that notices the threshold and hands its reply over, so the option has to be in the version that is already running when the fix ships.
trigger/support-agent.ts
"follow-mid-turn". If either is older, the reply finishes on its old version, and the check in step 4 lists its run until the run ends. Moving a running turn lists the other requirements.
2. Write the fix so it runs before the change
The fix is deployed first and the breaking change comes last, so the fixed version has to work against things as they are now. For a migration that renames a column, the fix reads the new column when it exists and falls back to the old one. For a removed tool, the fix stops offering the tool while the tool’s backend still answers.3. Deploy the fix and set the threshold
Deploy the fix, then set the threshold to its version. The deploy authenticates with a personal access token (TRIGGER_ACCESS_TOKEN), but the threshold API needs the environment’s secret key (tr_prod_... for production, from the API keys page): store it as a separate TRIGGER_SECRET_KEY secret. The deploy step sets a deploymentVersion output:
.github/workflows/release-trigger-prod.yml
200
"task": "support-agent" to the body (a threshold for one task). To set it from the dashboard instead, open Session upgrades under Deployments and choose Upgrade sessions.
From here, each chat on an older version moves to the fix:
- A reply in progress stops after its current step (a running tool finishes first), and the fix continues it. The person chatting sees a pause of a few seconds.
- A reply to a channel message, such as one from Slack, finishes on its old version, because its answer posts back through that delivery. The chat moves at its next message. Wait for that reply before you cancel its run in step 4.
- A chat that gets a new message answers it on the fix.
- A chat nobody messages keeps its old run until the run ends on its own after the agent’s idle timeout.
4. Check that nothing older is running
Before the breaking change, make sure no run on a version below the threshold is still active. This script lists them, and cancels them with--cancel. On the dashboard, the Runs page shows the same list when you filter by Version and by Status (skew protection threshold).
scripts/old-runs.ts
TRIGGER_SECRET_KEY:
Output
EXECUTING or WAITING while it waits for the next message. Wait for it to end after the agent’s idle timeout, or cancel it with --cancel. Canceling an idle chat run loses nothing: the chat’s next message starts a run on the fix with the whole conversation. Don’t cancel a run that is replying: it hands over when its current step ends, and canceling it loses the reply.
Run the script again until it prints:
Output
5. Make the breaking change
Run the migration, remove the tool’s backend, or change the API. Only versions at or above the threshold are running, and every chat that comes back later starts on the current deployment.Verify it
- A reply that moved. On the Runs page, filter by the chat’s tag (
chat:<chatId>). The run on the older version ends as Completed when its step finishes, and the next run, on the fix, starts a few seconds later and finishes the same reply. - A chat that was idle. Send it a message. The answer comes from a run on the fix. If you didn’t cancel the old run, that run ends as canceled with a reason that links the new one.
See also
- Skew protection threshold: every option of the threshold, for an environment or one task
- Moving a running turn: what your code sees when a reply moves mid-turn
- Version upgrades: which tool moves a chat when

