From ad5f22c76f782fc2d8cebbb29c05dc5ae7f0cf0b Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 10 Feb 2026 09:00:34 +0200 Subject: small adjustments --- .gitignore | 1 + PR.md | 64 ---------------- README.md | 2 +- project.d2 | 244 ------------------------------------------------------------ project.svg | 102 ------------------------- 5 files changed, 2 insertions(+), 411 deletions(-) delete mode 100644 PR.md delete mode 100644 project.d2 delete mode 100644 project.svg diff --git a/.gitignore b/.gitignore index a285ccb..0d66562 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ docs/coverage/ llm.out /tmp/ .serena +ignoretest.md diff --git a/PR.md b/PR.md deleted file mode 100644 index 686c7ab..0000000 --- a/PR.md +++ /dev/null @@ -1,64 +0,0 @@ -# Add configurable request timeout for LLM calls - -## Motivation - -When using locally-hosted LLMs (via LM Studio, Ollama, or other OpenAI-compatible servers), the default 30-second HTTP timeout is often insufficient. Local models, especially larger ones like Gemma 3 27B, can take significantly longer to generate responses, resulting in "context deadline exceeded" errors. - -This change allows users to configure a longer timeout to accommodate slower local inference. - -## Changes - -### New configuration option - -Added `request_timeout` (in seconds) to the `[general]` section: - -```toml -[general] -request_timeout = 120 # seconds, default 30 -``` - -Or via environment variable: -```sh -export HEXAI_REQUEST_TIMEOUT=120 -``` - -### Implementation - -- Added `RequestTimeout` field to config structs with default of 30 seconds -- Each LLM client constructor now has a `*WithTimeout` variant that accepts the timeout -- Original constructors remain unchanged (delegate to `*WithTimeout` with default) -- `NewFromConfig` passes the configured timeout to clients - -### Files modified - -- `internal/appconfig/config.go` - Config field, parsing, merge logic, env var support -- `internal/llm/provider.go` - Added `RequestTimeout` to `Config`, calls `*WithTimeout` constructors -- `internal/llm/openai.go` - Added `newOpenAIWithTimeout` -- `internal/llm/ollama.go` - Added `newOllamaWithTimeout` -- `internal/llm/openrouter.go` - Added `newOpenRouterWithTimeout` -- `internal/llm/anthropic.go` - Added `newAnthropicWithTimeout` -- `internal/hexailsp/run.go` - Pass `RequestTimeout` to `llm.Config` -- `internal/llmutils/client.go` - Pass `RequestTimeout` to `llm.Config` -- `internal/lsp/server.go` - Pass `RequestTimeout` to `llm.Config` -- `config.toml.example` - Documented option -- `docs/configuration.md` - Added `HEXAI_REQUEST_TIMEOUT` to env vars list - -### Test impact - -No test files were modified. The original constructor signatures are preserved, so all existing tests continue to work unchanged. - -## Testing - -```sh -# Set timeout in config -[general] -request_timeout = 120 - -# Test with local LLM -cat somefile.go | hexai "review this code" -``` - -All existing tests pass: -```sh -HEXAI_TEST_SKIP_NET=1 go test ./... -``` diff --git a/README.md b/README.md index a8f7901..7011723 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ It has got improved capabilities for Go code understanding (for example, create - Includes a "Custom prompt" action (hotkey `p`) that opens your editor (`$HEXAI_EDITOR` or `$EDITOR`) on a temporary Markdown file. * Tmux popup editor (`hexai-tmux-edit`) for composing longer AI agent prompts - Opens `$EDITOR` in a tmux popup, pre-filled with the current prompt text - - Auto-detects Claude Code, Cursor, Amp, Aider, and other agents + - Auto-detects Claude Code, Cursor, Amp, Aider (WIP), and other agents - Config-driven: add new agents via `[tmux_edit]` in config.toml * Support for OpenAI, OpenRouter, Anthropic, and Ollama diff --git a/project.d2 b/project.d2 deleted file mode 100644 index b6ebde2..0000000 --- a/project.d2 +++ /dev/null @@ -1,244 +0,0 @@ - -direction: right -"hexai": { - shape: package - ".gitignore" - "AGENTS.md" - "config.toml.example" - "go.mod" - "go.sum" - "hexai-small.png" - "hexai.png" - "Magefile.go" - "README.md" - "SCRATCHPAD.md" - "bin": { - shape: package - } - "cmd": { - shape: package - "hexai": { - shape: package - "main.go" - "main_test.go" - } - "hexai-action": { - shape: package - } - "hexai-lsp": { - shape: package - "main.go" - "main_test.go" - } - "hexai-tmux-action": { - shape: package - "main.go" - } - "internal": { - shape: package - "hexai-action": { - shape: package - } - } - } - "docs": { - shape: package - "buildandinstall.md" - "configuration.md" - "coverage.html" - "coverage.out" - "custom-code-actions.md" - "tmux-status-bar.png" - "tmux.md" - "usage.md" - } - "internal": { - shape: package - "version.go" - "appconfig": { - shape: package - "config.go" - "config_alias_test.go" - "config_env_model_test.go" - "config_test.go" - "custom_validation_more_test.go" - } - "editor": { - shape: package - "editor.go" - "editor_test.go" - } - "hexaiaction": { - shape: package - "cmdentry.go" - "cmdentry_runcommand_test.go" - "cmdentry_test.go" - "custom_action_test.go" - "custom_exec_more_test.go" - "custom_exec_test.go" - "parse.go" - "parse_test.go" - "prompts.go" - "prompts_more_test.go" - "prompts_simplify_test.go" - "run.go" - "run_more_test.go" - "run_seam_test.go" - "run_test.go" - "tui.go" - "tui_custom.go" - "tui_custom_test.go" - "tui_delegate.go" - "tui_delegate_test.go" - "tui_test.go" - "types.go" - } - "hexaicli": { - shape: package - "editor_integration_test.go" - "run.go" - "run_editor_behavior_test.go" - "run_model_override_test.go" - "run_more_test.go" - "run_test.go" - "testhelpers_test.go" - } - "hexailsp": { - shape: package - "run.go" - "run_more_test.go" - "run_test.go" - } - "llm": { - shape: package - "copilot.go" - "copilot_http_test.go" - "copilot_test.go" - "ollama.go" - "ollama_test.go" - "openai.go" - "openai_http_test.go" - "openai_request_test.go" - "openai_sse_negative_test.go" - "openai_temp_test.go" - "openai_test.go" - "openrouter.go" - "openrouter_test.go" - "provider.go" - "provider_more2_test.go" - "provider_more_test.go" - "provider_test.go" - "test_helpers_test.go" - "util.go" - "util_test.go" - } - "llmutils": { - shape: package - "client.go" - "client_test.go" - } - "logging": { - shape: package - "chatlogger.go" - "logging.go" - "logging_test.go" - } - "lsp": { - shape: package - "build_prompts_table_test.go" - "chat_commands.go" - "chat_commands_test.go" - "chat_context_mode_test.go" - "chat_history_test.go" - "chat_no_double_answer_test.go" - "chat_prompt_test.go" - "chat_trigger_suppression_test.go" - "code_fences_table_test.go" - "codeaction_custom_errors_test.go" - "codeaction_custom_test.go" - "codeaction_gotest_int_test.go" - "codeaction_more_test.go" - "codeaction_prompts_test.go" - "codeaction_test.go" - "codegen_helpers_test.go" - "completion_cache_test.go" - "completion_codex_path_test.go" - "completion_helpers_more_test.go" - "completion_messages_test.go" - "completion_prefix_strip_test.go" - "completion_provider_fallback_test.go" - "completion_toggle_test.go" - "compute_textedit_table_test.go" - "context.go" - "context_test.go" - "coverage_add_test.go" - "debounce_throttle_more_test.go" - "debounce_throttle_test.go" - "diagnostics_action_test.go" - "document.go" - "document_handlers_test.go" - "document_test.go" - "fallback_items_test.go" - "gotest_append_test.go" - "handlers.go" - "handlers_codeaction.go" - "handlers_completion.go" - "handlers_document.go" - "handlers_end_to_end_test.go" - "handlers_execute.go" - "handlers_helpers_test.go" - "handlers_init.go" - "handlers_init_more_test.go" - "handlers_test.go" - "handlers_utils.go" - "helpers_inline_prompt_test.go" - "helpers_more_test.go" - "init_and_trigger_test.go" - "init_shutdown_test.go" - "inline_prompt_completion_test.go" - "instruction_table_test.go" - "label_filter_table_test.go" - "llm_request_opts_test.go" - "llm_stats_test.go" - "log_context_test.go" - "postprocess_indent_test.go" - "prefix_table_test.go" - "provider_native_success_test.go" - "rewrite_diagnostics_realism_test.go" - "server.go" - "server_test.go" - "testfakes_test.go" - "testhelper_capture_llm_test.go" - "transport.go" - "transport_concurrency_test.go" - "transport_test.go" - "triggers_config_test.go" - "types.go" - } - "runtimeconfig": { - shape: package - "store.go" - "store_test.go" - } - "stats": { - shape: package - "debugstring_test.go" - "lock_posix.go" - "lock_windows.go" - "stats.go" - "stats_test.go" - } - "testutil": { - shape: package - } - "textutil": { - shape: package - } - "tmux": { - shape: package - } - } - "llminputs": { - shape: package - } -} diff --git a/project.svg b/project.svg deleted file mode 100644 index 205fcb2..0000000 --- a/project.svg +++ /dev/null @@ -1,102 +0,0 @@ -hexai.gitignoreAGENTS.mdconfig.toml.examplego.modgo.sumhexai-small.pnghexai.pngMagefile.goREADME.mdSCRATCHPAD.mdbincmddocsinternalllminputshexaihexai-actionhexai-lsphexai-tmux-actioninternalbuildandinstall.mdconfiguration.mdcoverage.htmlcoverage.outcustom-code-actions.mdtmux-status-bar.pngtmux.mdusage.mdversion.goappconfigeditorhexaiactionhexaiclihexailspllmllmutilslogginglspruntimeconfigstatstestutiltextutiltmuxmain.gomain_test.gomain.gomain_test.gomain.gohexai-actionconfig.goconfig_alias_test.goconfig_env_model_test.goconfig_test.gocustom_validation_more_test.goeditor.goeditor_test.gocmdentry.gocmdentry_runcommand_test.gocmdentry_test.gocustom_action_test.gocustom_exec_more_test.gocustom_exec_test.goparse.goparse_test.goprompts.goprompts_more_test.goprompts_simplify_test.gorun.gorun_more_test.gorun_seam_test.gorun_test.gotui.gotui_custom.gotui_custom_test.gotui_delegate.gotui_delegate_test.gotui_test.gotypes.goeditor_integration_test.gorun.gorun_editor_behavior_test.gorun_model_override_test.gorun_more_test.gorun_test.gotesthelpers_test.gorun.gorun_more_test.gorun_test.gocopilot.gocopilot_http_test.gocopilot_test.goollama.goollama_test.goopenai.goopenai_http_test.goopenai_request_test.goopenai_sse_negative_test.goopenai_temp_test.goopenai_test.goopenrouter.goopenrouter_test.goprovider.goprovider_more2_test.goprovider_more_test.goprovider_test.gotest_helpers_test.goutil.goutil_test.goclient.goclient_test.gochatlogger.gologging.gologging_test.gobuild_prompts_table_test.gochat_commands.gochat_commands_test.gochat_context_mode_test.gochat_history_test.gochat_no_double_answer_test.gochat_prompt_test.gochat_trigger_suppression_test.gocode_fences_table_test.gocodeaction_custom_errors_test.gocodeaction_custom_test.gocodeaction_gotest_int_test.gocodeaction_more_test.gocodeaction_prompts_test.gocodeaction_test.gocodegen_helpers_test.gocompletion_cache_test.gocompletion_codex_path_test.gocompletion_helpers_more_test.gocompletion_messages_test.gocompletion_prefix_strip_test.gocompletion_provider_fallback_test.gocompletion_toggle_test.gocompute_textedit_table_test.gocontext.gocontext_test.gocoverage_add_test.godebounce_throttle_more_test.godebounce_throttle_test.godiagnostics_action_test.godocument.godocument_handlers_test.godocument_test.gofallback_items_test.gogotest_append_test.gohandlers.gohandlers_codeaction.gohandlers_completion.gohandlers_document.gohandlers_end_to_end_test.gohandlers_execute.gohandlers_helpers_test.gohandlers_init.gohandlers_init_more_test.gohandlers_test.gohandlers_utils.gohelpers_inline_prompt_test.gohelpers_more_test.goinit_and_trigger_test.goinit_shutdown_test.goinline_prompt_completion_test.goinstruction_table_test.golabel_filter_table_test.gollm_request_opts_test.gollm_stats_test.golog_context_test.gopostprocess_indent_test.goprefix_table_test.goprovider_native_success_test.gorewrite_diagnostics_realism_test.goserver.goserver_test.gotestfakes_test.gotesthelper_capture_llm_test.gotransport.gotransport_concurrency_test.gotransport_test.gotriggers_config_test.gotypes.gostore.gostore_test.godebugstring_test.golock_posix.golock_windows.gostats.gostats_test.go - - - -- cgit v1.2.3