mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-09-09 09:29:17 +08:00
- Implemented a Go-based dynamic library plugin for request lifecycle management. - Added concurrency controls, keyword-based request termination, and response handling. - Supported optional capabilities for request interception and active lifecycle termination. - Included tests for schema compatibility, concurrency limits, and policy-based termination. - Added build instructions and configuration details in README. - Updated host support for lifecycle plugin RPC methods. Closes: #4568
19 lines
574 B
Go
19 lines
574 B
Go
package auth
|
|
|
|
import (
|
|
"net/http"
|
|
"testing"
|
|
|
|
cliproxyexecutor "github.com/router-for-me/CLIProxyAPI/v7/sdk/cliproxy/executor"
|
|
)
|
|
|
|
func TestRequestTerminatedErrorSkipsCreditsFallback(t *testing.T) {
|
|
errTerminated := &cliproxyexecutor.RequestTerminatedError{HTTPStatus: http.StatusTooManyRequests}
|
|
if !isRequestTerminatedError(errTerminated) {
|
|
t.Fatal("isRequestTerminatedError() = false")
|
|
}
|
|
if shouldAttemptAntigravityCreditsFallback(&Manager{}, errTerminated, []string{"antigravity"}) {
|
|
t.Fatal("terminated request must not use Antigravity credits fallback")
|
|
}
|
|
}
|