• Your Name's avatar
    Implement Phase 3 Claude provider improvements · 5c357f98
    Your Name authored
    Add three robustness improvements to ClaudeProviderHandler:
    
    1. Message Role Validation (_validate_messages):
       - Validate roles are one of: user, assistant, system, tool
       - Auto-fix unknown roles to 'user'
       - Ensure system messages only appear at start
       - Insert synthetic assistant messages between consecutive user messages
       - Merge consecutive assistant messages
       - Validate tool messages have tool_call_id
       - Reference: vendors/kilocode normalizeMessages() + ensure_alternating_roles()
    
    2. Tool Result Size Validation (_truncate_tool_result):
       - Truncate oversized tool results with configurable limit (default 100k chars)
       - Add truncation notice with original length info
       - Reference: vendors/claude applyToolResultBudget
    
    3. Model Fallback Support (handle_request refactoring):
       - Add _get_fallback_models() to read fallback list from config
       - Retry with fallback models on retryable errors (rate limit, overloaded)
       - Split into handle_request() (with retry) and _handle_request_with_model() (actual logic)
       - Log fallback attempts for debugging
    
    All methods integrated into handle_request() for automatic application.
    5c357f98
Name
Last commit
Last update
aisbf Loading commit data...
config Loading commit data...
docs Loading commit data...
static Loading commit data...
templates Loading commit data...
.gitignore Loading commit data...
.providers.json.swp Loading commit data...
=0.5.0 Loading commit data...
AI.PROMPT Loading commit data...
API_EXAMPLES.md Loading commit data...
CHANGELOG.md Loading commit data...
CLAUDE_OAUTH2_DEEP_DIVE.md Loading commit data...
CLAUDE_OAUTH2_SETUP.md Loading commit data...
DEBUG_GUIDE.md Loading commit data...
DOCUMENTATION.md Loading commit data...
LICENSE.txt Loading commit data...
MANIFEST.in Loading commit data...
PYPI.md Loading commit data...
README.md Loading commit data...
TODO.md Loading commit data...
aisbf.sh Loading commit data...
build.sh Loading commit data...
clean.sh Loading commit data...
cli.py Loading commit data...
main.py Loading commit data...
pyproject.toml Loading commit data...
requirements.txt Loading commit data...
screenshot.png Loading commit data...
setup.py Loading commit data...
start_proxy.sh Loading commit data...
test_google.sh Loading commit data...
test_kiro_models_origin.py Loading commit data...
test_proxy.sh Loading commit data...
test_response_cache.py Loading commit data...