Changelog

@codeworksh/aikit

aikit 0.9.2

Added

  • Added Model.configureCatalog(path), Model.catalogPath(), and Model.reloadCatalog(). An embedder can keep models.gen.json somewhere other than the working directory (CODEWORK_MODELS_FILE still wins), and a long-running process can pick up a regenerated catalog without restarting.

Fixed

  • Fixed generateModels reusing the first models.dev download for the life of the process. Every call now fetches again, so a process that regenerates its catalog gets current data.
  • Fixed a catalog that failed to load, for example because the file did not exist yet, staying failed for the life of the process. Model.reloadCatalog() now clears the failure along with the loaded catalog.
  • Fixed generateModels writing the catalog in place, where a concurrent reader could see a partial file. It now writes a temp file and renames it over the catalog.
  • Fixed an error response from models.dev surfacing as a JSON parse error. It now fails with the HTTP status.
@codeworksh/aikit

aikit 0.9.1

Fixed

  • Fixed a request that hit timeoutMs being reported as if the caller had cancelled it. Only the caller’s own signal now ends a stream with stopReason: "aborted"; an abort raised inside the AI SDK, such as its timeout timer, ends it with stopReason: "error" and a Timeout failure. Callers can now tell a timeout from a cancel and retry it, and codework run prints error[timeout] instead of exiting silently as if Ctrl+C had been pressed.
@codeworksh/aikit

aikit 0.9.0

Added

  • Added a GitHub Copilot provider, exported as createGitHubCopilot / githubCopilot. Copilot serves three inference protocols on one host, so the provider routes each model to the one it actually speaks — OpenAI Chat Completions, OpenAI Responses, or Anthropic Messages — and applies Copilot’s client identity to every request.
  • Added the github-copilot protocol to the catalog, options, registry, and thinking paths, so Copilot models are selected and configured like any other provider’s.
  • Added per-route reasoning control for Copilot models, which do not share one: the Messages route takes a thinking budget or an adaptive effort level, the Responses route takes a reasoning effort, and the chat route has no generic control and relies on compat.supportsThinkingTokenBudget.
  • Added GitHub Copilot OAuth. aikit auth --github-copilot runs the GitHub device flow, checks that the account can use Copilot, and records the plan-specific API host and the models the account can actually see. --enterprise <domain> targets a GitHub Enterprise host, and --enable-models turns on catalog models the account has left unconfigured.
  • Added getGitHubCopilotApiKey, which resolves a Copilot token from COPILOT_GITHUB_TOKEN or the auth.json store, and from nothing else. GITHUB_TOKEN and GH_TOKEN are deliberately not consulted — they are usually set for git or gh and carry no Copilot access, and in GitHub Actions GITHUB_TOKEN is a workflow token — and neither is a token another application stored for itself, such as an editor’s Copilot sign-in.
  • Added Copilot entries to models generate, carrying each model’s endpoint routing, thinking-level map, extended context window where GitHub documents one, and compatibility flags.
  • Added device-code login for OpenAI Codex, aikit auth --openai-codex --device. It needs no local callback port, so it works over SSH, inside a container, and when another sign-in already holds port 1455.
  • Added the oauth/github/copilot, oauth/summary, and oauth/interactive subpath exports, covering Copilot credentials, how a login is described to a user, and the terminal helpers an interactive login needs.

Changed

  • Changed the Codex callback server to bind the port and path its redirect URI names, rather than a second hardcoded copy of them, so a caller-supplied redirectUri now works.
  • Changed a failed callback bind from silence to an explanation. Port 1455 is usually held by another Codex sign-in, which would receive the callback, so the login now says so before falling back to asking for the redirect URL.
  • Changed aikit auth to print credential metadata on stdout and every notice on stderr, so --json output is parseable.
  • Changed an unreadable auth.json to fail with the path and the parse error, rather than whatever the underlying reader raised.
  • Updated the AI SDK provider packages and typebox to current releases.

Breaking Changes

  • Removed --originator, --print-headers, and --manual from aikit auth. The first two had no caller behind them, and --device now covers what --manual was for without needing a callback port at all.
  • Removed onManualCodeInput from the Codex login options. A callback that never arrives already falls back to onPrompt, which is what that option raced against.
@codeworksh/aikit

aikit 0.8.0

Added

  • Added context-aware response sizing: every request now measures what the conversation already costs and shrinks its output ceiling to what the context window can still hold, instead of asking for an answer that cannot fit.
  • Added adaptive thinking for newer Claude models, which receive an effort level and size each turn’s reasoning themselves rather than being pinned to a fixed token budget.
  • Added usage.cacheWrite1h, the portion of a cache write made with 1h retention, where the provider reports the split.
  • Added isRecoverableLength, which reports whether a length stop ended below the output limit that was actually requested, so callers can decide whether one compact-and-retry attempt is worthwhile.
  • Added compat.thinkingTokenBudgetField and compat.supportsThinkingTokenBudget, letting an OpenAI-compatible endpoint declare the request field it takes a thinking-token budget in.
  • Added compat.forceAdaptiveThinking to the generated catalog for Claude models that support it.
  • Added native JSON Schema output support to the OpenAI Codex provider and a live Codex round-trip regression test.

