mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-15 00:36:56 +08:00
fix(agent,claw402): harden agent runtime and strip max_tokens for thinking models
- Fix Stop() race condition using sync.Once - Add ensureHistory() to prevent nil panic in planner/dispatcher - Add bounds check on trader ID slicing - Log saveExecutionState and clearSetupState errors instead of discarding - Remove always-true modelID condition in onboard setup - Add Chinese setup keywords and expand model name aliases - Strip max_tokens from claw402 requests to avoid thinking-model budget exhaustion - Hide Agent nav tab (Beta) pending merge to main - Sync tests with code changes Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -6,7 +6,6 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"nofx/mcp"
|
||||
"nofx/store"
|
||||
)
|
||||
|
||||
@@ -380,7 +379,9 @@ func TestLoadAIClientFromStoreUserUsesUserSpecificEnabledModel(t *testing.T) {
|
||||
t.Fatalf("unexpected model name: %s", modelName)
|
||||
}
|
||||
|
||||
if _, ok := client.(*mcp.Client); !ok {
|
||||
t.Fatalf("expected *mcp.Client, got %T", client)
|
||||
// After the provider registry refactor, registered providers (like openai)
|
||||
// return their own AIClient implementation, not *mcp.Client.
|
||||
if client == nil {
|
||||
t.Fatal("expected non-nil AI client from provider registry")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user