mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-17 09:24:36 +08:00
fix: increase x402 payment timeout to 5min and add 402 re-sign logic
AI inference (especially DeepSeek) often exceeds the default 120s HTTP timeout, causing the client to disconnect while the server completes successfully — resulting in repeated payments on each retry. Changes: - Set X402Timeout = 5min for all x402 providers (Claw402, BlockRunBase, BlockRunSol) - Handle 402 during payment retry by re-extracting Payment-Required header and re-signing instead of failing immediately - Increase payment retry attempts from 3 to 5 for unstable gateways
This commit is contained in:
@@ -72,6 +72,7 @@ func NewBlockRunBaseClientWithOptions(opts ...mcp.ClientOption) mcp.AIClient {
|
||||
mcp.WithProvider(mcp.ProviderBlockRunBase),
|
||||
mcp.WithModel(DefaultBlockRunModel),
|
||||
mcp.WithBaseURL(DefaultBlockRunBaseURL),
|
||||
mcp.WithTimeout(X402Timeout),
|
||||
}
|
||||
allOpts := append(baseOpts, opts...)
|
||||
baseClient := mcp.NewClient(allOpts...).(*mcp.Client)
|
||||
|
||||
Reference in New Issue
Block a user