coderouter-cli 2.17.0__py3-none-any.whl → 2.19.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -277,6 +277,9 @@ class AnthropicRequest(BaseModel):
277
277
  # beta-gated body fields like `context_management`, `cache_control`,
278
278
  # `thinking` beyond what the default minor version accepts.
279
279
  anthropic_beta: str | None = Field(default=None, exclude=True)
280
+ # v2.18.0: conversation key for KV-slot affinity (Claude Code's
281
+ # ``x-claude-code-session-id``). Never serialized.
282
+ session_key: str | None = Field(default=None, exclude=True)
280
283
 
281
284
  @model_validator(mode="before")
282
285
  @classmethod
@@ -285,6 +285,8 @@ def to_chat_request(req: AnthropicRequest) -> ChatRequest:
285
285
  )
286
286
  # Propagate CodeRouter routing hint.
287
287
  chat_req.profile = req.profile
288
+ # v2.18.0: carry the KV-slot affinity key across the translation.
289
+ chat_req.session_key = req.session_key
288
290
  return chat_req
289
291
 
290
292
 
@@ -1114,6 +1116,8 @@ def to_anthropic_request(chat_req: ChatRequest) -> AnthropicRequest:
1114
1116
  )
1115
1117
  # Propagate CodeRouter routing hint.
1116
1118
  req.profile = chat_req.profile
1119
+ # v2.18.0: KV-slot affinity key (exclude=True, so set by hand).
1120
+ req.session_key = chat_req.session_key
1117
1121
  return req
1118
1122
 
1119
1123