Repository navigation
Releases: cortexkit/openai-auth
Release list
v1.8.4
Fixed
- Leftover temporary files in OpenCode's config folder. An interrupted save before the 1.8.0 move could leave temporary
.tmpfiles in OpenCode's config folder (for exampleopenai-auth-vault/opencode-roster.json.<id>.tmp), and the move left them there. The plugin now removes them at startup, including on installs that already moved. It only removes files named like its own temporary saves next to its own state, session and vault files;openai-auth.jsonand anything else are never touched. - Pi: the account folder follows
PI_CODING_AGENT_DIR. The Pi extension read the account store fromPI_AGENT_DIR, a setting Pi itself no longer uses. It now uses Pi's ownPI_CODING_AGENT_DIR(with~expanded, as Pi does). If your accounts or vault connection exist only in the old~/.pi/agentfolder, the extension keeps using them there and prints a warning once. Credentials are never copied or moved.PI_OPENAI_AUTH_FILEstill overrides the location. - Sidebar after a vault disconnect in another OpenCode window. Disconnecting from the vault in one OpenCode window could make the others' sidebars drop their routing and pinned-account lines. They're no longer dropped.
Changed
- Sidebar shape. The sidebar matches anthropic-auth and antigravity-auth: the header keeps showing the version (unless you turned the version off in the sidebar preferences) instead of swapping it for the yellow LIMITED badge; blocked accounts already show on their own rows, and rows such as Killswitch always keep a space between label and value, cutting a long value with
…instead of running the two together at narrow widths. The sidebar also asked for a border in a form OpenTUI ignores, so it never actually drew one; that unused setting is removed, and nothing else changes on screen.
v1.8.3
Fixed
- OpenCode 2: updating the plugin without restarting OpenCode works. When OpenCode 2 reloaded openai-auth from an older version inside a running service, several parts could call into the older version's leftover state and fail: the
/openaicommand, OpenCode 2 session records, session pins and the shared vault connection. Each now leaves the older state alone and starts its own. - No file move while an older version may still be writing. A reload doesn't stop the older version's timers, so a version before 1.8 can keep writing to OpenCode's config folder until OpenCode restarts. If an older openai-auth ran in the process, the plugin keeps its files in the config folder until the next restart and blocks other OpenCode processes from moving them meanwhile. It says so once in the log, and never refuses to start. The files move on the next start after every OpenCode has restarted.
v1.8.2
Fixed
- Long paths on Windows. Private files could not be created once their full path reached 260 characters, Windows' classic path limit. Lock files under the state folder sit close to that limit for ordinary profiles, and a long username or a custom
XDG_STATE_HOMEcrosses it. Those files now use Windows' long-path form, so deep paths work. - File locks on Windows. Releasing a lock gave up after a few milliseconds when another process held the lock's short-lived guard, and reported a timeout. Release now waits for the guard to clear. A guard left without an owner, for example after a failed write, no longer blocks other processes. A failed write inside a lock now reports its real error instead of a timeout.
Changed
- Moves to
@cortexkit/common-auth0.29.0 and@cortexkit/private-files0.2.2, which carry these fixes.
v1.8.1
Fixed
-
Vault mode no longer reads local accounts at startup. While OpenCode is connected to the Claustrum vault, only vault accounts are used, but the plugin still opened and parsed the local account files when OpenCode started, including the token file. It now reads only its settings from
openai-auth.jsonwhile connected, and loads local accounts the first time they're used after you disconnect, with no restart needed.- OpenCode 2: a damaged local token file stopped the plugin from starting, even in vault mode. It no longer does.
- OpenCode 1: a damaged local token file made the plugin forget your saved settings in vault mode, killswitch floors included. They're kept now.
-
The vault menu no longer reads "0 accounts" before the vault has answered. Right after OpenCode or Pi starts, or after the vault daemon restarts,
/openaicould show "Connected · 0 accounts" with advice to grant access, when the vault simply hadn't answered yet. It now says "Connected · waiting for the vault's first answer", with no account actions until the vault answers. A vault that answers with no accounts still shows the existing message and its fix. The sidebar makes the same distinction.
Changed
- Tested on OpenCode 2.2.0. The real OpenCode 2 tests now run on 2.2.0. The plugin moves to OpenTUI 0.7.0, the version OpenCode 2.2.0 uses; the compiled sidebar is unchanged.
- Dependencies: the bundled
aiSDK moves to 7.0.155, and Pi support is tested on Pi 1.4.0.
v1.8.0
Changed
- OpenCode's runtime files move out of its config folder (#234). OpenCode 2 watches its config folder for changes, and the plugin rewrote files there while it ran. The account state file (
openai-auth-state.json), the vault folder (openai-auth-vault/) and both Codex sessions files now live in the plugin's state folder. By default that is~/.local/state/cortexkit/openai-auth/opencode/on Linux and macOS, and%USERPROFILE%\.local\state\cortexkit\openai-auth\opencode\on Windows;XDG_STATE_HOME, when set, replaces~/.local/stateon every OS. Any other OpenCode config folder gets its ownopencode-<hash>/folder there. The settings fileopenai-auth.jsonstays where it is. Pi's files are unchanged.- When it moves: at an OpenCode start while no other OpenCode process could still write the old files. A process that starts while the move must wait keeps the old files until it exits, so the simplest way is to close every OpenCode on the machine, then start OpenCode again. Until the move, the plugin keeps using the old files and logs why.
- How it moves: each file is copied and checked byte for byte before
layout.jsonrecords the move. Only then does it remove the old copies that still match. An old token or vault file that Windows won't release yet (another program has it open) is left for the next start to remove. A session file that differs, or that can't be removed, is left in place unused, with a warning. - When it refuses to start: a malformed or unreadable
layout.json, or an old token or vault file that changed or came back after the move. The old copy may hold the only live refresh token, so the message names both files and asks you to keep the one from the most recent sign-in or refresh. If you can't tell which that is, don't guess. - Vault mode stays on: if OpenCode was connected to the vault, the move removes the old token but leaves the old enrollment record. An older version, or an OpenCode the move couldn't see, then still reads the machine as connected, so it refuses requests for lack of a token, and never falls back to local accounts. Disconnect on this version removes that record.
- Paths you set: a state file named by
OPENCODE_OPENAI_AUTH_STATE_FILE, and the state and vault files beside a customOPENCODE_OPENAI_AUTH_FILE, stay where that process says. - Downgrading: an older version doesn't find the moved accounts or vault token on its own. Nothing is lost. Close every OpenCode first, then follow Downgrading.
Fixed
- Fewer writes into the watched folder (#234). After the first quota reading, each process now commits quota readings to disk at most about every 30 seconds per file, and doesn't rewrite the vault account list when the merged readings haven't changed. Routing in that process still sees each reading at once. A vault account discovery that finds the list unchanged no longer takes the list's write lock.
- Enrollment status and pool settings are cached (#236). The plugin no longer opens and parses these files many times a second while they are unchanged. On Linux and macOS an unchanged file costs one quick file-status check. Windows keeps the full read so its permission checks still run.
- Fewer writes to the OpenCode 2 sessions file (#234). Deleting a session the file never held no longer rewrites it, a save that would write the same content is skipped, and new sessions are saved together in one write about two seconds after the first. On shutdown, a waiting save runs at once.
- A vault connection that never opens now gives up after 10 seconds, and a later attempt connects again. Before, one stuck attempt could leave a project refusing vault requests until OpenCode restarted (common-auth #8).
v1.7.0
New
- GPT-6.1 Terra. Terra gets Codex's own default window of 500k: 372k input plus 128k output. It also gets the same reasoning levels as GPT-6.1 Sol, up to
max. Before this, OpenCode offered Terra only low, medium and high, and gave it the models.dev window of 1.05M, which the Codex backend doesn't serve. With theresponsesLitesetting on, Terra uses the compact Responses Lite request format. - Larger context windows. GPT-5.6 Sol, Terra and Luna, GPT-6 Sol and GPT-6 Luna now get the backend's full 872k window: 744k input plus 128k output. Before, they were held at 372k, a cap that existed only to stay under OpenAI's long-context surcharge. OpenAI's Codex rate card now says no long-context multiplier applies to any Codex model when you're signed in with ChatGPT. GPT-6.1 Sol and Terra keep Codex's 500k default. These values replace any
limitset for the same model inopencode.json. If you pointcodexApiEndpointat a relay or another billed service, check that service's pricing yourself.
Fixed
/openaion a slow OpenCode 2 server (#235). On a busy server, the menu no longer goes missing without any message.- Checks: the OpenCode 2 terminal UI now gives each check for new menus up to 15 seconds.
- Slow-server toast: after three failed checks in a row, it shows one toast saying the server is slow. OpenCode 1's terminal UI shows the same toast.
- Refusal notice: if
/openaifinds no terminal UI within two seconds, the next successful check shows a notice telling you to run it again. Nothing is added to the conversation.
v1.6.2
New
- Connect to the vault from
/openaion OpenCode 2 (#233)./openai→ Vault → Connect now works on OpenCode 2, as on OpenCode 1. It requests an enrollment for this host and shows theckcommands you run to approve it. It then waits in the background while the menu stays usable, and the result appears in the session that asked. Because it runs inside the host, other OpenCode and Pi processes can keep running. Disconnect (after you confirm) and turning a vault account on or off for this host also work on OpenCode 2. Disconnect forgets this host's enrollment token; revoking the enrollment in the vault is a separateck auth enroll revoke. Setup still needs every OpenCode and Pi process stopped, because it also changes host configuration.
Fixed
- On OpenCode 2,
/openaino longer does nothing when run from the home screen (#232). OpenCode 2 creates a new session to run the command, and the plugin used to give up at once because its terminal UI hadn't seen that session yet. It now waits up to two seconds for it. When no terminal UI connects (for example withopencode runor an HTTP client), it logs why instead of returning silently, and it opens no menu and adds nothing to the conversation. setup --claustrumnow prints the vault grant command for the name the vault actually approved for this host, not a fixed name. When the approved name isn't recorded, it says so and prints the name it proposed (#233).- The OpenCode 2 vault login now points you at
/openai→ Vault → Connect when this host isn't connected yet.
No upgrade steps are needed.
v1.6.1
Fixed
- On OpenCode 2, the sidebar no longer crashes when it draws quota rows (#231). OpenCode 2 names its theme colours differently from OpenCode 1, and the plugin passed them through unchanged, so the first quota row failed with "undefined is not an object (evaluating 'e.length')". The plugin now converts OpenCode 2's theme to the sidebar's colours, and switching themes still recolours the sidebar. OpenCode 1 is unchanged.
No upgrade steps are needed.
v1.6.0
New
- Request dumps are capped at 512 MiB by default (#230). With request dumps on, the dump folder used to grow without limit. Once the dump files in it pass 512 MiB, the oldest dumps are now deleted first, on OpenCode 1 and OpenCode 2. Other files in the folder are left alone. Change the cap with
dumpMaxBytesin the config file orOPENCODE_OPENAI_AUTH_DUMP_MAX_BYTES, in bytes, where0turns the cap off. Cleanup runs in the background after a dump is written, at most once every five minutes, and the newest dumps are kept. So the folder can stay over the cap until a later dump triggers the next cleanup./openai→ Diagnostics shows the folder's current size and the cap while dumps are on. See Configuration for the default folder on Linux, macOS and Windows.
Fixed
- Turning request dumps off now stops dumping in every running OpenCode process that uses the same config file, at its next request. Before, only the process where you ran the command stopped; the others kept dumping until they restarted (#230). A process started with
CORTEXKIT_OPENAI_AUTH_DUMPset still follows that setting. - On busy machines, a locked account file no longer makes local accounts drop their quota readings. Each process now queues its readings, saves them in batches and retries after a failed save, on OpenCode 1, OpenCode 2 and Pi. When OpenCode or Pi closes, the plugin gives readings still in the queue up to one second to be saved.
Internally, the plugin now uses common-auth 0.26.0. No upgrade steps are needed.
v1.5.0
New
- Set the order of vault accounts from
/openai. In vault mode,/openai→ Routing → "Set order" now lists your vault accounts by name and saves the order you choose, on OpenCode 1, OpenCode 2 and Pi. In Ordered routing the next request tries the accounts in that order. Every other account action stays in the vault, and local mode is unchanged (common-auth #3). - Workspace credits show in vault mode before any request (#229). The background usage readings from insula now carry each account's workspace credits, including whether they are unlimited. Before, credits appeared only after the account had served a request. Credits routing uses these readings too, so an account whose usage limits are spent but which has credits can serve before one without, while accounts with free quota still come first. If an older insula build reports neither a balance nor whether the credits are unlimited, an account already known to be unlimited stays unlimited.
Fixed
- On OpenCode 2, when the last account that can serve a request hits a rate limit, the plugin now keeps OpenCode's own wait and retry instead of ending the step. It moves the retry to another account at once only when another account can actually serve (common-auth #1).
- In vault mode, cancelling a request while the vault checks a login again after a 401 no longer counts as a failed login on OpenCode 1 and Pi, or for OpenCode 2's cache keep-warm (common-auth #4).
- Connecting to a Claustrum vault that is too old to connect plugins now stops after one attempt, both in
npx @cortexkit/opencode-openai-auth setup --claustrumand in/openai→ Vault → Connect, with a message that namesck upgrade.
Internally, the plugin now uses common-auth 0.25.0 and Claustrum client 0.13. No plugin upgrade steps are needed. A vault too old to connect plugins still needs ck upgrade, as above.