summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
Diffstat (limited to 'internal')
-rw-r--r--internal/appconfig/config_types.go2
-rw-r--r--internal/hexaicli/run_timeout_test.go37
-rw-r--r--internal/version.go2
3 files changed, 39 insertions, 2 deletions
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"