mirror of
https://github.com/Alishahryar1/free-claude-code.git
synced 2026-04-28 11:30:03 +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
|
|
@ -65,8 +65,8 @@ def is_prefix_detection_request(request_data: MessagesRequest) -> tuple[bool, st
|
|||
try:
|
||||
cmd_start = content.rfind("Command:") + len("Command:")
|
||||
return True, content[cmd_start:].strip()
|
||||
except Exception:
|
||||
pass
|
||||
except TypeError:
|
||||
return False, ""
|
||||
|
||||
return False, ""
|
||||
|
||||
|
|
@ -121,19 +121,16 @@ def is_filepath_extraction_request(
|
|||
if not user_has_filepaths and not system_has_extract:
|
||||
return False, "", ""
|
||||
|
||||
try:
|
||||
cmd_start = content.find("Command:") + len("Command:")
|
||||
output_marker = content.find("Output:", cmd_start)
|
||||
if output_marker == -1:
|
||||
return False, "", ""
|
||||
|
||||
command = content[cmd_start:output_marker].strip()
|
||||
output = content[output_marker + len("Output:") :].strip()
|
||||
|
||||
for marker in ["<", "\n\n"]:
|
||||
if marker in output:
|
||||
output = output.split(marker)[0].strip()
|
||||
|
||||
return True, command, output
|
||||
except Exception:
|
||||
cmd_start = content.find("Command:") + len("Command:")
|
||||
output_marker = content.find("Output:", cmd_start)
|
||||
if output_marker == -1:
|
||||
return False, "", ""
|
||||
|
||||
command = content[cmd_start:output_marker].strip()
|
||||
output = content[output_marker + len("Output:") :].strip()
|
||||
|
||||
for marker in ["<", "\n\n"]:
|
||||
if marker in output:
|
||||
output = output.split(marker)[0].strip()
|
||||
|
||||
return True, command, output
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue