Kortix Rollback logo

Kortix Rollback

OrganizationPopular
kortix-ai
kortix-rollback

How to roll Kortix PRODUCTION back to an older already-released version — the inverse of a release. Covers the one-dispatch rollback-prod.yml engine (--ref prod, shares the deploy-prod concurrency group), the per-surface mechanics (api with KORTIX_PROCESS_ROLE=all and the worker scaled to 0, gateway = immutable :X.Y.Z image; Vercel frontend = promote), what undoes a rollback (any deploy-prod run, any push to prod), the DB/migration-drift check that is the real blocker, and how a later promote returns prod to latest. Load WHENEVER the user wants to roll back / revert / downgrade / 'go back a version' on prod, asks how the rollback or the frontend rebuild-skip behavior works, or needs to run rollback-prod.yml. Pairs with kortix-release (the forward direction).

Overview

Publisherkortix-ai
RepositoryCompanyOS
Skill namekortix-rollback
Stars
20.8K
Forks
3.5K
Bundled files
Instructions only
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by kortix-ai on GitHub. Read the source before you install it.

Installation

Install the Kortix Rollback AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/kortix-ai/CompanyOS/tree/dev/.agents/skills/kortix-rollback
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/kortix-ai/CompanyOS.git /tmp/CompanyOS
mkdir -p .claude/skills
cp -r /tmp/CompanyOS/.agents/skills/kortix-rollback .claude/skills/kortix-rollback
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Kortix Rollback in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Kortix Rollback on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Kortix Rollback is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Kortix Rollback

The inverse of kortix-release. A release moves prod FORWARD onto new code; a rollback re-points prod at an OLDER already-released vX.Y.Z, reusing that release's prebuilt artifacts (zero rebuild). Use it when a shipped version is breaking and the move is "go back now, fix forward later." The next forward release still comes from staging, not directly from dev.

A rollback is temporary, never sticky. It rolls ECS services and promotes an old Vercel build. It never pushes to prod, never touches VERSION or a branch, and never moves an image tag. The next deploy-prod run supersedes it and returns prod to the version in prod:VERSION (see §6).

1. The one command

bash
gh workflow run rollback-prod.yml --repo kortix-ai/CompanyOS --ref prod \
  -f version=vX.Y.Z -f reason="<incident summary>" -f confirm="ROLLBACK PROD"

--ref prod is required: the job runs in environment: prod, which admits the prod branch only. The run shares the deploy-prod concurrency group with deploy-prod.yml, so a rollback dispatched during a release roll starts when that roll ends. GitHub keeps one pending run per group: a rollback dispatched while a deploy-prod run waits replaces the waiting run.

It plans each backend surface from the images that exist for X.Y.Z (a surface with no :X.Y.Z image is skipped), then rolls in this order, one step after the other:

  1. api (ECS): ecs-deploy.sh prod kortix/kortix-api:X.Y.Z --process-role all. The api tasks run the scheduled jobs. After that rollout is stable the script scales kortix-prod-worker to 0. The worker is never rolled here.
  2. gateway (ECS): kortix/kortix-gateway:X.Y.Z.
  3. frontend (Vercel): promotes the production deployment whose commit message names release vX.Y.Z. Skipped without VERCEL_TOKEN; fails when no such deployment exists. kortix.com runs on Vercel only: the parallel ECS frontend (prod-fe-ecs.kortix.com) was removed in 2026-11.

A failed step stops the run: the surfaces before it are on X.Y.Z, the ones after it are on the current version. Read the step log, not the summary table: the summary prints the plan, not the result. Re-run with -f surfaces=<the rest>.

What it does not do:

  • It moves no image tag. :latest, :prod and :stable stay on the current version, so self-hosted boxes keep what they run.
  • It opens no pull request and merges nothing into prod (the job has contents: read).
  • It does not roll the database back (§4).

2. Per-surface mechanics

The backend (API, worker, gateway) runs immutable images on ECS Fargate. infra/scripts/ecs-deploy.sh registers a new task-definition revision that points at the :X.Y.Z image and waits until the service is stable. The image is frozen, so the roll is exact.

The Vercel frontend is built on the deploy-prod.yml runner and uploaded prebuilt (infra/scripts/vercel-deploy-prebuilt.sh). Vercel keeps every deployment's output, but there is no image tag. A Vercel rollback is a promote of the old production deployment. The branch still holds the newer frontend code.

3. What undoes a rollback

Nothing records that prod is rolled back: the state lives only in ECS and Vercel. Each of these returns prod to the version in prod:VERSION:

  • Any deploy-prod.yml run. A push to prod (a release merge) or a manual dispatch (rebuild_desktop, a re-run) rolls worker, api and gateway to prod:VERSION, redeploys the Vercel frontend, and switches the api back to KORTIX_PROCESS_ROLE=web. Do not dispatch deploy-prod.yml while prod is rolled back, unless you mean to roll forward.
  • Vercel never builds on a push. The Vercel project has no Git connection, and apps/web/vercel.json sets git.deploymentEnabled: false. kortix.com changes only through deploy-prod.yml (deploy-web-vercel), so a Vercel instant rollback of the frontend holds until the next deploy-prod.yml run.

Until one of these runs, the worker stays at 0 and the api runs the scheduled jobs (KORTIX_PROCESS_ROLE=all). Nothing expires that state: plan the roll forward.

