mirror of
https://github.com/alibaba/open-code-review.git
synced 2026-08-21 14:44:56 +00:00
|
Some checks are pending
CI / cross-compile (arm64, linux) (push) Waiting to run
CI / cross-compile (arm64, windows) (push) Waiting to run
CI / cross-compile (arm64, darwin) (push) Waiting to run
Deploy Pages / deploy (push) Blocked by required conditions
Deploy Pages / build (push) Waiting to run
CI / test (push) Waiting to run
CI / cross-compile (amd64, darwin) (push) Waiting to run
CI / cross-compile (amd64, windows) (push) Waiting to run
CodeQL Advanced / Analyze (go) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
* feat(llm): support custom retry status codes via retry_codes config Add a retry_codes configuration field that allows users to specify additional HTTP status codes (4xx) that should trigger exponential backoff retry. This targets self-hosted LLM clusters that misuse status codes like 403 or 400 for rate limiting. Implementation uses SDK middleware to inject the x-should-retry: true response header when a configured status code is encountered, leveraging the existing SDK retry mechanism (up to 5 retries with exponential backoff) without any SDK modifications. Configuration is supported via: - Provider config: providers.<name>.retry_codes / custom_providers.<name>.retry_codes - Legacy llm config: llm.retry_codes - CLI: ocr config set providers.<name>.retry_codes 403,400 Also fixes cloneProviderEntry to copy previously missing fields (TimeoutSec, ExtraHeaders, RetryCodes) for TUI rollback correctness. * test(llm): add unit tests for retry_codes feature Cover ParseRetryCodes validation, retryCodesMiddleware behavior, resolver integration (provider and legacy config paths, invalid codes), and end-to-end retry via httptest for both OpenAI and Anthropic clients. * feat(llm): silently filter redundant retry_codes (408/409/429) instead of erroring Replace validateRetryCodes with sanitizeRetryCodes that filters out SDK-default codes and returns warnings. The resolve phase silently drops redundant codes without interrupting startup. The config set command prints warnings to stderr so users are informed. This makes the tool friendlier for users migrating from other tools who habitually configure 429 and similar codes. * test(tui): add coverage for cloneProviderEntry deep-copy of TimeoutSec/RetryCodes/ExtraHeaders Verify that the clone correctly copies these fields and that mutations to the clone do not affect the original. Also pin the nil-stays-nil behavior for RetryCodes and ExtraHeaders. * docs(llm): fix contradictory ParseRetryCodes comment * test(config): cover retry_codes warning output in config set path Verify that redundant codes (429, 408) emit a WARNING to stderr while still writing the valid codes to config. Also verify that valid-only codes produce no warning output. |
||
|---|---|---|
| .. | ||
| apply_provider_field_test.go | ||
| background_file.go | ||
| background_file_test.go | ||
| budget_output_test.go | ||
| compat_test.go | ||
| completion.go | ||
| config_cmd.go | ||
| config_cmd_test.go | ||
| config_dispatch_test.go | ||
| config_runset_test.go | ||
| config_unset_error_test.go | ||
| delegate_cmd.go | ||
| delegate_exec_test.go | ||
| delegate_helpers_test.go | ||
| emit_run_result_test.go | ||
| flag_suggest.go | ||
| flag_suggest_test.go | ||
| flags_test.go | ||
| git.go | ||
| git_test.go | ||
| llm_cmd.go | ||
| main.go | ||
| misc_helpers_test.go | ||
| output.go | ||
| output_helpers_test.go | ||
| output_manifest_test.go | ||
| output_test.go | ||
| parent_cmd_test.go | ||
| procattr_unix.go | ||
| procattr_windows.go | ||
| provider_cmd.go | ||
| provider_cmd_test.go | ||
| provider_config_apply_test.go | ||
| provider_tui.go | ||
| provider_tui_cpinput_test.go | ||
| provider_tui_customform_test.go | ||
| provider_tui_deleteconfirm_test.go | ||
| provider_tui_editsave_test.go | ||
| provider_tui_funcs_test.go | ||
| provider_tui_manualenter_test.go | ||
| provider_tui_modeltui_test.go | ||
| provider_tui_persist_test.go | ||
| provider_tui_rollback_test.go | ||
| provider_tui_savefail_test.go | ||
| provider_tui_test.go | ||
| review_cmd.go | ||
| review_cmd_test.go | ||
| review_helpers_test.go | ||
| review_mcp_more_test.go | ||
| review_resume_more_test.go | ||
| root.go | ||
| rules_check_test.go | ||
| rules_cmd.go | ||
| scan_cmd.go | ||
| scan_cmd_test.go | ||
| scan_helpers_test.go | ||
| scan_resume_more_test.go | ||
| session_cmd.go | ||
| session_cmd_test.go | ||
| session_complete_test.go | ||
| session_display_more_test.go | ||
| shared.go | ||
| shared_flags.go | ||
| shared_llmruntime_test.go | ||
| shared_test.go | ||
| shell_unix.go | ||
| shell_windows.go | ||
| smallfiles_test.go | ||
| version.go | ||
| viewer_cmd.go | ||
| zero_args_test.go | ||