Skip to content

Bug: preserve Anthropic thinking replay through proxy-auth translation and clarify prompt-cache behavior #3719

Closed

Description

@lidge-jun

Client or integration

Claude Code

Also reported with Claude Desktop 3P against a remote OpenCodex hub, using a connected client's proxy admission credential.

Area

Proxy and routing

Summary

Separate follow-up for the thinking/replay and prompt-cache request in #3646. This issue applies when Anthropic is the intended upstream. It does not cover Desktop date/hash alias discovery, hub registry ownership, client profile apply, or rejection of unresolved managed aliases; those belong to the remote-alias slice of #3646. Landing that slice does not establish that this replay/cache request is resolved.

The reporter asks that assistant thinking and redacted_thinking blocks survive subsequent turns to the intended Anthropic route, or that a supported untranslated path preserve the original Anthropic exchange. The guide should also explain how proxy authentication, native passthrough eligibility, and prompt-cache retention differ.

Evidence and limits:

  • The current inbound translator explicitly drops assistant thinking and redacted_thinking blocks on replay (src/claude/inbound.ts, assistant-content conversion). The Claude Code guide documents this policy.
  • Native passthrough requires an eligible unchanged Anthropic model and an actual Anthropic credential; a hub admission token by itself is not that credential. An exposed listener also requires the dedicated proxy admission header. Proxy-auth translation and native passthrough are different routes.
  • Translation does not mean prompt caching is disabled. The Anthropic adapter still applies prompt-cache controls, including automatic caching for the native Anthropic endpoint. cacheRetention supports short (default, five minutes), long (one hour), and none.
  • Bug: remote-hub Claude Desktop date aliases are forwarded to Anthropic as Opus (quota burn + cache miss) #3646 reports repeated cache misses and faster quota consumption after thinking responses. Neither a per-turn miss guarantee nor its causal attribution to dropped replay blocks has been reproduced in this follow-up. The report's claim that native Claude typically uses one-hour breakpoints also needs a controlled comparison. Do not infer billing or quota savings from the alias fix or from the configured retention duration alone.

Expected outcome:

  • Define and implement supported Anthropic-to-Anthropic replay fidelity for proxy-auth traffic, preserving upstream-issued thinking signatures and opaque redacted-thinking blocks where the upstream/client contract requires them. Do not manufacture signatures or forward provider-specific blocks to unrelated providers.
  • Verify a multi-turn thinking/tool-result exchange through the intended Anthropic route, including both block types, without replay validation errors or silently dropping required blocks.
  • Compare cache creation/read usage across controlled continuation turns with stable model, credential scope, prompt prefix, tools, and retention settings. Distinguish replay changes from TTL expiry and other cache eligibility rules; record unexplained misses as unresolved.
  • Document native passthrough eligibility separately from translated-route cache support and the existing retention choices. A global default change to one hour is not implied by this request.

Reproduction

Reported setup from #3646; this follow-up has not executed a new reproduction:

  1. Connect Claude Code or Claude Desktop 3P to a remote OpenCodex hub using proxy authentication. Configure the hub's intended route to Anthropic with its existing managed credential.
  2. Use a genuine, deliberately selected Anthropic model. Exclude unresolved Desktop aliases and other-provider routes from the comparison.
  3. Continue a conversation after an assistant thinking response, including a tool-result continuation. Compare the types and ordering of replayed blocks across the translated boundary using synthetic or privately held content.
  4. Record aggregate cache-read/cache-creation usage and elapsed time between turns. Compare supported short/long retention settings under otherwise stable conditions.
  5. Separately exercise an upstream-provided redacted-thinking block in a controlled protocol fixture. No such redacted block or valid signed replay fixture was attached to Bug: remote-hub Claude Desktop date aliases are forwarded to Anthropic as Opus (quota burn + cache miss) #3646; current-version coverage remains to be collected.

The existing report's HTTP 404/429 table demonstrates the alias/routing symptoms. It is not a cache-replay reproduction or a measured cache-hit comparison.

Version

Original reporter: OpenCodex 2.42.0 Windows client and 2.41.0 WSL client; Claude Code 2.1.261. The exact remote hub build was not independently established in the issue body. A maintainer comment interpreted the version split differently, so record actual hub/client builds during reproduction rather than treating that interpretation as verified.

