Skip to content

feat(proxy): support configurable timeouts and normalize Anthropic system messages - #368

Open
matrix72c wants to merge 2 commits into
InternLM:v1.0.0from
matrix72c:feat/proxy-timeout-anthropic-system
Open

feat(proxy): support configurable timeouts and normalize Anthropic system messages#368
matrix72c wants to merge 2 commits into
InternLM:v1.0.0from
matrix72c:feat/proxy-timeout-anthropic-system

Conversation

@matrix72c

Copy link
Copy Markdown

Summary

  • allow SessionClient upstream timeouts to be configured with aiohttp.ClientTimeout or a serializable dict while preserving aiohttp defaults
  • optionally move system role messages into the Anthropic top-level system field before forwarding and trajectory recording
  • tolerate Anthropic batch payloads that do not have top-level messages

Both options are backward-compatible and disabled/defaulted to the existing behavior unless explicitly configured.

Motivation

External coding agents may run longer than aiohttp's default timeout. Some Anthropic-compatible backends also reject system roles inside messages, even when clients emit that shape. These proxy-level options let callers handle both cases without changing agent or daemon protocols.

Tests

  • Black 24.10.0
  • Flake8 7.1.1
  • isort 5.13.2
  • codespell 2.3.0
  • pytest -q tests/test_adapters/test_session_client.py -k "client_timeout or anthropic_system or batch_request" (7 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.

1 participant