4. Safety check BEFORE you roll — DB / state drift is the real blocker

The image-reuse + Vercel-promote mechanics work for any released version. What actually makes a rollback unsafe is forward state the old code can't handle — overwhelmingly the database.

Migrations in this repo are forward-only and additive by convention (ADD COLUMN/VALUE, CREATE … IF NOT EXISTS). Against additive migrations old code is safe: the live schema is a strict superset of what the old version needs. Never reverse a migration — that's what breaks things, not rolling code back.

The danger is a destructive migration between the target and current — a DROP COLUMN, RENAME, ALTER … TYPE, or a new NOT NULL. Old code hitting that breaks. The plan step prints how many migrations prod has that vX.Y.Z lacks, and a ::warning:: names the files that contain one of those statements. It does not refuse: a person decides. Check it before you dispatch:

bash
git diff vX.Y.Z..origin/prod -- packages/db/migrations
  • All additive (ADD …, CREATE … IF NOT EXISTS) → DB-safe to roll there.
  • Any DROP / RENAME / ALTER … TYPE / new NOT NULL → stop and think.

Lesser, non-DB couplings (rare long tail): forward-written persisted state old code can't parse (queue/cache formats), or external contract changes (Stripe API version, webhook shapes).

Kortix Apps: static hosting and retention do not roll back

Two Apps changes ship in one release and survive a code rollback:

  1. Static Apps go offline on an older api. A static App is served by the api from storage (apps/api/src/apps/static-site.ts) and has no app_runtimes row. An api that predates that file requires a runtime, so every static App answers with a status page until the next promote. rollback-prod.yml refuses such an api target unless static_apps_ack is exactly STATIC APPS OFFLINE. Rolling only gateway,frontend is not affected.

  2. Retired deployments stay retired. The first maintenance pass after the release retires every ready deployment beyond the active one and the newest KORTIX_APPS_RETAINED_DEPLOYMENTS (default 5), 50 Apps per pass. It tears down their runtimes and images; reclaimAppArtifacts deletes their archives 24 h later. A rollback cannot bring them back. Before the first release, count what it will retire:

    sql
    select app_id, count(*) - 6 as retired
    from kortix.app_deployments where status = 'ready'
    group by 1 having count(*) > 6;

    To defer it, set KORTIX_APPS_RETAINED_DEPLOYMENTS high on prod for that release and lower it on the next one.

Email: received mail waits for the roll-forward

From the release that stores each received email before the ack (KRTX-2235 step 3), the api puts Email on the integration.events.email job queue. An older api never claims that queue, so emails stored before the rollback stay queued until a later promote runs them; Resend got its 200 and does not resend. Nothing is lost, only late. List what waits:

sql
select job_key, created_at from kortix.job_queue
where queue = 'integration.events.email' and status = 'queued' order by created_at;

If a sender must not wait and the rollback target has the Resend route (POST /v1/webhooks/email/resend, first shipped after v0.14.8), replay that email from the Resend dashboard: the older api handles it, and the stored copy is a no-op at the roll-forward (its session create already started, or its follow-up key exists). A target without that route receives no Resend mail at all; Resend's own retries (8 over about 31 h) then decide what arrives after the roll-forward. Delete nothing.

5. Per-surface availability (the engine handles this)

You can't roll a surface BELOW where it existed. The gateway only entered prod at ~v0.9.72 (image exists from 0.9.69), so there is no kortix-gateway:0.9.68. The workflow checks each image (Docker Hub tags API) and skips any surface with no :vX.Y.Z image rather than wedging ECS on ImagePullBackOff.

6. Resuming — a later release returns prod to LATEST

You do NOT manually undo a rollback. To resume, get the fix onto staging and Promote to Production (see kortix-release). Its merge into prod runs deploy-prod.yml, which rolls ECS to the new version, scales the worker back up, and builds and deploys the latest Vercel frontend.

7. Gotchas

  • Never roll an ECS service from a laptop while a deploy workflow can run (learnings ledger, 2026-11-01): the workflow's concurrency group does not see a local roll. Use this workflow.
  • Verify after: api.kortix.com/v1/health (version), ECS service health, kortix.com/api/health (version), and the live Vercel production deployment (/v9/projects/{id} → targets.production).

Frequently asked questions

What does the Kortix Rollback AI skill do?

How to roll Kortix PRODUCTION back to an older already-released version — the inverse of a release. Covers the one-dispatch rollback-prod.yml engine (--ref prod, shares the deploy-prod concurrency group), the per-surface mechanics (api with KORTIX_PROCESS_ROLE=all and the worker scaled to 0, gateway = immutable :X.Y.Z image; Vercel frontend = promote), what undoes a rollback (any deploy-prod run, any push to prod), the DB/migration-drift check that is the real blocker, and how a later promote returns prod to latest. Load WHENEVER the user wants to roll back / revert / downgrade / 'go back a...

Why use Kortix Rollback on TypingMind?

Because you install it once and use it with any model. Kortix Rollback is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Kortix Rollback in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/kortix-ai/CompanyOS/tree/dev/.agents/skills/kortix-rollback. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Kortix Rollback?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Kortix Rollback?

As many as you like. As long as a model supports skills, you can use Kortix Rollback with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Kortix Rollback AI skill free?

It is published on GitHub by kortix-ai. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