Current-version runtime reproduction: pending. This follow-up only confirms the translation policy and cache-control configuration by source inspection.

Operating system

Original report: Windows 11 and WSL, with a remote hub. Exact hub OS/build: not supplied.

Provider and model

Anthropic OAuth pool on the hub; original report names claude-opus-4-8 and claude-haiku-4-5. This follow-up concerns intentional Anthropic routing, independently of GPT/GLM Desktop alias failures.

Logs or error output

No isolated replay failure or controlled cache-usage trace is attached yet. The public report contains alias-related 404/429 observations; do not reuse those as proof of this separate remainder. No request content, credentials, thinking text, signatures, or opaque redacted payloads are included here.

Screenshots and supporting files

Duplicate search found no separate issue covering this exact Anthropic proxy-auth replay/cache request:

Search scope: all issue states; title/body/comments for redacted_thinking, thinking cache, thinking replay, cacheRetention, and passthrough proxy; additional Anthropic/cache and open cache searches. Related issue bodies and relevant later comments were inspected, not just titles.

Redacted configuration

Reported configuration shape, not an executable configuration file:

hub runtimeRole: hub
connected client runtimeRole: client
Claude integration authMode: proxy
client credential: proxy admission token only (value omitted)
intended upstream: Anthropic, using a configured hub credential
cacheRetention: short (default); compare long separately

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Activity

  1. added
    bugSomething isn't working
    proxyHTTP proxy, routing, reverse-proxy / management auth
    on Sep 5, 2026
  2. lidge-jun commented on Sep 5, 2026

    @lidge-jun
    OwnerAuthor

    리뷰 · 우선순위 58 / 80

    이 이슈는 #3646에서 빠져 나온 Anthropic 의도 경로의 thinking/replay·prompt-cache 후속입니다. 지금 dev(HEAD 115b3fc2b)의 src/claude/inbound.ts는 assistant thinking / redacted_thinking 블록을 재생할 때 v1 정책으로 버립니다. 가이드 docs-site/src/content/docs/guides/claude-code.md 번역 표에도 “Dropped”로 적혀 있습니다. 네이티브 Anthropic passthrough는 자격이 되는 그대로의 Anthropic 모델 + 실제 Anthropic 자격 증명이 필요합니다. 허브 입장(admission) 토큰만으로는 passthrough가 켜지지 않습니다. 번역 경로라도 Anthropic 어댑터는 cacheRetention(short 기본 5분 / long 1시간 / none)으로 프롬프트 캐시 컨트롤을 적용합니다. 별칭 수정(#3720)만으로 캐시 히트·할당량 절약이 증명되지는 않습니다.

    이슈 본문이 잘 가른 점이다. Desktop 날짜/해시 별칭·허브 레지스트리·클라이언트 apply·미해석 managed alias 거절은 #3646/#3720 쪽이고, 여기는 Anthropic→Anthropic 재생 충실도와 캐시 비교만 남깁니다. 기대 결과도 네 칸으로 분명합니다. (1) 서명·불투명 redacted 블록을 위조하지 않고 필요한 곳에서 보존, (2) thinking+tool-result 다턴 검증, (3) 모델·자격·프리픽스·툴·retention을 고정한 캐시 create/read 비교, (4) passthrough 자격 vs 번역 경로 캐시 vs retention 선택지를 문서에서 분리. 전역 기본을 1시간으로 바꾸라는 요구는 아니라고 못 박았습니다.

    중복 검색도 본문에 정리되어 있습니다. #1213 Desktop native/gateway 공존, #3433 Hermes/OpenAI 캐시 친화, 닫힌 #545/#994/#820은 이 잔여의 주인이 아닙니다. 현재 버전 런타임 재현은 pending이고, 소스 검사로 번역 정책과 캐시 설정만 확인한 상태입니다. #3720이 #3646 별칭을 닫으면 이 이슈가 남은 Anthropic 재생 작업의 정식 추적 티켓이 됩니다.

    우선순위 58인 이유다. 계약·할당량에 닿는 실버그 후속이지만, 재현 측정이 아직 없고 별칭 랜딩(#3720) 뒤에 설계가 더 선명해집니다. 지금 당장 코드를 급히 넣기보다 스펙·픽스처를 잠그는 단계가 맞습니다.

    경로/심볼 - src/claude/inbound.ts case "thinking" / case "redacted_thinking" - 재생 시 break로 드롭(v1).
    경로 - docs-site/src/content/docs/guides/claude-code.md inbound 표 - thinking/redacted_thinking replay = Dropped; native passthrough 절과 분리 필요.
    경로/심볼 - src/adapters/anthropic.ts createAnthropicAdapter / resolveCacheControl - 번역 경로에서도 cacheRetention 적용.
    경로/심볼 - src/types/config.ts cacheRetention?: "none"|"short"|"long" - 기본 short; 글로벌 long 강제 없음.
    경로 - #3646 / PR #3720 - 별칭 조각과 이 이슈를 섞지 말 것(본문·#3720 요약과 일치).
    경로 - #1213 #3433 - 관련이나 소유권 이전 대상 아님.

    메인테이너의 판단이 필요한 지점

    • Anthropic→Anthropic에서 블록을 그대로 통과시킬지, 서명 검증 가능한 최소 보존만 할지
    • proxy-auth 번역 경로에 “지원되는 미번역 우회”를 새 모드로 둘지, 기존 native passthrough 자격만 강화할지
    • 캐시 비교를 CI 픽스처로 강제할지, 유지보수자 수동 측정 체크리스트로 둘지
    • #3720 머지 전에 이 이슈 구현을 시작할지, 별칭 안정화 후 할지

    너의 추천
    이슈를 열어 두고 #3720 랜딩 뒤에 구현 설계를 잡으세요. 라벨 bug/proxy는 유지. 첫 PR은 inbound drop 완화 + 다턴 픽스처 + 가이드 문구 분리까지를 한 사이클로, 캐시 계측은 두 번째 사이클로 나누는 편이 안전합니다. 중복 이슈로 닫지 마세요. #3646 close 시 이 이슈 링크만 남기면 됩니다.

    이 댓글은 grok-bot이 작성했습니다

  3. added a commit that references this issue on Sep 7, 2026
  4. lidge-jun commented on Sep 7, 2026

    @lidge-jun
    OwnerAuthor

    Partial: the streaming order of signed and redacted thinking blocks now matches the JSON path (#3877, merge 4fe4ad8df), with parity tests including preceding deltas. Remaining for this issue: live intended-Anthropic replay acceptance and controlled prompt-cache measurements, so it stays open.

  5. added 2 commits that reference this issue on Sep 17, 2026
  6. lidge-jun commented on Sep 17, 2026

    @lidge-jun
    OwnerAuthor

    Closing on the implementation and documentation scope, and being explicit about the one item that is not closed by evidence.

    The premise in the title — that the inbound translator discards thinking and redacted_thinking — is no longer true at HEAD. src/claude/inbound.ts moves the signature into a bounded ocxr1 envelope carried on encrypted_content, and src/adapters/anthropic.ts replays redacted blocks verbatim in their original stream order before the signed thinking blocks. Delivered by 4a59dbc2b7 and 58fcb0961d.

    Multi-turn coverage for both block types exists as regression tests in tests/adapters/anthropic/anthropic-thinking-signature.test.ts, including per-sibling signature matching and full-chain SSE and JSON fixtures.

    The separation this issue implicitly asked for is enforced by code rather than convention: isLikelyRealAnthropicThinkingSignature gates outbound thinking blocks, so a value that does not look upstream-issued never leaves as a signature. Two leaks are refused explicitly — an ocxr1 envelope arriving in Anthropic's signature field is rejected inbound, and a native OpenAI encrypted blob has no ocxr1 prefix so the decoder returns null and keeps the placeholder. Signature data is not laundered across providers.

    What is not closed by evidence: the cache create/read comparison on controlled continuation turns. That needs real Anthropic traffic, which we do not produce from this workflow. It is worth saying plainly that the "cache miss every turn" claim, and the attribution of it to dropped replay blocks, was never reproduced here or in #3646. Closing it as unestablished rather than as fixed; if anyone wants to pursue it, the useful artifact is a measurement on a controlled pair of turns, not a code change.

    The documentation already states the honest position — signed and opaque redacted blocks are preserved on the intended Anthropic adapter, without claiming live acceptance or a cache-hit improvement — so no documentation change was needed to close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingproxyHTTP proxy, routing, reverse-proxy / management auth

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions