From 256eccd3f5b40d73c96d69316ecbc170c2159e57 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 16 Mar 2026 04:03:37 +0200 Subject: Rename timeout helpers to match actual durations (timeout20s, timeout18s) Co-Authored-By: Claude Opus 4.6 --- internal/hexaiaction/prompts.go | 4 ++-- internal/hexaiaction/run.go | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'internal') diff --git a/internal/hexaiaction/prompts.go b/internal/hexaiaction/prompts.go index 27c1b2e..2424819 100644 --- a/internal/hexaiaction/prompts.go +++ b/internal/hexaiaction/prompts.go @@ -191,10 +191,10 @@ func reqOptsFrom(cfg actionConfig) requestArgs { } // Timeout helpers to mirror LSP behavior. -func timeout10s(parent context.Context) (context.Context, context.CancelFunc) { +func timeout20s(parent context.Context) (context.Context, context.CancelFunc) { return context.WithTimeout(parent, 20*time.Second) } -func timeout8s(parent context.Context) (context.Context, context.CancelFunc) { +func timeout18s(parent context.Context) (context.Context, context.CancelFunc) { return context.WithTimeout(parent, 18*time.Second) } diff --git a/internal/hexaiaction/run.go b/internal/hexaiaction/run.go index f36b0cf..5b8bbc2 100644 --- a/internal/hexaiaction/run.go +++ b/internal/hexaiaction/run.go @@ -258,31 +258,31 @@ func handleRewriteAction(ctx context.Context, parts InputParts, cfg actionConfig _, _ = fmt.Fprintln(stderr, logging.AnsiBase+"hexai-tmux-action: no inline instruction found; echoing input"+logging.AnsiReset) return parts.Selection, nil } - return runWithTimeout(ctx, timeout10s, func(cctx context.Context) (string, error) { + return runWithTimeout(ctx, timeout20s, func(cctx context.Context) (string, error) { return runRewrite(cctx, cfg, client, instr, cleaned) }) } func handleDiagnosticsAction(ctx context.Context, parts InputParts, cfg actionConfig, client chatDoer) (string, error) { - return runWithTimeout(ctx, timeout10s, func(cctx context.Context) (string, error) { + return runWithTimeout(ctx, timeout20s, func(cctx context.Context) (string, error) { return runDiagnostics(cctx, cfg, client, parts.Diagnostics, parts.Selection) }) } func handleDocumentAction(ctx context.Context, parts InputParts, cfg actionConfig, client chatDoer) (string, error) { - return runWithTimeout(ctx, timeout10s, func(cctx context.Context) (string, error) { + return runWithTimeout(ctx, timeout20s, func(cctx context.Context) (string, error) { return runDocument(cctx, cfg, client, parts.Selection) }) } func handleGoTestAction(ctx context.Context, parts InputParts, cfg actionConfig, client chatDoer) (string, error) { - return runWithTimeout(ctx, timeout8s, func(cctx context.Context) (string, error) { + return runWithTimeout(ctx, timeout18s, func(cctx context.Context) (string, error) { return runGoTest(cctx, cfg, client, parts.Selection) }) } func handleSimplifyAction(ctx context.Context, parts InputParts, cfg actionConfig, client chatDoer) (string, error) { - return runWithTimeout(ctx, timeout10s, func(cctx context.Context) (string, error) { + return runWithTimeout(ctx, timeout20s, func(cctx context.Context) (string, error) { return runSimplify(cctx, cfg, client, parts.Selection) }) } @@ -292,7 +292,7 @@ func handleCustomAction(ctx context.Context, parts InputParts, cfg actionConfig, return parts.Selection, nil } custom := *selectedCustom - return runWithTimeout(ctx, timeout10s, func(cctx context.Context) (string, error) { + return runWithTimeout(ctx, timeout20s, func(cctx context.Context) (string, error) { return runCustom(cctx, cfg, client, custom, parts) }) } @@ -303,7 +303,7 @@ func handleCustomPromptAction(ctx context.Context, parts InputParts, cfg actionC _, _ = fmt.Fprintln(stderr, logging.AnsiBase+"hexai-tmux-action: custom prompt canceled or empty; echoing input"+logging.AnsiReset) return parts.Selection, nil } - return runWithTimeout(ctx, timeout10s, func(cctx context.Context) (string, error) { + return runWithTimeout(ctx, timeout20s, func(cctx context.Context) (string, error) { return runRewrite(cctx, cfg, client, prompt, parts.Selection) }) } -- cgit v1.2.3