mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:40:44 +00:00
fix: use API-supported docs i18n model
This commit is contained in:
@@ -231,11 +231,13 @@ func previewCommandOutput(stdout, stderr string) string {
|
||||
return "no output"
|
||||
}
|
||||
combined = strings.Join(strings.Fields(combined), " ")
|
||||
const limit = 500
|
||||
const limit = 900
|
||||
if len(combined) <= limit {
|
||||
return combined
|
||||
}
|
||||
return combined[:limit] + "..."
|
||||
const headLimit = 350
|
||||
const tailLimit = limit - headLimit
|
||||
return combined[:headLimit] + " ... " + combined[len(combined)-tailLimit:]
|
||||
}
|
||||
|
||||
func sleepWithContext(ctx context.Context, delay time.Duration) error {
|
||||
|
||||
@@ -158,7 +158,7 @@ printf 'translated from codex\n' > "$out"
|
||||
got, err := runCodexExecPrompt(context.Background(), codexPromptRequest{
|
||||
SystemPrompt: "Translate.",
|
||||
Message: "Hello",
|
||||
Model: "gpt-5.5",
|
||||
Model: "gpt-5.2",
|
||||
Thinking: "high",
|
||||
})
|
||||
if err != nil {
|
||||
@@ -170,7 +170,7 @@ printf 'translated from codex\n' > "$out"
|
||||
}
|
||||
|
||||
func TestPreviewCommandOutputFlattensAndTruncates(t *testing.T) {
|
||||
input := "line one\n\nline two\tline three " + strings.Repeat("x", 600)
|
||||
input := "line one\n\nline two\tline three " + strings.Repeat("x", 1200)
|
||||
preview := previewCommandOutput(input, "")
|
||||
if strings.Contains(preview, "\n") {
|
||||
t.Fatalf("expected flattened whitespace, got %q", preview)
|
||||
@@ -178,7 +178,7 @@ func TestPreviewCommandOutputFlattensAndTruncates(t *testing.T) {
|
||||
if !strings.HasPrefix(preview, "line one line two line three ") {
|
||||
t.Fatalf("unexpected preview prefix: %q", preview)
|
||||
}
|
||||
if !strings.HasSuffix(preview, "...") {
|
||||
t.Fatalf("expected truncation suffix, got %q", preview)
|
||||
if !strings.Contains(preview, " ... ") {
|
||||
t.Fatalf("expected truncation marker, got %q", preview)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ const (
|
||||
docsI18nEngineName = "codex"
|
||||
envDocsI18nProvider = "OPENCLAW_DOCS_I18N_PROVIDER"
|
||||
envDocsI18nModel = "OPENCLAW_DOCS_I18N_MODEL"
|
||||
defaultOpenAIModel = "gpt-5.5"
|
||||
defaultOpenAIModel = "gpt-5.2"
|
||||
defaultFallbackProvider = "openai"
|
||||
defaultFallbackModelName = defaultOpenAIModel
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user