Skip to content

fix: strip Anthropic params from 3P resume paths#479

Merged
kevincodex1 merged 5 commits intomainfrom
fix/repl-anthropic-params-3p-pr
Apr 7, 2026
Merged

fix: strip Anthropic params from 3P resume paths#479
kevincodex1 merged 5 commits intomainfrom
fix/repl-anthropic-params-3p-pr

Conversation

@auriti
Copy link
Copy Markdown
Collaborator

@auriti auriti commented Apr 7, 2026

Summary

  • strip Anthropic-specific thinking payloads before replaying deserialized assistant messages through OpenAI-compatible provider paths
  • use a conservative context-window fallback for unknown third-party models so auto-compaction still triggers instead of silently assuming a 200k window
  • move provider-sensitive resume coverage behind focused mocks and isolate provider env handling in the regression tests

Test plan

  • bun test src/utils/conversationRecovery.test.ts src/utils/conversationRecovery.hooks.test.ts src/services/api/openaiShim.test.ts src/utils/context.test.ts
  • bun run test:provider
  • bun run smoke

🤖 Generated with OpenClaude

auriti and others added 5 commits April 7, 2026 15:02
Three silent failure modes affecting all third-party provider users:

1. Thinking blocks serialized as <thinking> text corrupt multi-turn
   context — strip them instead of converting to raw text tags.

2. Unknown models fall through to 200k context window default, so
   auto-compact never triggers — use conservative 8k for unknown
   3P models with a warning log.

3. Session resume with thinking blocks causes 400 or context corruption
   on 3P providers — strip thinking/redacted_thinking content blocks
   from deserialized messages when resuming against a non-Anthropic
   provider.

Addresses findings 2, 3, and 5 from #248.
Keep the focused provider-resume test diff clean so the regression branch stays easy to review.

Co-Authored-By: Claude Opus 4.6 <noreply@openclaude.dev>
Copy link
Copy Markdown
Collaborator

@gnanam1990 gnanam1990 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! This looks good to me. The scope is tight, the fix addresses the actual 3P resume/context failure paths, and the focused regression coverage is solid. CI is green as well. LGTM.

@kevincodex1 kevincodex1 merged commit 4975cfc into main Apr 7, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants