ace-llm 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. checksums.yaml +7 -0
  2. data/.ace-defaults/llm/config.yml +31 -0
  3. data/.ace-defaults/llm/presets/claude/prompt.yml +5 -0
  4. data/.ace-defaults/llm/presets/claude/ro.yml +6 -0
  5. data/.ace-defaults/llm/presets/claude/rw.yml +4 -0
  6. data/.ace-defaults/llm/presets/claude/yolo.yml +3 -0
  7. data/.ace-defaults/llm/presets/codex/ro.yml +5 -0
  8. data/.ace-defaults/llm/presets/codex/rw.yml +3 -0
  9. data/.ace-defaults/llm/presets/codex/yolo.yml +3 -0
  10. data/.ace-defaults/llm/presets/gemini/ro.yml +4 -0
  11. data/.ace-defaults/llm/presets/gemini/rw.yml +4 -0
  12. data/.ace-defaults/llm/presets/gemini/yolo.yml +4 -0
  13. data/.ace-defaults/llm/presets/opencode/ro.yml +1 -0
  14. data/.ace-defaults/llm/presets/opencode/rw.yml +1 -0
  15. data/.ace-defaults/llm/presets/opencode/yolo.yml +3 -0
  16. data/.ace-defaults/llm/presets/pi/ro.yml +1 -0
  17. data/.ace-defaults/llm/presets/pi/rw.yml +1 -0
  18. data/.ace-defaults/llm/presets/pi/yolo.yml +1 -0
  19. data/.ace-defaults/llm/providers/anthropic.yml +34 -0
  20. data/.ace-defaults/llm/providers/google.yml +36 -0
  21. data/.ace-defaults/llm/providers/groq.yml +29 -0
  22. data/.ace-defaults/llm/providers/lmstudio.yml +24 -0
  23. data/.ace-defaults/llm/providers/mistral.yml +33 -0
  24. data/.ace-defaults/llm/providers/openai.yml +33 -0
  25. data/.ace-defaults/llm/providers/openrouter.yml +45 -0
  26. data/.ace-defaults/llm/providers/togetherai.yml +26 -0
  27. data/.ace-defaults/llm/providers/xai.yml +30 -0
  28. data/.ace-defaults/llm/providers/zai.yml +18 -0
  29. data/.ace-defaults/llm/thinking/claude/high.yml +3 -0
  30. data/.ace-defaults/llm/thinking/claude/low.yml +3 -0
  31. data/.ace-defaults/llm/thinking/claude/medium.yml +3 -0
  32. data/.ace-defaults/llm/thinking/claude/xhigh.yml +3 -0
  33. data/.ace-defaults/llm/thinking/codex/high.yml +3 -0
  34. data/.ace-defaults/llm/thinking/codex/low.yml +3 -0
  35. data/.ace-defaults/llm/thinking/codex/medium.yml +3 -0
  36. data/.ace-defaults/llm/thinking/codex/xhigh.yml +3 -0
  37. data/.ace-defaults/nav/protocols/guide-sources/ace-llm.yml +10 -0
  38. data/CHANGELOG.md +641 -0
  39. data/LICENSE +21 -0
  40. data/README.md +42 -0
  41. data/Rakefile +14 -0
  42. data/exe/ace-llm +25 -0
  43. data/handbook/guides/llm-query-tool-reference.g.md +683 -0
  44. data/handbook/templates/agent/plan-mode.template.md +48 -0
  45. data/lib/ace/llm/atoms/env_reader.rb +155 -0
  46. data/lib/ace/llm/atoms/error_classifier.rb +200 -0
  47. data/lib/ace/llm/atoms/http_client.rb +162 -0
  48. data/lib/ace/llm/atoms/provider_config_validator.rb +260 -0
  49. data/lib/ace/llm/atoms/xdg_directory_resolver.rb +189 -0
  50. data/lib/ace/llm/cli/commands/query.rb +280 -0
  51. data/lib/ace/llm/cli.rb +24 -0
  52. data/lib/ace/llm/configuration.rb +180 -0
  53. data/lib/ace/llm/models/fallback_config.rb +216 -0
  54. data/lib/ace/llm/molecules/client_registry.rb +336 -0
  55. data/lib/ace/llm/molecules/config_loader.rb +39 -0
  56. data/lib/ace/llm/molecules/fallback_orchestrator.rb +218 -0
  57. data/lib/ace/llm/molecules/file_io_handler.rb +158 -0
  58. data/lib/ace/llm/molecules/format_handlers.rb +183 -0
  59. data/lib/ace/llm/molecules/llm_alias_resolver.rb +50 -0
  60. data/lib/ace/llm/molecules/openai_compatible_params.rb +21 -0
  61. data/lib/ace/llm/molecules/preset_loader.rb +99 -0
  62. data/lib/ace/llm/molecules/provider_loader.rb +198 -0
  63. data/lib/ace/llm/molecules/provider_model_parser.rb +172 -0
  64. data/lib/ace/llm/molecules/thinking_level_loader.rb +83 -0
  65. data/lib/ace/llm/organisms/anthropic_client.rb +213 -0
  66. data/lib/ace/llm/organisms/base_client.rb +264 -0
  67. data/lib/ace/llm/organisms/google_client.rb +187 -0
  68. data/lib/ace/llm/organisms/groq_client.rb +197 -0
  69. data/lib/ace/llm/organisms/lmstudio_client.rb +146 -0
  70. data/lib/ace/llm/organisms/mistral_client.rb +180 -0
  71. data/lib/ace/llm/organisms/openai_client.rb +195 -0
  72. data/lib/ace/llm/organisms/openrouter_client.rb +216 -0
  73. data/lib/ace/llm/organisms/togetherai_client.rb +184 -0
  74. data/lib/ace/llm/organisms/xai_client.rb +213 -0
  75. data/lib/ace/llm/organisms/zai_client.rb +149 -0
  76. data/lib/ace/llm/query_interface.rb +455 -0
  77. data/lib/ace/llm/version.rb +7 -0
  78. data/lib/ace/llm.rb +61 -0
  79. metadata +318 -0
data/CHANGELOG.md ADDED
@@ -0,0 +1,641 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.30.0] - 2026-03-23
11
+
12
+ ### Added
13
+ - Documented thinking levels (`low`, `medium`, `high`, `xhigh`) for CLI providers (`claude`, `codex`) in README and usage guide.
14
+ - Documented built-in execution presets (`@ro`, `@rw`, `@yolo`) with supported CLI providers in README and usage guide.
15
+ - Added `opus` and `haiku` aliases to the usage guide alias table.
16
+
17
+ ### Fixed
18
+ - Updated stale Anthropic model aliases in `.ace-defaults/llm/providers/anthropic.yml` from Claude 3 IDs to Claude 4.5 (`claude-sonnet-4-5`, `claude-opus-4-5`, `claude-haiku-4-5`).
19
+
20
+ ### Changed
21
+ - Rewrote README intro and Use Cases to highlight aliases, thinking levels, presets, and file-based prompts without repetition.
22
+ - Replaced demo tape with focused queries showing `provider:model`, alias, thinking level, and preset calling patterns.
23
+ - Updated gemspec description to include Gemini CLI and pi-agent.
24
+ - Removed obsolete `docs/migration-from-llm-query.md` (internal-only migration guide for legacy `llm-query` tool).
25
+
26
+ ## [0.29.5] - 2026-03-23
27
+
28
+ ### Changed
29
+ - Refreshed package README layout, quick-link navigation, and section flow to align with the current package pattern.
30
+
31
+ ## [0.29.4] - 2026-03-22
32
+
33
+ ### Changed
34
+ - Replaced placeholder commands in `docs/demo/ace-llm-getting-started.tape.yml` with real `ace-llm` provider-listing and query flow commands.
35
+
36
+ ## [0.29.3] - 2026-03-22
37
+
38
+ ### Technical
39
+ - Clarified release notes to document why the Codex `@yolo` preset intentionally omits `--full-auto` for current CLI compatibility.
40
+
41
+ ## [0.29.2] - 2026-03-22
42
+
43
+ ### Fixed
44
+ - Clarified that the Codex `@yolo` preset omits `--full-auto` because the current Codex CLI rejects it alongside `--dangerously-bypass-approvals-and-sandbox`.
45
+
46
+ ## [0.29.1] - 2026-03-22
47
+
48
+ ### Fixed
49
+ - Clarified the Codex `@yolo` preset docs after changelog drift described `--full-auto` as restored when it is intentionally omitted for CLI compatibility.
50
+
51
+ ## [0.29.0] - 2026-03-22
52
+
53
+ ### Changed
54
+ - Rewrote the package README into a concise landing page and added focused documentation pages for getting started, usage, and handbook guidance.
55
+ - Added a getting-started demo tape for the documented onboarding flow.
56
+ - Updated gemspec summary and description to match the refreshed documentation surface.
57
+
58
+ ## [0.28.0] - 2026-03-21
59
+
60
+ ### Changed
61
+ - Expanded `TS-LLM-001` E2E coverage with a deterministic unknown-provider routing goal and tightened verifier artifact evidence requirements for query and model-selection flows.
62
+
63
+ ## [0.27.1] - 2026-03-18
64
+
65
+ ### Changed
66
+ - Migrated CLI namespace from `Ace::Core::CLI::*` to `Ace::Support::Cli::*` (ace-support-cli is now the canonical home for CLI infrastructure).
67
+
68
+
69
+ ## [0.27.0] - 2026-03-18
70
+
71
+ ### Changed
72
+ - Removed legacy backward-compatibility behavior as part of the 0.10 cleanup release.
73
+
74
+
75
+ ## [0.26.13] - 2026-03-18
76
+
77
+ ### Added
78
+ - Added Claude `@prompt` preset for strict prompt-only execution using verified no-tools mode.
79
+
80
+ ### Changed
81
+ - Updated Claude `@ro` preset to allow `Bash` and `Read` tool access for richer read-only review workflows.
82
+ - Clarified in usage docs that `@prompt` is currently provider-specific and only available where no-tools execution can be enforced.
83
+
84
+ ### Technical
85
+ - Added regression coverage for Claude `@ro` and `@prompt` preset wiring.
86
+
87
+ ## [0.26.12] - 2026-03-18
88
+
89
+ ### Fixed
90
+ - Changed Claude `@ro` preset behavior to disable tools without entering native Claude `plan` mode, preserving read-only execution while avoiding empty-response failures in one-shot JSON output.
91
+ - Suppressed misleading `Total timeout exceeded (...)` status reporting after terminal single-provider failures so the real provider error remains the primary signal.
92
+
93
+ ### Technical
94
+ - Added regression coverage for Claude `@ro` preset wiring and fallback terminal-error timeout reporting.
95
+
96
+ ## [0.26.11] - 2026-03-17
97
+
98
+ ### Fixed
99
+ - Updated default provider context limits: Anthropic from 200K to 1M tokens, OpenAI from 128K to 1.05M tokens to reflect modern model capabilities.
100
+
101
+ ## [0.26.10] - 2026-03-17
102
+
103
+ ### Fixed
104
+ - Resolve global alias inputs (for example `glite`) before provider/model validation so single-token alias-only provider inputs are accepted.
105
+
106
+ ### Technical
107
+ - Fix `StubAliasResolver` test construction to pass hash as positional argument instead of keyword arguments.
108
+
109
+ ## [0.26.8] - 2026-03-17
110
+
111
+ ### Fixed
112
+ - Parse explicit `:high`/`:low`/`:medium`/`:xhigh` thinking suffixes before alias resolution so model aliases with thinking modifiers (for example `codex:gpt:high@ro`) resolve correctly.
113
+
114
+ ## [0.26.7] - 2026-03-17
115
+
116
+ ### Fixed
117
+ - Removed `--sandbox` from Gemini `ro` and `rw` presets; sandbox requires Docker/Podman and is orthogonal to `--approval-mode`.
118
+ - Changed Gemini `rw` preset `--approval-mode` from invalid `auto` to `auto_edit` (valid choices: `default`, `auto_edit`, `yolo`, `plan`).
119
+
120
+ ## [0.26.6] - 2026-03-15
121
+
122
+ ### Changed
123
+ - Migrated CLI framework from dry-cli to ace-support-cli
124
+
125
+ ## [0.26.5] - 2026-03-12
126
+
127
+ ### Added
128
+ - Added `working_dir:` support to `QueryInterface.query` so CLI-backed provider executions can be anchored to an explicit filesystem root.
129
+
130
+ ## [0.26.4] - 2026-03-12
131
+
132
+ ### Changed
133
+ - Updated the handbook LLM reference guide to describe canonical package `handbook/skills/` ownership before provider projections.
134
+
135
+ ### Fixed
136
+ - Restore provider preset defaults under `.ace-defaults/llm/presets/` after the preset refactor dropped `max_tokens: 16000` and rewrote Codex/Gemini sandbox CLI flags; keep the newer 600-second timeout standardization intact.
137
+
138
+ ## [0.26.3] - 2026-03-07
139
+
140
+ ### Changed
141
+ - Improve `--list-providers` output readability: show model count in provider header, wrap long model lists at 78 characters.
142
+
143
+ ## [0.26.2] - 2026-03-07
144
+
145
+ ### Changed
146
+ - Refactor `Configuration#provider` to use `Enumerable#find` for idiomatic Ruby.
147
+ - Use `<<~` HEREDOC for inactive-provider error message in `ProviderModelParser`.
148
+
149
+ ## [0.26.1] - 2026-03-07
150
+
151
+ ### Technical
152
+ - Move `configuration_test.rb` to `test/organisms/` per ADR-017 flat test structure.
153
+
154
+ ## [0.26.0] - 2026-03-07
155
+
156
+ ### Added
157
+ - Added provider allow-list filtering controls through `llm.providers.active` and `ACE_LLM_PROVIDERS_ACTIVE`, including normalization and env override handling.
158
+ - Added configuration and parser tests covering allow-list behavior, env precedence, and inactive-vs-unknown provider classification.
159
+
160
+ ### Changed
161
+ - Updated `ace-llm --list-providers` to show filtered-mode summary and inactive provider section when an allow-list is active.
162
+
163
+ ### Fixed
164
+ - Distinguish inactive providers (configured but filtered out) from unknown providers in query validation errors, with actionable enablement guidance.
165
+
166
+ ## [0.25.1] - 2026-03-06
167
+
168
+ ### Added
169
+ - Support explicit `:low`, `:medium`, `:high`, and `:xhigh` thinking suffixes on fully qualified model targets while preserving existing `@ro`, `@rw`, and `@yolo` preset behavior.
170
+ - Add provider-scoped thinking overlays for Codex and Claude so explicit thinking levels map cleanly to provider-native runtime options.
171
+
172
+ ### Changed
173
+ - Allow `ace-llm query` preset resolution to merge explicit thinking overrides after preset loading and before direct CLI overrides.
174
+
175
+ ## [0.25.0] - 2026-03-05
176
+
177
+ ### Added
178
+ - `last_message_file:` parameter in `QueryInterface.query` to thread last-message file path through to provider clients via `generation_opts`.
179
+
180
+ ## [0.24.8] - 2026-03-04
181
+
182
+ ### Fixed
183
+ - Normalize timeout inputs across `--timeout` flows in CLI query and fallback paths so string values are safely coerced to numeric before use.
184
+
185
+ ## [0.24.7] - 2026-03-04
186
+
187
+ ### Added
188
+ - Plan-mode template at `tmpl://agent/plan-mode` (`ace-llm/handbook/templates/agent/plan-mode.template.md`) for reusable planning-only instruction composition.
189
+
190
+ ### Changed
191
+ - Strengthen plan-mode template contract with explicit required section headings and stricter prohibitions against permission/escalation and status-only outputs.
192
+
193
+ ## [0.24.6] - 2026-02-28
194
+
195
+ ### Fixed
196
+ - Resolve `provider:provider` format (e.g., `codex:codex`) to provider's default model instead of passing literal provider name as model; adds fallback in `ClientRegistry#resolve_alias` when model alias matches provider name
197
+
198
+ ## [0.24.5] - 2026-02-28
199
+
200
+ ### Fixed
201
+ - Thread `--timeout` through fallback path: `FallbackOrchestrator` now accepts and forwards `timeout` to each `registry.get_client()` call, so `--timeout 300` is no longer silently dropped when fallback is enabled
202
+ - Raise `max_tokens` defaults from 4096–8192 to 16384 across all gem providers (anthropic, openai, google, zai, groq, xai, mistral, togetherai, openrouter, lmstudio) and all project-level provider overrides in `.ace/llm/providers/`
203
+
204
+ ## [0.24.4] - 2026-02-27
205
+
206
+ ### Added
207
+ - Per-provider fallback chains: `chains` map in config allows each primary provider to have its own contextual fallback order
208
+ - `FallbackConfig#providers_for(primary)` returns chain-specific fallback list or default `providers`
209
+
210
+ ## [0.24.3] - 2026-02-27
211
+
212
+ ### Technical
213
+ - Document `ZAI_API_KEY` in README API key section
214
+
215
+ ## [0.24.2] - 2026-02-27
216
+
217
+ ### Fixed
218
+ - Add project-level fallback providers so `ace-git-commit` works without `ZAI_API_KEY`
219
+ - Re-add CLI-specific error diagnostics listing available providers when provider not found
220
+ - Tighten "window limit" quota-detection pattern to avoid matching "context window limit"
221
+
222
+ ### Technical
223
+ - Add inline comment documenting per-layer normalization rationale in fallback config loading
224
+
225
+ ## [0.24.1] - 2026-02-27
226
+
227
+ ### Fixed
228
+ - Narrowed quota-detection patterns to avoid false positives on unrelated error messages containing "credit" (e.g., "credentials invalid")
229
+
230
+ ## [0.24.0] - 2026-02-27
231
+
232
+ ### Added
233
+ - Native `zai` API provider with direct HTTP calls and bearer auth (`ZAI_API_KEY`), supporting models `glm-4.7-flashx`, `glm-4.7`, and `glm-5`
234
+ - Centralized `llm.fallback` config in `.ace-defaults/llm/config.yml` for shared fallback policy across QueryInterface and CLI callers
235
+
236
+ ### Fixed
237
+ - Quota/credit/window-limit exhaustion classified as immediate fallback (no retry), while overload/unavailable/rate-limit conditions remain retryable
238
+ - Fallback provider chains normalize and deduplicate entries (including aliases) while preserving order
239
+ - Z.AI provider error surfacing includes actionable HTTP status and non-JSON response snippets
240
+
241
+ ### Changed
242
+ - `ace-llm` CLI query command routes through `Ace::LLM::QueryInterface` for consistent fallback behavior across CLI and Ruby API
243
+ - Fallback documentation updated to use `.ace/llm/config.yml` (`llm.fallback`) as primary configuration contract
244
+
245
+ ## [0.23.1] - 2026-02-23
246
+
247
+ ### Technical
248
+ - Updated internal dependency version constraints to current releases
249
+
250
+ ## [0.23.0] - 2026-02-22
251
+
252
+ ### Changed
253
+ - **Breaking:** Migrated from multi-command Registry to single-command pattern (task 278)
254
+ - Removed `query` subcommand: `ace-llm query gflash "prompt"` → `ace-llm gflash "prompt"`
255
+ - Removed `list-providers` subcommand: `ace-llm list-providers` → `ace-llm --list-providers`
256
+ - Removed `version`/`help` subcommands: use `--version`/`--help` flags only
257
+ - Added `--version` and `--list-providers` flags to main command
258
+ - Updated help text references from `ace-llm-query` to `ace-llm`
259
+ - No backward compatibility (per ADR-024)
260
+
261
+ ## [0.22.6] - 2026-02-22
262
+
263
+ ### Changed
264
+ - Migrated from DefaultRouting to standard help pattern (task 278.21)
265
+ - Removed DWIM default routing to query command
266
+ - Added explicit `query` command requirement
267
+ - Removed `--list-providers` alias (use `list-providers` command)
268
+ - Added HelpCommand registration for `--help`, `-h`, `help`
269
+ - No-args now shows help instead of error
270
+
271
+ ### Technical
272
+ - Updated CLI tests to use explicit `query` command prefix
273
+ - Removed tests for deprecated DefaultRouting behavior
274
+
275
+ ## [0.22.5] - 2026-02-22
276
+
277
+ ### Fixed
278
+ - Pass `backends` configuration from provider YAML to client, fixing ClaudeOaiClient missing env vars (`ANTHROPIC_BASE_URL`, `ANTHROPIC_AUTH_TOKEN`) and model tier mappings
279
+
280
+ ## [0.22.3] - 2026-02-21
281
+
282
+ ### Added
283
+ - `subprocess_env:` parameter on `QueryInterface.query()` for passing environment variables to CLI provider subprocesses
284
+
285
+ ## [0.22.2] - 2026-02-17
286
+
287
+ ### Fixed
288
+ - Added integration coverage to verify `QueryInterface.query(..., sandbox: ...)` forwards sandbox mode into generation options
289
+
290
+ ## [0.22.1] - 2026-02-15
291
+
292
+ ### Added
293
+ - `sandbox:` parameter on `QueryInterface.query()` for controlling CLI provider sandbox mode (forwarded via `generation_opts`)
294
+
295
+ ## [0.22.0] - 2026-02-05
296
+
297
+ ### Added
298
+ - `--cli-args` passthrough for CLI providers, with documentation and integration tests
299
+
300
+ ### Fixed
301
+ - `--timeout` parsing in CLI query command to avoid string timeout errors
302
+
303
+ ## [0.21.1] - 2026-02-04
304
+
305
+ ### Added
306
+ - Provider config now includes `context_limit` field for model context window sizes
307
+ - Google: 1M tokens (Gemini models)
308
+ - Anthropic: 200K tokens (Claude models)
309
+ - OpenAI: 128K tokens (GPT models)
310
+ - Other providers: 128K default
311
+ - Default `context_limit` in main config.yml for unknown models
312
+
313
+ ### Technical
314
+ - Lower Ruby version requirement to >= 3.2.0 across all gemspecs
315
+
316
+ ## [0.21.0] - 2026-01-14
317
+
318
+ ### Added
319
+ - Configuration cascade for provider discovery
320
+ - Provider configs now cascade from gem defaults, project, and user paths
321
+ - Dynamic provider discovery without hardcoding in ace-llm
322
+ - New Configuration class and ConfigLoader molecule
323
+
324
+ ### Changed
325
+ - Removed CLI provider configs from ace-llm gem (.ace-defaults/)
326
+ - Updated ClientRegistry to use Configuration cascade
327
+
328
+ ### Fixed
329
+ - Handle non-JSON xAI API error responses gracefully
330
+ - Improved CLI argument parsing for ambiguous provider/model arguments
331
+
332
+ ## [0.20.2] - 2026-01-13
333
+
334
+ ### Fixed
335
+ - Query command ambiguous argument handling when `--model` doesn't contain colon
336
+ - Added validation to detect when positional arg is not a valid provider
337
+ - Shows help instead of proceeding with invalid provider/model combination
338
+ - Fixed test to use non-alias value ("unknown-model" instead of "grok")
339
+
340
+ ## [0.20.1] - 2026-01-13
341
+
342
+ ### Fixed
343
+ - Handle non-JSON xAI API error responses gracefully (task 205)
344
+ - Guard against String response bodies (e.g., HTML error pages from 502 gateway errors)
345
+ - Include HTTP status code in error messages for better debugging
346
+ - Apply safe pattern from OpenRouter client with explicit StandardError rescue
347
+
348
+ ## [0.20.0] - 2026-01-11
349
+
350
+ ### Changed
351
+ - **BREAKING**: Renamed executable from `ace-llm-query` to `ace-llm` (task 202.01)
352
+ - The gem name remains `ace-llm`
353
+ - The executable is now `ace-llm` (previously `ace-llm-query`)
354
+ - Update scripts and documentation to use `ace-llm` command
355
+ - All functionality remains the same
356
+
357
+ ## [0.19.1] - 2026-01-09
358
+
359
+ ### Changed
360
+ - **BREAKING**: Eliminate wrapper pattern in dry-cli commands
361
+ - Merged business logic directly into `ListProviders` and `Query` dry-cli command classes
362
+ - Deleted `list_providers_command.rb` and `query_command.rb` wrapper files
363
+ - Simplified architecture by removing unnecessary delegation layer
364
+
365
+ ## [0.19.0] - 2026-01-07
366
+
367
+ ### Changed
368
+ - **BREAKING**: Migrated CLI framework from Thor to dry-cli (task 179.13)
369
+ - Replaced `thor` dependency with `dry-cli ~> 1.0`
370
+ - Created dry-cli command classes (query, list_providers)
371
+ - Standardized option type handling (temperature as float)
372
+
373
+ ### Fixed
374
+ - CLI test compatibility with dry-cli capture patterns
375
+ - Default command routing for query command
376
+
377
+ ## [0.18.0] - 2026-01-05
378
+
379
+ ### Added
380
+ - Thor CLI migration with standardized command structure
381
+ - ConfigSummary display for effective configuration with sensitive key filtering
382
+ - Comprehensive CLI help documentation across all commands
383
+ - Routing for list-providers command
384
+
385
+ ### Changed
386
+ - Adopted Ace::Core::CLI::Base for standardized options (--quiet, --verbose, --debug)
387
+ - Migrated from OptionParser to Thor framework
388
+ - Added method_missing for default subcommand support
389
+
390
+ ### Fixed
391
+ - CLI routing and dependency management for feature parity
392
+ - --help dispatch for all ACE commands
393
+ - Addressed PR #123 review findings for Medium and higher priority issues
394
+
395
+ ## [0.17.0] - 2026-01-03
396
+
397
+ ### Changed
398
+ - **BREAKING**: Minimum Ruby version raised to 3.3.0 (was 3.1.0)
399
+ - Standardized gemspec file patterns with deterministic Dir.glob
400
+ - Added MIT LICENSE file
401
+
402
+ ## [0.16.1] - 2025-12-30
403
+
404
+ ### Changed
405
+
406
+ * Add ace-config dependency for configuration cascade management
407
+ * Refactor ClientRegistry to use Ace::Config.create() with deep merge
408
+
409
+ ## [0.16.0] - 2025-12-30
410
+
411
+ ### Changed
412
+
413
+ * Rename `.ace.example/` to `.ace-defaults/` for gem defaults directory
414
+
415
+
416
+ ## [0.15.1] - 2025-12-14
417
+
418
+ ### Changed
419
+ - **Standardized GENERATION_KEYS pattern**: All LLM clients now use declarative constants
420
+ - OpenAIClient, OpenRouterClient, GroqClient, MistralClient, AnthropicClient use `GENERATION_KEYS`
421
+ - GoogleClient uses `GENERATION_KEY_MAPPING` (maps internal keys to Gemini camelCase API keys)
422
+ - XAIClient already used this pattern (model implementation)
423
+ - Replaces inline nil checks with cleaner iteration loop
424
+ - Single point of truth for each client's supported parameters
425
+
426
+ ### Fixed
427
+ - **MistralClient zero-value handling**: Fixed bug where `temperature: 0` was dropped
428
+ - Changed from truthiness checks to nil checks
429
+ - **AnthropicClient zero-value handling**: Fixed bug where `temperature: 0` was dropped
430
+ - Changed from truthiness checks to nil checks
431
+ - **GoogleClient zero-value handling**: Fixed bug where `temperature: 0` was dropped
432
+ - Changed from truthiness checks to nil checks
433
+
434
+ ## [0.15.0] - 2025-12-14
435
+
436
+ ### Added
437
+ - **OpenAICompatibleParams module**: Shared concern for extracting OpenAI-compatible parameters
438
+ - Extracts `frequency_penalty` and `presence_penalty` using nil-safe logic
439
+ - Preserves zero values (uses `nil?` check, not truthiness)
440
+ - Included in XAIClient, OpenAIClient, and OpenRouterClient
441
+ - DRYs up code across OpenAI-compatible providers
442
+
443
+ ### Fixed
444
+ - **OpenAIClient zero-value handling**: Fixed bug where zero-valued penalties were dropped
445
+ - `build_request_body` now uses nil checks for all generation parameters
446
+ - Zero values for `frequency_penalty`, `presence_penalty`, `temperature`, `max_tokens`, `top_p` are preserved
447
+ - **YAML security hardening**: Removed Symbol from `permitted_classes` in `YAML.safe_load`
448
+ - Prevents potential DoS attacks via symbol table exhaustion
449
+ - All provider YAML configs already use string keys (no breaking changes)
450
+ - Added specific `Psych::DisallowedClass` warning for better debugging
451
+
452
+ ### Technical
453
+ - Added comprehensive OpenAIClient test suite (15 new tests)
454
+ - Added zero-value regression tests to XAIClient tests
455
+ - Improved symbol rejection test with warning message assertions
456
+
457
+ ## [0.14.0] - 2025-12-07
458
+
459
+ ### Added
460
+ - **Groq Provider**: New LLM provider for Groq's ultra-fast inference API
461
+ - Supports GPT-OSS 120B/20B, Kimi K2, and Mistral Saba models
462
+ - OpenAI-compatible API with ultra-fast inference
463
+ - Default model: openai/gpt-oss-120b with max_tokens: 4096
464
+ - Global aliases: `groq`, `groq-fast`, `groq-kimi`, `groq-saba`
465
+ - Model aliases: `gpt-oss`, `gpt-oss-120b`, `gpt-oss-20b`, `kimi-k2`, `saba`
466
+ - Environment variable: `GROQ_API_KEY`
467
+ - Supports `stop` sequences parameter
468
+
469
+ ### Fixed
470
+ - **Zero-valued generation params**: Changed from truthiness checks to nil checks
471
+ - Allows `temperature: 0`, `frequency_penalty: 0`, `presence_penalty: 0`
472
+ - Affects GroqClient and ensures consistent behavior with OpenRouterClient
473
+
474
+ ### Changed
475
+ - Stream flag explicitly disabled (streaming not implemented)
476
+ - Parameter extraction refactored to use `Hash#slice` for cleaner code
477
+
478
+ ### Breaking Changes
479
+ None
480
+
481
+ ## [0.13.0] - 2025-12-06
482
+
483
+ ### Added
484
+ - **OpenRouter Provider**: New LLM provider for OpenRouter's unified API (400+ models)
485
+ - OpenAI-compatible API with optional attribution headers (HTTP-Referer, X-Title)
486
+ - Focus: Exclusive providers (DeepSeek, Kimi, Qwen) + fast inference via `:nitro` routing (Groq/Cerebras)
487
+ - Default model: openai/gpt-oss-120b:nitro with temperature: 0.7, max_tokens: 4096
488
+ - Fast inference aliases: `gpt-oss-nitro`, `kimi-nitro`, `qwen3-nitro`, `gpt-oss-small-nitro`
489
+ - Provider aliases: `deepseek`, `deepseek-r1`, `kimi`, `kimi-think`, `qwen-coder`, `qwq`, `hermes`, `glm`, `minimax`, `reka`, `devstral`
490
+ - Environment variable: `OPENROUTER_API_KEY`
491
+ - Handles non-JSON error responses (e.g., HTML from 502 errors)
492
+ - Explicit nil checks for generation params (allows temperature: 0, frequency_penalty: 0)
493
+ - Preserves `native_finish_reason` metadata from OpenRouter
494
+
495
+ ## [0.12.0] - 2025-12-06
496
+
497
+ ### Added
498
+ - **x.ai (Grok) Provider**: New LLM provider for x.ai's Grok models
499
+ - Supports grok-4, grok-4-fast, grok-4-1-fast, grok-code-fast-1, grok-3, grok-3-fast, grok-3-mini, grok-2
500
+ - OpenAI-compatible API with full generation options
501
+ - Default model: grok-4 with max_tokens: 4096
502
+ - Global aliases: `grok` → xai:grok-4, `grokfast` → xai:grok-4-1-fast, `grokcode` → xai:grok-code-fast-1
503
+ - Environment variable: `XAI_API_KEY`
504
+
505
+ ### Changed
506
+ - **Provider Config Migration**: Moved provider configs from `providers/` to `.ace.example/llm/providers/`
507
+ - Eliminates duplication between gem and project configs
508
+ - Example configs now serve as the canonical source
509
+ - **XAIClient**: Uses constant-driven GENERATION_KEYS iteration pattern
510
+ - Explicit `rescue StandardError` instead of bare rescue
511
+
512
+ ## [0.11.0] - 2025-11-17
513
+
514
+ ### Added
515
+ - **Graceful Provider Fallback**: Implemented automatic provider fallback with retry logic
516
+ - Automatic retry with exponential backoff (configurable, default 3 attempts)
517
+ - Intelligent error classification (retryable, skip to next, terminal)
518
+ - Fallback provider chain with configurable alternatives
519
+ - Total timeout protection (default 30s) to prevent infinite retry loops
520
+ - Jitter (10-30%) added to retry delays to prevent thundering herd issues
521
+ - Configurable via environment variables (`ACE_LLM_FALLBACK_*`) and runtime parameters
522
+ - Status callbacks for user visibility during fallback operations
523
+ - Respects Retry-After headers for rate limit compliance
524
+
525
+ ### Changed
526
+ - **Fallback Orchestrator Refactoring**: Improved code organization and maintainability
527
+ - Extracted error handling logic into dedicated `handle_error` method for better separation of concerns
528
+ - Refactored `FallbackConfig.from_hash` with helper method to support both symbol and string keys
529
+ - Enhanced retry delay calculation with jitter to prevent synchronized retry storms
530
+ - Improved test coverage with range-based assertions for jittered delays
531
+
532
+ ### Technical
533
+ - Added comprehensive test coverage for fallback system (atoms, molecules, models, integration)
534
+ - Follows ATOM architecture pattern with clear separation: ErrorClassifier (Atom), FallbackConfig (Model), FallbackOrchestrator (Molecule)
535
+ - Fixed minor style issues (missing newline at end of files)
536
+
537
+ ## [0.10.1] - 2025-11-16
538
+
539
+ ### Changed
540
+
541
+ - **Dependency Update**: Updated ace-support-core dependency from `~> 0.9` to `~> 0.11`
542
+ - Provides access to latest PromptCacheManager features and infrastructure improvements
543
+ - Maintains compatibility with standardized ACE ecosystem patterns
544
+
545
+ ## [0.10.0] - 2025-11-15
546
+
547
+ ### Added
548
+ - **System Prompt Control**: Added `--system-append` flag to ace-llm-query for flexible prompt composition
549
+ - `--system` flag now fully replaces provider defaults (clarified behavior)
550
+ - `--system-append` flag appends to existing/default system prompts
551
+ - Both flags can be used together for layered prompt control
552
+ - Claude provider: Maps to `--system-prompt` and `--append-system-prompt` CLI flags
553
+ - API providers (Anthropic, OpenAI, Google): Concatenates prompts with clear separator
554
+ - **Enhanced Help Text**: Added provider-specific behavior notes to CLI help for system prompt flags
555
+ - Clarifies Claude uses native flags while API providers concatenate
556
+ - Improves user understanding of flag behavior across different providers
557
+
558
+ ### Fixed
559
+ - **Claude Provider Bug**: Fixed ClaudeCodeClient to use correct `--system-prompt` flag instead of non-existent `--system`
560
+ - Resolves issue where system prompts were silently ignored with Claude
561
+ - Enables fast, deterministic responses with Claude Haiku for tools like ace-git-commit
562
+
563
+ ### Changed
564
+ - **Code Organization**: Improved BaseClient helper method encapsulation
565
+ - Made helper methods (`concatenate_system_prompts`, `process_messages_with_system_append`, `deep_copy_messages`) private
566
+ - Relocated test file from `test/integration/` to `test/organisms/base_client_helpers_test.rb`
567
+ - Aligns with ACE flat test structure (tests are unit tests for organism helpers)
568
+ - **Configuration**: Made system prompt separator configurable via `DEFAULT_SYSTEM_PROMPT_SEPARATOR` constant
569
+ - Addresses potential markdown conflicts in concatenated prompts
570
+ - Can be overridden by subclasses if needed
571
+ - **Improved System Prompt Handling**: Refactored implementation with shared helpers
572
+ - Extracted concatenation logic to reduce code duplication
573
+ - Added safety checks and comprehensive test coverage (13 new tests)
574
+ - Implemented deep copy pattern to prevent message mutations
575
+
576
+ ### Technical
577
+ - Added deprecation note for `append_system_prompt` option, prefer `system_append` for consistency
578
+
579
+ ## [0.9.5] - 2025-11-01
580
+
581
+ ### Changed
582
+
583
+ - **Dependency Migration**: Updated to use renamed infrastructure gems
584
+ - Changed dependency from `ace-core` to `ace-support-core`
585
+ - Part of ecosystem-wide naming convention alignment for infrastructure gems
586
+
587
+ ## [0.9.4]
588
+ - 2025-10-08
589
+
590
+ ### Changed
591
+
592
+ - **Test Structure Reorganization**: Reorganized tests for consistency
593
+ - Moved `test/ace/llm_test.rb` → `test/llm_test.rb`
594
+ - Moved `test/client_registry_test.rb` → `test/molecules/`
595
+ - Moved `test/provider_config_validator_test.rb` → `test/atoms/`
596
+ - Fixed require paths to match new structure
597
+ - Aligns with standardized flat ATOM structure across all ACE packages
598
+
599
+ ## [0.9.3] - 2025-10-07
600
+
601
+ ### Changed
602
+ - **Test maintainability improvement**: Version tests now validate semantic versioning format instead of exact version values
603
+ - Prevents test failures on every version bump
604
+ - Uses regex pattern `/\A\d+\.\d+\.\d+/` to validate version format
605
+
606
+ ## [0.9.2] - 2025-10-07
607
+
608
+ ### Fixed
609
+ - Standardized test file naming to follow project convention (`*_test.rb` suffix instead of `test_*` prefix)
610
+ - Renamed `test_provider_config_validator.rb` → `provider_config_validator_test.rb`
611
+ - Renamed `test_client_registry.rb` → `client_registry_test.rb`
612
+ - Test count increased from 25 to 53 tests (all tests now properly discovered)
613
+
614
+ ## [0.9.1] - 2025-10-07
615
+
616
+ ### Added
617
+ - `--model MODEL` flag for flexible LLM model specification in ace-llm-query CLI
618
+ - Model resolution with priority: flag > positional > provider default
619
+ - Dual syntax support: `PROVIDER[:MODEL]` and `PROVIDER --model MODEL`
620
+ - `model:` parameter to `QueryInterface.query()` Ruby API for programmatic model override
621
+
622
+ ### Changed
623
+ - CLI help banner updated to show both syntax options
624
+ - README.md updated with `--model` flag documentation and examples
625
+
626
+ ## [0.9.0] - 2024-XX-XX
627
+
628
+ ### Added
629
+ - Initial release with LLM provider integration
630
+ - Unified CLI interface for querying multiple LLM providers
631
+ - Support for Google Gemini, OpenAI, Anthropic, Mistral, Together AI, and LM Studio
632
+ - Configuration-based provider architecture with YAML support
633
+ - LLM alias resolution for quick access to models
634
+ - Cost tracking and output formatting
635
+ - ATOM architecture pattern (Atoms, Molecules, Organisms, Commands)
636
+
637
+
638
+ ## [0.22.4] - 2026-02-22
639
+
640
+ ### Fixed
641
+ - Standardized quiet, verbose, debug option descriptions to canonical strings
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Michal Czyz
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.