Changed

  • Changed maxTokens to mean the room reserved for the answer. A thinking budget is added on top and the total is clamped to the model’s ceiling, so raising the thinking level no longer silently shortens the answer.
  • Changed default thinking budgets to fixed token counts per level (1024, 2048, 8192, 16384) rather than a fraction of each model’s output ceiling, so one setting behaves the same across large and small models. xhigh and max inherit the high budget unless one is configured for them.
  • Changed reasoning to be switched off explicitly when no thinking level is requested. Models that reason by default previously did so anyway, spending output tokens on reasoning the caller never asked for.
  • Changed Google thinking configuration to use per-family token budgets, and to send a thinking level rather than a budget for the model families that take one.
  • Aligned OpenAI Codex request shaping with the ChatGPT Codex backend: requests always disable storage, include encrypted reasoning content, and derive the prompt cache key from the provider session ID.

Fixed

  • Fixed an oversized thinking budget consuming the entire response. A budget that does not fit is now reduced, always leaving at least 1024 tokens for the answer, instead of shrinking the answer toward a single token.
  • Fixed Anthropic requests counting the thinking budget twice, which inflated the requested ceiling and, with an explicit maxTokens, produced answers several times longer than asked for.
  • Fixed a thinking budget below a provider’s own minimum being sent as an enabled request, which the provider rejected outright. Thinking is now dropped for that turn instead, so a nearly full context still produces an answer.
  • Fixed 1h cache writes being billed at the 5-minute rate. The 1h portion is now priced at twice the base input rate, correcting a roughly 37% understatement of cache-write cost whenever long cache retention is enabled.
  • Fixed service-tier pricing being applied only to OpenAI Codex requests and being calculated from the tier requested rather than the tier the response was served at.
  • Fixed rate-limit and throttling errors being misread as context overflow, which sent callers to compact a conversation that was never too long instead of retrying.
  • Fixed context-overflow detection missing providers that truncate an oversized prompt to fit the window and then stop with no output, and broadened the recognized provider error messages.
  • Fixed thinking-token budgets never reaching OpenAI-compatible endpoints that accept one.
  • Fixed the default response ceiling being capped at a fixed 32000 tokens for models whose catalog output limit approaches their context window; the context-aware ceiling now decides.
  • Replaced the OpenAI Codex SSE decoder with a standards-compliant parser, rejected streams that close before a terminal Responses event, and stopped accepting WebSocket-only completion events on the HTTP transport.
  • Distinguished transient Codex rate limits from terminal plan and quota failures while preserving structured error codes, retry timing, and OpenAI request IDs.
  • Restricted persisted OpenAI Codex OAuth credentials to owner-only file permissions and redacted token material from OAuth failure messages.

Breaking Changes

  • Changed the meaning of maxTokens from the whole response to the answer alone. A request that previously carved the thinking budget out of maxTokens now adds it on top, so responses can be longer than before at the same setting.
  • Changed default thinking budgets to absolute token counts. On models with a large output ceiling these are substantially smaller than the previous proportional defaults; set thinkingBudgets explicitly to keep the old amounts.
  • Changed requests without a thinking level to disable reasoning explicitly. Providers whose models reason by default will no longer do so unless a level is set.
  • Removed the store, include, and promptCacheKey OpenAI Codex language-model options. These backend-required values are now controlled by the provider.
  • Removed the unused agent lifecycle event protocol from the public Event namespace: AgentEventType, AgentEventSchema, AgentEvent, and the tool.execution.start / tool.execution.update / tool.execution.end types. LLM stream events (LLMMessageEvent) are unchanged.

Internal

  • Extracted thinking resolution, request pricing, and context estimation into llm/thinking.ts, llm/pricing.ts, and utils/estimate.ts, so each derivation from model metadata has one home and can be tested directly.
  • Added Model.optionsKey as the single accessor for a model’s provider option namespace, replacing a copy inside the streaming module.
  • Surfaced the service tier a Codex response was served at in provider metadata, so a turn is priced by what it actually cost.
  • Reorganized the OpenAI Codex unit tests by provider module and expanded live coverage for empty messages, response IDs, Unicode surrogate handling, incomplete tool-call histories, native grammar tools, and structured output using HTTP/SSE behavior as a reference.
  • Renamed the Codex OAuth suite for clarity and added CLI coverage for credential status, refresh, and logout wiring.
  • Removed unit coverage for the unused agent lifecycle event schemas.
@codeworksh/aikit

aikit 0.7.2

Added

  • Added a provider-independent failure taxonomy with safe authentication, configuration, authorization, model availability, rate limit, quota, request, policy, timeout, transport, availability, response, and unknown failure categories.
  • Added structured failure metadata to terminal assistant messages and exported the failure schemas and normalization helpers from @codeworksh/aikit and @codeworksh/aikit/failure.
  • Added typed model-catalog load errors for missing, unreadable, empty, and invalid generated catalogs.

Changed

  • Changed model-catalog loading to report configuration failures instead of silently treating an unavailable catalog as empty.
  • Standardized normalized provider error messages with lowercase opening prose and no terminal punctuation.

Fixed

  • Preserved safe provider status, code, request ID, retryability, and retry timing metadata without exposing request bodies, response bodies, or headers.
  • Prevented the underlying AI SDK from logging raw provider exceptions before Aikit can return its normalized terminal failure event.