summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-14 16:15:04 +0200
committerPaul Buetow <paul@buetow.org>2026-03-14 16:15:04 +0200
commit10112d4b7a8150118e705b95df73c08824ac2b22 (patch)
treea441a95ed22bef8f5eae4bdd5b103b8fb3e9ccbb
parent4cf21e265c1de0457af30aecb77ef0826468e366 (diff)
Release v0.22.3v0.22.3
-rw-r--r--config.toml.example2
-rw-r--r--internal/appconfig/config_types.go2
-rw-r--r--internal/hexaicli/run_timeout_test.go37
-rw-r--r--internal/version.go2
4 files changed, 40 insertions, 3 deletions
diff --git a/config.toml.example b/config.toml.example
index 84734a5..098600e 100644
--- a/config.toml.example
+++ b/config.toml.example
@@ -9,7 +9,7 @@
[general]
max_tokens = 4000
max_context_tokens = 4000
-request_timeout = 30 # LLM request timeout in seconds
+request_timeout = 600 # LLM request timeout in seconds (10 minutes)
# context_mode controls how much of the current document is sent as extra context:
# - minimal: no additional context beyond the request payload.
# - window: include a sliding window of ~context_window_lines around the cursor.
diff --git a/internal/appconfig/config_types.go b/internal/appconfig/config_types.go
index 92dad25..59b02e3 100644
--- a/internal/appconfig/config_types.go
+++ b/internal/appconfig/config_types.go
@@ -170,7 +170,7 @@ func newDefaultConfig() App {
ContextWindowLines: 120,
MaxContextTokens: 4000,
LogPreviewLimit: 100,
- RequestTimeout: 30,
+ RequestTimeout: 600,
CodingTemperature: &t,
OpenAITemperature: &t,
OllamaTemperature: &t,
diff --git a/internal/hexaicli/run_timeout_test.go b/internal/hexaicli/run_timeout_test.go
new file mode 100644
index 0000000..642f172
--- /dev/null
+++ b/internal/hexaicli/run_timeout_test.go
@@ -0,0 +1,37 @@
+package hexaicli
+
+import (
+ "bytes"
+ "context"
+ "strings"
+ "testing"
+
+ "codeberg.org/snonux/hexai/internal/appconfig"
+ "codeberg.org/snonux/hexai/internal/llm"
+)
+
+func TestRun_DefaultRequestTimeoutIsTenMinutes(t *testing.T) {
+ t.Chdir(t.TempDir())
+ t.Setenv("XDG_CONFIG_HOME", t.TempDir())
+ t.Setenv("HEXAI_REQUEST_TIMEOUT", "")
+
+ oldNew := newClientFromApp
+ defer func() { newClientFromApp = oldNew }()
+
+ seenTimeout := 0
+ newClientFromApp = func(cfg appconfig.App) (llm.Client, error) {
+ seenTimeout = cfg.RequestTimeout
+ return okClient{}, nil
+ }
+
+ var out, errb bytes.Buffer
+ if err := Run(context.Background(), []string{"hello"}, strings.NewReader(""), &out, &errb); err != nil {
+ t.Fatalf("Run: %v", err)
+ }
+ if seenTimeout != 600 {
+ t.Fatalf("RequestTimeout = %d, want 600", seenTimeout)
+ }
+ if !strings.Contains(out.String(), "OK") {
+ t.Fatalf("expected output from fake client, got %q", out.String())
+ }
+}
diff --git a/internal/version.go b/internal/version.go
index a0e474c..923040e 100644
--- a/internal/version.go
+++ b/internal/version.go
@@ -1,4 +1,4 @@
// Summary: Hexai semantic version identifier used by CLI and LSP binaries.
package internal
-const Version = "0.22.2"
+const Version = "0.22.3"