mirror of
https://github.com/Alishahryar1/free-claude-code.git
synced 2026-05-02 21:30:40 +00:00
Major refactor: API, providers, messaging, and Anthropic protocol
Some checks are pending
CI / checks (push) Waiting to run
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.
This commit is contained in:
parent
b9ed704095
commit
f3a7528d49
139 changed files with 7460 additions and 2422 deletions
33
tests/api/test_validation_log.py
Normal file
33
tests/api/test_validation_log.py
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
"""Tests for validation log summaries (metadata only)."""
|
||||
|
||||
from api.validation_log import summarize_request_validation_body
|
||||
|
||||
|
||||
def test_summarize_lists_block_metadata_without_echoing_string_content():
|
||||
body = {
|
||||
"messages": [
|
||||
{
|
||||
"role": "user",
|
||||
"content": "secret user phrase",
|
||||
}
|
||||
],
|
||||
"tools": [{"name": "web_search", "type": "web_search_20250305"}],
|
||||
}
|
||||
summary, tool_names = summarize_request_validation_body(body)
|
||||
assert summary == [
|
||||
{
|
||||
"role": "user",
|
||||
"content_kind": "str",
|
||||
"content_length": 18,
|
||||
}
|
||||
]
|
||||
assert tool_names == ["web_search"]
|
||||
blob = repr(summary) + repr(tool_names)
|
||||
assert "secret" not in blob
|
||||
|
||||
|
||||
def test_summarize_handles_non_dict_messages_and_missing_tools():
|
||||
body = {"messages": ["not_a_dict"]}
|
||||
summary, tool_names = summarize_request_validation_body(body)
|
||||
assert summary == [{"message_kind": "str"}]
|
||||
assert tool_names == []
|
||||
Loading…
Add table
Add a link
Reference in a new issue