Logo Kortix Rollback

Kortix Rollback

Tổ chứcPhổ biến
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).

Tổng quan

Nhà phát hànhkortix-ai
Kho mãCompanyOS
Tên kỹ năngkortix-rollback
Sao
20.8K
Bản fork
3.5K
Tệp đi kèm
Chỉ có hướng dẫn
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Hướng dẫn có đủ mọi thứ cần thiết

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được kortix-ai công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Kortix Rollback trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/kortix-ai/CompanyOS/tree/dev/.agents/skills/kortix-rollback
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

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
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Kortix Rollback trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Kortix Rollback ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Kortix Rollback với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

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).

Câu hỏi thường gặp

Kỹ năng AI Kortix Rollback làm được gì?

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...

Vì sao nên dùng Kortix Rollback trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Kortix Rollback là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Kortix Rollback trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/kortix-ai/CompanyOS/tree/dev/.agents/skills/kortix-rollback. TypingMind đọc tệp SKILL.md rồi cài đặt kỹ năng để bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Kortix Rollback?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Kortix Rollback với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Kortix Rollback với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Kortix Rollback có miễn phí không?

Kỹ năng này được kortix-ai phát hành trên GitHub. Hãy xem điều khoản giấy phép trong kho mã. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