Skip to content

hotfix(ai): prevent ChatGPT compaction cache-option errors - #302

Merged
Pepps233 merged 1 commit into
mainfrom
hotfix/chatgpt-compaction-cache-options
Oct 28, 2026
Merged

Pepps233 merged 1 commit into
mainfrom
hotfix/chatgpt-compaction-cache-options

Conversation

@Pepps233

@Pepps233 Pepps233 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fix ChatGPT auto-compaction and /compact failures caused by HTTP 400 prompt_cache_options is not supported on this model.

ChatGPT catalog discovery inherits API-key model capabilities. Summarization sets cacheRetention: "none", which turns the inherited explicit-cache capability into prompt_cache_options: { "mode": "explicit" }. The reported ChatGPT subscription request rejects that parameter.

Reasoning

Explicit-cache support must be scoped to the subscription route rather than inherited from API-key pricing metadata.

Normalize both freshly fetched and restored ChatGPT catalogs so existing installations recover without deleting cached models, including offline startup and failed catalog refreshes. Keep the shared OpenAI adapter and API-key caching behavior unchanged.

Changes

  • Disable supportsExplicitPromptCacheMode when constructing or restoring ChatGPT model catalogs; preserve other model capabilities.
  • Add mocked HTTP regressions for fresh catalogs, pre-hotfix offline caches, and pre-hotfix caches retained after refresh failures.
  • Exercise both simple and API-specific completion paths with summarization's no-cache options; assert unsupported cache fields are omitted and API-key model capabilities remain unchanged.
  • No dependency or lockfile changes.

Testing

  • New regressions failed before the implementation and pass with the fix.
  • npm run check — passed, including TypeScript and browser smoke checks.
  • From packages/ai: node ../../node_modules/vitest/dist/cli.js --run test/chatgpt-inference.test.ts test/cache-retention.test.ts test/providers.test.ts — 56 passed, 4 skipped.
  • git diff --check — passed.
  • ./test.sh — blocked in the script-test phase: 428 passed, 3 packaging tests failed with ENOENT for missing prebuilt packages/ai/dist in the isolated worktree. Workspace suites were not reached. No build was run.
  • Provider regressions use mocked catalog/Responses endpoints and synthetic credentials; no live inference or endpoint-support claim.

@Pepps233 Pepps233 added the bug Something isn't working label Oct 28, 2026
@Pepps233 Pepps233 self-assigned this Oct 28, 2026
@Pepps233
Pepps233 merged commit ccb8ef5 into main Oct 28, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant