| Age | Commit message (Collapse) | Author |
|
Replace time.After with time.NewTimer + defer timer.Stop() to prevent
a leaked goroutine when the context is cancelled before the timer fires.
|
|
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>
|
|
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>
|
|
- lsp/handlers_completion.go: extract buildNativeCompletionCacheKey and
postProcessNativeCompletion; track collectFirstCompletion in inflight;
remove redundant logLLMStats("") on error path
- lsp/handlers.go: extract checkTriggerFromContext and
checkTriggerFromCursorChar; isTriggerEvent reduced from 63→10 lines
- lsp/transport.go: use %w for error wrapping in Content-Length parse
- llm/ollama.go: extract parseOllamaStream; ChatStream reduced to ~35 lines
- appconfig/config_load.go: extract decodeModelEntryFromMap; rename 'any'
to 'found'; decodeModelEntry reduced to ~18 lines
- llm/provider.go: document why providerRegistry is package-level
- integrationtests/ask_test.go: add //go:build integration; move repoRoot
init from init() to TestMain with diagnostic message
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
- lsp/handlers_completion.go: track collectFirstCompletion goroutine in
inflight WaitGroup (goroutine leak fix)
- lsp/transport.go: use %w instead of %v for error wrapping
- askcli/command_list.go: extract handleListWithFilters shared helper;
handleList/handleAll/handleReady are now single-liners
- askcli/command_list.go, urgency.go, dep.go: log ParseTaskExport errors
to stderr instead of returning 1 silently
- appconfig/config_load.go: rename 'any' variable to 'found' to avoid
shadowing the built-in identifier
- llm/provider.go: add explanatory comment for package-level registry
- integrationtests/ask_test.go: add //go:build integration tag; move
repoRoot init from init() to TestMain with diagnostic error message
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
- lsp/server.go: track request goroutines in inflight WaitGroup to
prevent use-after-close writes on shutdown
- lsp/llm_client_registry.go: acquire write lock before calling build()
to eliminate TOCTOU race on cache population
- lsp/handlers_codeaction.go: resolveSimplifyCodeAction now uses
PromptCodeActionSimplify{System,User} (was wrongly using rewrite prompts)
- askcli/taskexport.go: remove exported MustParseTaskExport to prevent
panic on malformed external input; move to unexported test helper
- cmd/ask/main.go: print error to stderr before os.Exit
- llm/{openai,ollama,openrouter}.go: add interface satisfaction assertions
- integrationtests/ask_test.go: replace type assertions with errors.As
for robust exec.ExitError unwrapping
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
|
|
- 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>
|
|
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Adds utf16OffsetToByteOffset helper to correctly convert LSP character
positions (UTF-16 code units) to Go string byte offsets. Fixes trigger
detection, prefix heuristic, and completion text slicing for files
containing multi-byte characters.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
- Add doc comments clarifying Server.mu and completionState.stateMu are
independent (no ordering constraint).
- Fix test using wrong lock (s.mu instead of stateMu) for lastLLMCall.
- Replace time.Sleep polling in 7 tests with s.inflight.Wait() to
eliminate data races under -race.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Centralizes the provider+model map traversal and window-minutes guard
that was duplicated in hexaiaction, hexaicli, and lsp.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Adds inflight WaitGroup to Server and wraps inline-prompt,
chat-response, and deferShowDocument goroutines. Run() waits
for all in-flight work before returning.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Eliminates identical temperature resolution logic duplicated in
hexaiaction, hexaicli, and lsp packages.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
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>
|
|
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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>
|
|
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>
|
|
- Add Anthropic field merging in config.mergeProviderFields() to properly load AnthropicModel/BaseURL/Temperature from config.toml
- Add anthropic and openrouter cases in lsp.resolveDefaultModel() to prevent fallback to OpenAI defaults
- Update default Anthropic model to valid claude-3-5-sonnet-20240620 (previous 20241022 doesn't exist)
- Update test expectation to match new default model
This fixes the issue where Anthropic provider configuration was ignored, causing LSP to return dummy completions instead of real LLM responses.
Co-authored-by: Cursor <cursoragent@cursor.com>
|
|
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.
|
|
- 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
|
|
- 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>
|
|
|
|
|