summaryrefslogtreecommitdiff
path: root/internal/hexailsp
AgeCommit message (Collapse)Author
2026-04-26feat: default to Ollama Cloud (kimi-k2.6) when no provider configuredPaul Buetow
Switches the in-code defaults so that hexai talks to Ollama Cloud (https://ollama.com) with model kimi-k2.6 when no provider is configured, instead of OpenAI. The example config, README, and configuration guide all reflect the new recommended setup; previous OpenAI / local-Ollama options are still documented as alternatives. Tests that depended on the implicit "openai" default now pin the provider explicitly so they continue to exercise the OpenAI / gpt-5 code paths they were designed to cover. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-03-23chore: bump version to v0.25.9v0.25.9Paul Buetow
Code quality fixes from audit: - Log silently discarded errors in status sinks and stats.Update call sites - Fix json.Marshal errors silently ignored in LSP handlers - Replace time.Sleep in tests with channel signaling (mcp) and fake clock (stats) - Make context cancellation work in production time.Sleep sites (handlers_document, cmdentry) - Remove init()-based provider registration from llm package; use explicit RegisterAllProviders() - Add WaitGroup goroutine tracking to MCP server Run() Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-19Inject runner dependencies across CLI, action, and LSPPaul Buetow
2026-03-17Fix bugs, remove duplication, and clean up code quality issuesPaul Buetow
- Log swallowed JSON unmarshal errors in stats and LSP handlers - Fix debug log file handle leak in tmuxedit (return closer from initDebugLog) - Check f.Close() errors on write paths in promptstore and tmuxedit - Fix cacheGet TOCTOU race by using single write lock - Fix readInput to use passed stdin reader instead of os.Stdin.Stat() - Remove 45 'moved to' comment tombstones from lsp/handlers.go - Deduplicate canonicalProvider wrappers (use llmutils.CanonicalProvider directly) - Remove SetWindow side effect from stats.TakeSnapshot (pure read now) - Move duplicated splitLines to textutil.SplitLinesBytes - Collapse StatusSink.SetGlobal 10 params into GlobalStatus struct - Simplify LRU touchLocked to in-place delete-and-append Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16Replace Summary: prefixes with standard Go package doc commentsPaul Buetow
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16Add doc comments to exported types and functionsPaul Buetow
Document ~30 exported types in lsp/types.go and exported functions in llm/provider.go, lsp/server.go, and hexailsp/run.go. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16Decompose App God struct into embedded section structsPaul Buetow
Replace 60+ flat fields in App with 4 embedded section structs: CoreConfig, ProviderConfig, PromptConfig, FeatureConfig. Go field promotion preserves all existing field access patterns. Updated flattenAppConfig to recurse into embedded structs for runtimeconfig. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02lsp: inject StatusSink to decouple core from tmux package (task 407)Paul Buetow
2026-03-02hexailsp: add ConfigurableServerRunner for runtime ApplyOptions (task 408)Paul Buetow
2026-03-02lsp: simplify ServerOptions to config-first model (task 410)Paul Buetow
2026-03-02lsp: return cleanly on exit and propagate runner errors (task 410)Paul Buetow
2026-03-02llmutils: centralize provider normalization and client setup (task 410)Paul Buetow
2026-02-12Rename hexai-lsp command to hexai-lsp-serverPaul Buetow
Amp-Thread-ID: https://ampcode.com/threads/T-019c50bc-2906-77db-a31e-0d553338d99b Co-authored-by: Amp <amp@ampcode.com>
2026-02-08add gitignore-aware file filtering for LSP completions and code actionsPaul Buetow
Files matching .gitignore patterns or user-configured extra patterns are now skipped for completions and code actions. Configurable via [ignore] section in config.toml with gitignore, extra_patterns, and lsp_notify_ignored options. Includes hot-reload support and env var overrides (HEXAI_IGNORE_*). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06Remove GitHub Copilot provider supportpaul@buetow.org
Remove all GitHub Copilot integration from the codebase to streamline the supported provider set to OpenAI, OpenRouter, Anthropic, and Ollama. Changes: - Delete core Copilot implementation (copilot.go) and all related tests - Remove Copilot configuration fields from App struct and Config - Remove Copilot from provider factory and API key handling - Update all test files to replace Copilot references with other providers - Remove Copilot documentation from README, configuration guide, and examples - Remove Copilot section from config.toml.example All tests pass successfully after removal. Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-01fix: pass RequestTimeout to all llm.Config instancesFlorian
Add RequestTimeout field to llm.Config construction in: - internal/hexailsp/run.go (buildClientIfNil) - internal/llmutils/client.go (NewClientFromApp) - internal/lsp/server.go (newClientForProvider) This ensures the configured timeout is used in all code paths, not just the ones already updated.
2026-01-30feat: add completion_wait_all config and fix Anthropic system messagesPaul Buetow
- Add completion_wait_all config option (default true) to wait for all backends before returning results, or return first result immediately - Fix Anthropic API: extract system messages to top-level system field as required by Messages API (was causing 400 errors) - Add anthropic case to server.go clientFor() for model overrides
2026-01-29feat: add native Anthropic API provider supportPaul Buetow
- Implement new anthropicClient with full Client interface - Add Streamer interface for token-by-token streaming via SSE - Add Anthropic Messages API v1 integration with proper headers - Support claude-3-5-sonnet-20241022 as default model - Add configuration via [anthropic] TOML section - Add environment variable overrides (HEXAI_ANTHROPIC_*) - Support both HEXAI_ANTHROPIC_API_KEY and ANTHROPIC_API_KEY fallback - Integrate Anthropic key handling in LSP, CLI, and llmutils - Update provider factory to support 'anthropic' provider name - Add 11 comprehensive unit tests for Anthropic client - Update config.toml.example with [anthropic] section - Update NewFromConfig() signature to accept anthropicAPIKey parameter - All 51 internal LLM tests pass (11 new Anthropic tests + 40 existing) Anthropic models can be accessed via: [anthropic] model = "claude-3-5-sonnet-20241022" base_url = "https://api.anthropic.com/v1" temperature = 0.2 or environment: export HEXAI_PROVIDER="anthropic" export HEXAI_ANTHROPIC_API_KEY="your-key" Amp-Thread-ID: https://ampcode.com/threads/T-019c0af1-f215-72cf-9940-b014b1a9576b Co-authored-by: Amp <amp@ampcode.com>
2025-11-02some linter fixesPaul Buetow
2025-10-02feat: add OpenRouter providerv0.15.0Paul Buetow
2025-09-28Propagate --config overrides through CLI tools and LSP reloadsPaul Buetow
2025-09-28Add --config flag support across CLI, LSP, and tmux toolsPaul Buetow
2025-09-24Add runtime config store and reload commandPaul Buetow
2025-09-17feat(stats,tmux): global Σ@window stats across processes with flocked ↵Paul Buetow
cache; width mitigation (narrow/maxlen); configurable [stats] window_minutes; robust coverage parsing; docs update\n\n- Add internal/stats with windowed event cache + flock + atomic writes\n- Wire stats into LSP/CLI/Tmux Action; tmux shows Σ@window with per-model tail\n- HEXAI_TMUX_STATUS_NARROW and HEXAI_TMUX_STATUS_MAXLEN for width control\n- Add [stats] window_minutes to config and apply on startup\n- Improve Magefile coverage handling; add tests to lift coverage >85%\n- Update docs/tmux.md and config example
2025-09-14release: v0.10.0v0.10.0Paul Buetow
2025-09-08docs: move tmux documentation to its own filePaul Buetow
2025-09-07feat: add 'Simplify and improve' action; configurable prompts in config; ↵Paul Buetow
wire into LSP and TUI
2025-09-06more testsPaul Buetow
2025-09-06fix unit test coveragePaul Buetow
2025-09-06chore(version): bump to 0.6.0; configurable prompts via config + testsv0.6.0Paul Buetow
2025-09-06use gofumptPaul Buetow
2025-09-06feat(lsp): configurable inline/chat triggers; switch inline markers to ↵Paul Buetow
>text>/>>text>; update docs and example config; tests updated to new triggers and raise LSP coverage to >=85%; chore: remove semicolon legacy; chore(mage): auto-refresh coverage daily if docs/coverage.out is older than 24h
2025-09-03Phase 2: add configurable completion debounce\n\n- App config: ↵Paul Buetow
completion_debounce_ms (default 200)\n- Server: wait until no input for debounce before LLM calls\n- Applies to chat and provider-native completion paths\n- Tests: add debounce and adjust to verify behavior\n\nAll unit tests pass.
2025-08-31module: set module path to codeberg.org/snonux/hexai; update imports; docs: ↵v0.3.4Paul Buetow
add go install instructions
2025-08-22stuffPaul Buetow
2025-08-19config: apply HEXAI_* env even without config file; docs: clarify Copilot ↵Paul Buetow
key; prefer HEXAI_COPILOT_API_KEY in builders
2025-08-19config: add HEXAI_* env overrides with precedence; prefer ↵Paul Buetow
HEXAI_OPENAI_API_KEY over OPENAI_API_KEY; update docs
2025-08-19lsp: replace time throttle with in-flight guard; improve short-prefix ↵Paul Buetow
heuristic\n\n- Prevent overlapping LLM requests via llmBusy guard\n- Remove time-based throttle and option plumbing\n- Short-prefix heuristic now skips over trailing whitespace and clamps index\n- Add tests for busy guard and trailing-space allowance
2025-08-19lsp: reduce eager completions and add throttling\n\n- Defaults: remove ';' ↵Paul Buetow
and '?' from trigger characters\n- Add min-typed-prefix heuristic for LLM completions (>=2 chars)\n- Add simple time-based throttle between LLM completions (default 900ms)\n- Tests: verify default triggers and skip logic (throttle + min prefix)\n- Config example: update trigger_characters list
2025-08-18refactor(lsp,llm,hexailsp,appconfig): split long funcs; add testsPaul Buetow
- Extract helpers to keep funcs <=50 lines; no behavior changes - Add tests for prompt removal, code actions, and LLM request builders - Table-drive TestInParamList; run gofmt
2025-08-18feat(lsp): add coding_temperature knob and remove hardcoded temps\n\n- Add ↵Paul Buetow
to app config and server options.\n- Use in LSP code actions and completions.\n- Default to provider temperature when not set.\n- Update README and config.json.example.
2025-08-18feat(config): per-provider temperature defaults and docs\n\n- Add , , to ↵Paul Buetow
config with coding-friendly default 0.2.\n- Wire defaults through providers (OpenAI, Copilot, Ollama).\n- Update CLI and LSP runners to pass configured temperatures.\n- Document temperature behavior and examples in README.\n- Update config.json.example to show new keys.
2025-08-17refactor as per manual code reviewsPaul Buetow
2025-08-17refactor: Remove unused NoDiskIO flagPaul Buetow
This flag was not used anywhere in the codebase, so it has been removed.
2025-08-17feat: Support XDG config homePaul Buetow
This change implements support for the XDG Base Directory Specification for the configuration file. The configuration file is now read from `$XDG_CONFIG_HOME/hexai/config.json` if the `XDG_CONFIG_HOME` environment variable is set. If it is not set, it falls back to the previous location, `$HOME/.config/hexai/config.json`. This change also includes: - A fix for a bug in the test suite where a test was failing due to an environment variable being set. - Updates to the documentation to reflect the new configuration file location. - A version bump to 0.1.0.
2025-08-17cli+lsp: refactor main packages into internal runners; add testsPaul Buetow
- Move CLI logic to internal/hexaicli with Run/RunWithClient - Move LSP logic to internal/hexailsp with Run/RunWithFactory - Extract helpers; keep behavior identical for both binaries - Add unit tests for hexaicli (input parsing, messages, streaming) and hexailsp (factory wiring, client creation, logging settings) - Add top-of-file summaries and 'Not yet reviewed by a human' comments to all Go files - Update README with internal package docs