mirror of
https://gitcode.com/JianFeeeee/HomeAgent.git
synced 2026-10-04 00:03:59 +00:00
fix: bump llm http client timeout 120s→180s for llmsproxy AUTO chain failover
The local llmsproxy AUTO chain tries 6+ slots across 3 tiers sequentially. Each failed tier incurs busyWait (2s) + upstream timeout, so a full chain exhaustion can exceed 120s. The llmsproxy logs showed 143 'context canceled' errors for the homeagent key — the client gave up before the chain finished. 180s gives the chain enough room to complete before the client timeout fires. Also remove stale backup files under /usr/local/bin/.
This commit is contained in:
@ -185,6 +185,22 @@ func main() {
|
||||
runInteractive(state, cfg)
|
||||
}
|
||||
|
||||
// runInteractive 交互入口:TTY 下走 Bubble Tea 全屏 TUI,非 TTY 回退行式 REPL。
|
||||
func runInteractive(state *State, cfg *Config) {
|
||||
history := newHistory(historyPath(), 1000)
|
||||
history.load()
|
||||
|
||||
if isTTYFile(os.Stdin) && isTTYFile(os.Stdout) && colors {
|
||||
if err := runTUI(state, cfg, history); err != nil {
|
||||
printlnC(colorRed, fmt.Sprintf("tui: %v", err))
|
||||
printlnC(colorYellow, "falling back to line mode")
|
||||
runLineMode(state, cfg, history)
|
||||
}
|
||||
return
|
||||
}
|
||||
runLineMode(state, cfg, history)
|
||||
}
|
||||
|
||||
func oneshot(state *State, msg string) {
|
||||
stop := startSpinner("thinking...")
|
||||
resp, err := state.SendChatStream(msg, func(rl respLine) {
|
||||
@ -222,13 +238,11 @@ func runCapTest(capName, args string) {
|
||||
fmt.Println("测试完成")
|
||||
}
|
||||
|
||||
func runInteractive(state *State, cfg *Config) {
|
||||
// runLineMode 传统行式 REPL(非 TTY 回退 / TUI 启动失败时使用)。
|
||||
func runLineMode(state *State, cfg *Config, history History) {
|
||||
sigCh := make(chan os.Signal, 1)
|
||||
signal.Notify(sigCh, syscall.SIGINT, syscall.SIGTERM)
|
||||
|
||||
history := newHistory(historyPath(), 1000)
|
||||
history.load()
|
||||
|
||||
line := newLineEditor(&history)
|
||||
|
||||
restore, err := setRawMode(0)
|
||||
@ -298,7 +312,7 @@ loop:
|
||||
}
|
||||
|
||||
if cmd[0] == '/' {
|
||||
if handleBuiltin(cmd, cfg, state, reconnect) {
|
||||
if handleBuiltin(cmd, cfg, state, reconnect, os.Stdout) {
|
||||
if cmd == "/exit" || cmd == "/quit" {
|
||||
break loop
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user