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.
17 lines
544 B
Python
17 lines
544 B
Python
"""Helpers for redacting user-derived content from log lines."""
|
|
|
|
from __future__ import annotations
|
|
|
|
|
|
def format_exception_for_log(exc: BaseException, *, log_full_message: bool) -> str:
|
|
"""Return exception type and optionally ``str(exc)`` for operator diagnostics."""
|
|
if log_full_message:
|
|
return f"{type(exc).__name__}: {exc}"
|
|
return type(exc).__name__
|
|
|
|
|
|
def text_len_hint(text: str | None) -> int:
|
|
"""Length of text for metadata-only logging (0 when missing)."""
|
|
if not text:
|
|
return 0
|
|
return len(text)
|