Repository navigation
Releases
Releases · partment/opencode-openai-compact
v1.4.0 Compaction Reliability, Persistence Consistency, OAuth Hardening & Configuration Safety
v1.4.0 Compaction Reliability, Persistence Consistency, OAuth Hardening & Configuration Safety
Latest
1.4.0 (2026-09-07)
Features
- Adds per-provider
enabledconfiguration, allowing the built-inopenaiprovider to be disabled without changing the existing deep-merge behavior. - Adds effective configuration diagnostics through
OPENCODE_OPENAI_COMPACT_DEBUG=1, including configuration sources, overridden fields, active providers, database path, retention scope, ignored settings,
and deprecated fields. - Normalizes equivalent
fetch()request inputs consistently across strings,Requestobjects, typed arrays,ArrayBuffer, andBlobbodies. - Adds schema parity coverage between the Zod configuration schema and
configSchema.json.
Fixes
- Preserves complete compaction input across retries, including the original request body, target endpoint, model, reasoning settings, instructions, attachments, and structured history.
- Preserves full tool output and attachment context when rebuilding structured compaction input.
- Filters compaction continuation turns across tool turns without removing genuine user text that happens to match internal control text.
- Isolates compaction captures and state across providers, preventing stale or unsupported callbacks from consuming another provider's state.
- Rejects overlapping compaction operations and prevents stale asynchronous work from writing after cancellation, deletion, revert, or session reset.
- Filters internal compaction control messages by verified message identity instead of text or position alone.
- Makes SQLite the checkpoint commit boundary and adds revision-aware persistence for checkpoints, control messages, fork state, session invalidation, and tombstones.
- Prevents stale runtime state from being reused when SQLite refresh fails.
- Normalizes fetch wrapper request semantics before routing, checkpoint injection, compaction preparation, OAuth handling, and retry processing.
- Strengthens OpenAI OAuth lifecycle handling:
- Binds the callback server to
localhost. - Validates callback and cancellation state before processing the request.
- Adds safe plain-text callback responses and security headers.
- Adds browser/device-flow deadlines, request timeouts, disposal cleanup, and actionable port errors.
- Validates token responses and applies a refresh safety margin.
- Coordinates concurrent token refreshes within the process.
- Retries only explicit OAuth
invalid_tokenresponses, at most once per request.
- Binds the callback server to
- Rejects whitespace-only and root endpoint paths after normalization.
- Validates internal header names, rejects reserved protocol and authentication headers, and prevents case-insensitive name collisions.
- Rejects unknown fields in nested configuration objects instead of silently applying defaults.
- Reports JSONC parse errors with line and column information.
Maintenance
- Updates
@opencode-ai/pluginto1.18.29. - Updates
zodto4.5.4. - Updates
@types/nodeto26.4.1. - Updates
vitestto5.0.0. - Updates pnpm to
12.3.4in the project and CI/release workflows. - Adds AJV coverage for configuration schema parity.
- Adds regression coverage for compaction retries, provider isolation, SQLite consistency, fetch normalization, OAuth lifecycle handling, configuration validation, and provider enablement.
Full Changelog: v1.3.2...v1.4.0
v1.3.2 Compaction Stability, Invalid Checkpoint Recovery & Fork Inheritance
1.3.2 (2026-08-29)
Fixes
- Improves overall compaction stability.
- Automatically eliminates invalid checkpoints by falling back to OpenCode text compaction, allowing native compaction to resume from a clean state.
- Carries existing pre-fork checkpoints into forked sessions so compacted context continues across forks.
Full Changelog: v1.3.1...v1.3.2
v1.3.1 OpenCode 1.18.17+ Compaction Fix & Conversation Model/Reasoning Effort Sync
1.3.1 (2026-08-15)
Features
- Uses the model and reasoning effort from the latest conversation part for automatic and manual compaction when no provider override is configured.
- Adds
providers.<id>.compactReasoningEffortand makes both compaction overrides nullable, with priority given to explicit overrides, then the latest conversation settings, then OpenCode's original compaction request.
Fixes
- Restores structured OpenCode message history before compaction without depending on serialized summarizer prompt wording.
- Preserves reasoning items, tool calls and outputs, attachment context, provider metadata, stable instructions, and checkpoint ordering when rebuilding compaction input.
- Supports legacy and OpenCode 1.18.17 tagged
<conversation>prompts as fallbacks when structured history cannot be captured. - Passes unknown compaction formats through unchanged and clears failed captures to prevent stale snapshots from affecting later requests.
Maintenance
- Adds regression coverage for conversation setting inheritance, structured history restoration, prompt-format fallbacks, unknown-format passthrough, and capture cleanup.
- Updates
@opencode-ai/pluginto1.18.18and documents tested compatibility with OpenCode 1.18.18. - Enforces pnpm's 24-hour package release cooldown and refreshes compliant transitive dependencies.
Full Changelog: v1.3.0...v1.3.1
v1.3.0 OpenAI Responses Compaction v2
1.3.0 (2026-08-13)
Features
- Replaces
/responses/compactcalls with streamed/responsesrequests that append a finalcompaction_triggerinput item. - Builds compaction requests with
tool_choice: "auto",store: false,stream: true, and encrypted reasoning content enabled. - Stores retained user messages followed by the encrypted
compactionitem returned through Responses SSE events. - Restores structured OpenCode history before compaction, preserving reasoning items, tool calls, attachments, provider metadata, and stable instructions.
Fixes
- Rejects malformed, failed, incomplete, or ambiguous compaction streams instead of storing invalid checkpoints.
- Refuses to send the OpenAI OAuth dummy API key when OAuth credentials are unavailable.
- Reuses the authenticated OpenAI fetch wrapper when provider configuration is reapplied.
- Shares refreshed OAuth credentials across concurrent OpenAI requests.
- Keeps existing configuration files valid while deprecating
responses.compactEndpointPath; compaction now usesresponses.endpointPath.
Maintenance
- Adds regression coverage for compaction v2 request construction, SSE validation, structured input restoration, OAuth routing, credential refresh, and unavailable credentials.
- Updates pnpm to
11.21.0,@opencode-ai/pluginto1.18.16, and@types/nodeto26.2.0. - Updates CI and release Actions to Node.js 24-based versions.
- Splits pnpm and Node.js setup in the release workflow and verifies GitHub OIDC availability before publishing.
Full Changelog: v1.2.1...v1.3.0
v1.2.1 Mid-Turn Continuation and OpenCode 1.18.15 Compatibility
1.2.1 (2026-08-08)
Fixes
- Preserves mid-turn continuation after native compaction by replacing OpenCode's synthetic post-compaction control exchange with the active checkpoint. Real follow-up messages remain ordered without duplicated summary or continuation prompts.
- Restores compatibility with the compaction behavior introduced in OpenCode 1.18.15. Captures messages before OpenCode serializes them into embedded conversation history and rebuilds structured OpenAI Responses input while preserving reasoning items, tool calls, file attachments, and provider metadata.
- Preserves the embedded conversation history as a fallback when structured input cannot be reconstructed.
- Keeps checkpoints across temporary undo and redo transitions and removes them when the checkpoint boundary is deleted.
Maintenance
- Adds regression coverage for mid-turn continuation, OpenCode 1.18.15 structured compaction input, legacy fallback behavior, and undo/redo checkpoint handling.
- Treats an already-published npm version as successful during release retries.
Full Changelog: v1.2.0...v1.2.1
v1.2.0 Codex CLI Compaction Parity
1.2.0 (2026-07-29)
Fixes
- Aligns OpenAI
/responses/compactrequest bodies with the official Codex CLI contract, including tools, parallel tool calls, reasoning, prompt cache keys, text settings, and auth-specific service tier handling. - Preserves compaction item IDs,
internal_chat_message_metadata_passthrough, and other passthrough fields when normalizingcompaction_summaryoutput. - Requires exactly one valid compaction item and rejects malformed compact responses without persisting invalid checkpoints.
- Removes stale developer and system messages from compacted checkpoints.
- Restores checkpoint state before the latest developer and system instructions, preserving the correct context order across repeated compactions.
Maintenance
- Updated the default compact body fields, configuration schema, and documentation to match the Codex compact request contract.
- Updated
@opencode-ai/pluginand@opencode-ai/sdkto1.18.7,@types/nodeto26.1.2, TypeScript to7.0.2, and Vitest to4.1.10. - Added
.editorconfigand.gitattributesto enforce LF line endings. - Added regression coverage for compact request parity, service tier routing, metadata preservation, invalid compact output, persisted checkpoint normalization, and repeated compaction ordering.
Full Changelog: v1.1.4...v1.2.0
v1.1.4 OAuth Utility Agent Routing
1.1.4 (2026-07-05)
Fixes
- Routes OpenAI OAuth
titleandsummaryutility-agent/responsesrequests through ChatGPT Codex backend endpoints without requiring internal session headers. - Keeps utility-agent requests out of normal session compact-state handling, preventing checkpoint injection and stable-instruction pollution.
- Preserves request bodies when rerouting OAuth
/responsesrequests through ChatGPT Codex backend endpoints. - Rejects malformed compact requests that set the compact header without the required session header before OAuth routing.
Maintenance
- Updated
@opencode-ai/pluginto1.17.13and@types/nodeto26.1.0. - Added regression coverage for OAuth utility routing, no-session API-key requests, malformed compact requests, OAuth reroute body preservation, and utility prompt isolation.
Full Changelog: v1.1.3...v1.1.4
v1.1.3 Stable Instruction Preservation
1.1.3 (2026-06-21)
Fixes
- Preserves session-level
instructionsand leadingdeveloper/systeminput messages when routing OpenAI/responses/compactrequests. - Keeps compacted checkpoints inserted after stable instruction messages, so follow-up
/responsescalls retain the original prompt prefix. - Ignores title and summary utility agents when tracking rendered system prompts, preventing their prompts from replacing session instructions.
Documentation
- Reworked the README landing section to explain native OpenAI compaction, when to use it, requirements, and checkpoint retention behavior.
Maintenance
- Added coverage for stable instruction preservation, rendered system instructions, configurable
compactBodyKeys, and checkpoint injection order.
Full Changelog: v1.1.2...v1.1.3
v1.1.2 Standard OpenAI Compact Requests
1.1.2 (2026-06-21)
Fixes
- Sends standard OpenAI
/responses/compactrequests by removing OpenCode's internal compaction developer prompt, synthetic summary prompt, and matchinginstructions.
Maintenance
- Added compact request coverage for the cleaned OpenAI payload shape.
Full Changelog: v1.1.1...v1.1.2
v1.1.1 Complete ChatGPT Codex Support
1.1.1 (2026-06-20)
Features
- Properly routes OpenAI OAuth responses and compaction requests through ChatGPT Codex backend endpoints.
- Refreshes expired OpenAI OAuth tokens and saves refreshed auth back to OpenCode.
Maintenance
- Added OAuth, Codex routing, token refresh, auth switching, and checkpoint coverage tests.
Full Changelog: v1.1.0...v1.1.1