openai-assistants-sunset
v0.1.0
Published
Scan JS/TS + Python for OpenAI Assistants & Threads API call-sites and gate CI on the Aug 26 2026 shutdown. Zero dependencies.
Downloads
173
Maintainers
Readme
openai-assistants-sunset
On August 26, 2026 OpenAI shuts down the Assistants API. /v1/assistants, /v1/threads, and /v1/threads/runs start returning errors — no grace period, no degraded mode. OpenAI has said it will not ship a migration tool, and Threads have no automatic migration to the Responses/Conversations API.
This finds every call-site that will break, with file and line number, and fails your CI build so a forgotten one can't ship. Zero dependencies, no config, one command:
npx openai-assistants-sunset52 day(s) until the Assistants API sunset (2026-08-26).
Call-sites that break at sunset (7 in 2 file(s)):
src/agent.ts
41: const assistant = await openai.beta.assistants.create({ model: 'gpt-4o' });
↳ openai.beta.assistants.* — Assistants resource, removed at sunset
58: const run = await openai.beta.threads.runs.create(thread.id, { ... });
↳ openai.beta.threads.* — no auto-migration to Conversations
workers/ingest.py
12: vs = client.beta.vector_stores.create(name="kb")
↳ client.beta.vector_stores.* — beta vector stores move to the top-level API surfaceWhy a scanner and not grep
A bare grep beta.assistants misses the raw-HTTP callers (fetch('/v1/threads')), the OpenAI-Beta: assistants=v2 header, and the Python SDK, while flagging every commented-out line and string that happens to contain the word. This scans JS/TS and Python, ignores commented-out code, separates the sure things from the maybes, and — the part grep can't do — gives you a CI gate keyed to the actual shutdown date.
What it catches
High confidence (these break at sunset):
openai.beta.assistants.*/client.beta.assistants.*openai.beta.threads.*/client.beta.threads.*— including.runs,.messages,.runs.stepsopenai.beta.vectorStores.*/client.beta.vector_stores.*- deep imports of
openai/resources/beta/assistantsand.../threads - raw
/v1/assistantsand/v1/threadsURLs - the
OpenAI-Beta: assistants=v2header
Low confidence (reported separately, never fails CI on its own):
assistant_id/thread_idreferences — usually config or a stored Threads pointer worth a look, since Threads don't auto-migrate.
Gate CI on the deadline
--ci exits non-zero when any high-confidence call-site is found:
# .github/workflows/assistants-sunset.yml
name: assistants-sunset
on: [push, pull_request]
jobs:
scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: 20 }
- run: npx openai-assistants-sunset --ciOnce you've migrated a package, the gate keeps the API from creeping back in.
Options
npx openai-assistants-sunset [paths...] [options]
--ci Exit 1 if any high-confidence call-site is found
--json Machine-readable output
--high-only Hide the low-confidence assistant_id / thread_id list
--ignore <dir> Extra directory name to skip (repeatable)
--no-color Disable ANSI color
-h, --help
-v, --versionnode_modules, .git, dist, build, .venv, venv, __pycache__ and the usual build dirs are skipped by default.
JSON
npx openai-assistants-sunset --json > assistants-inventory.json{
"sunset": "2026-08-26T00:00:00Z",
"daysToSunset": 52,
"scannedFiles": 214,
"highCount": 7,
"lowCount": 1,
"filesWithHigh": 2,
"findings": [ { "file": "src/agent.ts", "line": 41, "surface": "assistants", "confidence": "high", "hint": "..." } ]
}Pipe it into a dashboard, a PR comment, or your own migration tracker.
What this does not do
It finds the call-sites; it does not rewrite them. The Assistants → Responses move is a real design change — Threads are stateful and Conversations are not — and there is no mechanical codemod for it. Use this to get an exact, shrinking punch-list and to make sure nothing slips past the date. The migration itself is on you: https://developers.openai.com/api/docs/assistants/migration
Programmatic use
const { scan } = require('openai-assistants-sunset');
const result = scan(['src'], { root: process.cwd() });
console.log(result.highCount, result.daysToSunset);License
MIT
Built autonomously by an AI agent.
