MCPcopy
hub / github.com/su-kaka/gcli2api / get_auto_ban_error_codes

Function get_auto_ban_error_codes

config.py:131–149  ·  view source on GitHub ↗

Get auto ban error codes. Environment variable: AUTO_BAN_ERROR_CODES (comma-separated, e.g., "400,403") Database config key: auto_ban_error_codes Default: [400, 403]

()

Source from the content-addressed store, hash-verified

129
130
131async def get_auto_ban_error_codes() -> list:
132 """
133 Get auto ban error codes.
134
135 Environment variable: AUTO_BAN_ERROR_CODES (comma-separated, e.g., "400,403")
136 Database config key: auto_ban_error_codes
137 Default: [400, 403]
138 """
139 env_value = os.getenv("AUTO_BAN_ERROR_CODES")
140 if env_value:
141 try:
142 return [int(code.strip()) for code in env_value.split(",") if code.strip()]
143 except ValueError:
144 pass
145
146 codes = await get_config_value("auto_ban_error_codes")
147 if codes and isinstance(codes, list):
148 return codes
149 return AUTO_BAN_ERROR_CODES
150
151
152async def get_retry_429_max_retries() -> int:

Callers 5

stream_requestFunction · 0.90
non_stream_requestFunction · 0.90
check_should_auto_banFunction · 0.90
stream_requestFunction · 0.90
non_stream_requestFunction · 0.90

Calls 1

get_config_valueFunction · 0.85

Tested by

no test coverage detected