mirror of
https://github.com/Alishahryar1/free-claude-code.git
synced 2026-04-26 10:31:07 +00:00
Some checks are pending
CI / checks (push) Waiting to run
Consolidates the incremental refactor work into a single change set: modular web tools (api/web_tools), native Anthropic request building and SSE block policy, OpenAI conversion and error handling, provider transports and rate limiting, messaging handler and tree queue, safe logging, smoke tests, and broad test coverage.
15 lines
599 B
Python
15 lines
599 B
Python
"""Limits and defaults for outbound web server tool HTTP."""
|
|
|
|
_REQUEST_TIMEOUT_S = 20.0
|
|
_MAX_SEARCH_RESULTS = 10
|
|
_MAX_FETCH_CHARS = 24_000
|
|
# Hard cap on raw bytes read from HTTP responses before decode / HTML parse (memory bound).
|
|
_MAX_WEB_FETCH_RESPONSE_BYTES = 2 * 1024 * 1024
|
|
# Drain at most this many bytes from redirect responses before following Location.
|
|
_REDIRECT_RESPONSE_BODY_CAP_BYTES = 65_536
|
|
_MAX_WEB_FETCH_REDIRECTS = 10
|
|
_WEB_FETCH_REDIRECT_STATUSES = frozenset({301, 302, 303, 307, 308})
|
|
|
|
_WEB_TOOL_HTTP_HEADERS = {
|
|
"User-Agent": "Mozilla/5.0 compatible; free-claude-code/2.0",
|
|
}
|