diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-16 04:03:37 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-16 04:03:37 +0200 |
| commit | 256eccd3f5b40d73c96d69316ecbc170c2159e57 (patch) | |
| tree | 1fa6919636221aac451799b8cb7adb8d0f60d839 /internal | |
| parent | 5100880aefb7a8da7efb59ee32b181b18de4b705 (diff) | |
Rename timeout helpers to match actual durations (timeout20s, timeout18s)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/hexaiaction/prompts.go | 4 | ||||
| -rw-r--r-- | internal/hexaiaction/run.go | 14 |
2 files changed, 9 insertions, 9 deletions
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) }) } |
