Skip to content

sdk/anthropic: split translator_canonical.go by responsibility - #400

Merged
aaliboyev merged 1 commit into
mainfrom
refactor/anthropic-translator-split
Jul 30, 2026
Merged

sdk/anthropic: split translator_canonical.go by responsibility#400
aaliboyev merged 1 commit into
mainfrom
refactor/anthropic-translator-split

Conversation

@aaliboyev

Copy link
Copy Markdown
Member

Mechanical decomposition of the 2.2k-line translator file — pure moves, no behavior change (full suite passes unchanged):

file contents LOC
translator_canonical.go translator type, wire types, cache helpers 178
request_parse.go ParseRequest + inbound wire→canonical helpers 516
request_serialize.go SerializeRequest + canonical→wire helpers 588
response.go ParseResponse/SerializeResponse + usage/stop-reason/citation maps 363
stream_to_canonical.go Anthropic→canonical stream + shared SSE helpers 433
stream_from_canonical.go canonical→Anthropic stream 230

Stacked on #399. The openai (1.7k/1.6k) and gemini (1.3k) translator files can get the same treatment in follow-ups.

Pure file moves, no behavior change: request parse/serialize, response,
and the two stream directions each get their own file;
translator_canonical.go keeps the translator type, wire types, and
cache helpers.
@aaliboyev
aaliboyev deleted the branch main July 30, 2026 00:32
@aaliboyev aaliboyev closed this Jul 30, 2026
@aaliboyev aaliboyev reopened this Jul 30, 2026
@aaliboyev
aaliboyev changed the base branch from feat/mid-conversation-system to main July 30, 2026 00:34
@aaliboyev
aaliboyev merged commit 8d5930a into main Jul 30, 2026
2 checks passed
@aaliboyev
aaliboyev deleted the refactor/anthropic-translator-split branch July 30, 2026 00:34
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.

1 participant