aia 2.0.0 → 2.1.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +99 -56
- data/README.md +64 -19
- data/lib/aia/config/cli_parser.rb +3 -2
- data/lib/aia/config/defaults.yml +6 -1
- data/lib/aia/config/model_spec.rb +14 -5
- data/lib/aia/config.rb +14 -5
- data/lib/aia/delegate_handler.rb +3 -0
- data/lib/aia/errors.rb +4 -0
- data/lib/aia/llm_error_collector.rb +67 -0
- data/lib/aia/logger.rb +4 -1
- data/lib/aia/patches/mcp_stdio_stderr.rb +102 -0
- data/lib/aia/pipeline_orchestrator.rb +56 -6
- data/lib/aia/prompt_handler.rb +24 -0
- data/lib/aia/provider_registry.rb +58 -7
- data/lib/aia/robot_factory.rb +54 -1
- data/lib/aia/special_mode_handler.rb +0 -2
- data/lib/aia/tools/delegate_to_foreman_tool.rb +2 -0
- data/lib/aia/version.rb +1 -9
- data/lib/aia.rb +14 -5
- metadata +34 -15
- data/.version +0 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1d7d1dff13dc9c4e4558c4624bf6368cb32f42a4a4896238e1750e5beaa24d7b
|
|
4
|
+
data.tar.gz: e430f69d905314342a538d063b5123dd5fd454dabcd6bae08a2ad3d696d74d56
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b136ae2840a452e8aa5dae4585588036ea10420abbd071c5fd3b45e0fea86a2f6c35005680757e8c2ebde9a63d8a6abf3538a164446c03cc1300aafd41a97728
|
|
7
|
+
data.tar.gz: 06c4e7081bdfe6c618bb4dc868d37daf232c491d04319bf8426232b85442a94eb279b04cba69e3e456d7580d51bdaede5d761367f9331f481387c15432506df4
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,49 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [2.
|
|
3
|
+
## [2.1.0] - 2026-11-07
|
|
4
|
+
|
|
5
|
+
Coding-agent CLIs (Claude Code, Codex, GitHub Copilot) can be used as models, and a prompt file can ask for a special mode such as `debate` in its front matter. Batch runs now exit 1 when an LLM call fails. The unit test suite runs without API keys, a UTF-8 locale or a particular Ruby patch level, and every test file runs on its own.
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- **Coding agents as models.** `--model claude_code/opus`, `codex/default` or `copilot/auto` sends prompts to the Claude Code, Codex or GitHub Copilot CLI in batch mode (stdin in, JSON out) through the `ruby_llm-providers-claude_code`, `-codex` and `-copilot` gems, which resume the agent's own session between turns. A bare provider name (`--model claude_code`) now means that provider's default model. Providers that answer `accepts_tools?` with `false` get no aia tools or MCP servers attached, with a one-line notice. An installed provider gem is found and loaded even when aia itself runs under Bundler (a `bin/aia` checkout, or an app that lists aia in its Gemfile) and the gem is not in that Gemfile, provided the bundle already satisfies the gem's dependencies.
|
|
10
|
+
|
|
11
|
+
- **`mode:` front matter key.** A prompt file can ask for one of the special modes that the chat directives `/debate`, `/verify`, `/decompose`, `/delegate`, `/spawn`, `/orchestrate` and `/concurrent` request, by naming it in its front matter: `mode: debate`. Prompts run from the command line, in a pipeline or as executable prompts then get that mode, which until now ran only in chat; a `/debate` line inside a prompt file was sent to the model as text. As in chat, a debate needs several robots (`--model a,b,c`).
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- **`--provider` outranks `AIA_MODEL` and the config file.** `--provider claude_code` replaced the provider only of models given without a `<provider>/` prefix, so with `AIA_MODEL=lms/qwen3.8` exported the flag did nothing and the prompt still went to LM Studio. A command-line `--provider` now applies to every model that came from the environment or a config file, prefix or not, keeping their model names; it sets the provider, never the model, so `--model claude_code` (a bare provider name) remains the way to ask for a provider's default model. Models named on the command line with `--model` keep an explicit prefix, since both values come from the same place. When a provider gem cannot be loaded because aia is running under Bundler, the warning now names the Gemfile to add the `ruby_llm-providers-<slug>` gem to.
|
|
16
|
+
|
|
17
|
+
- **Batch runs exit 1 on LLM errors.** robot_lab shields a robot's exception into an `Error: ...` reply so one failing robot cannot crash a network, which left `aia prompt` printing a bad API key, rate limit or provider outage as the answer and exiting 0. A hook now records the real exception for each pipeline step: outside chat the step fails, the error goes to stderr and aia exits 1; in a chat session the error is shown and the session continues. Unshielded RubyLLM errors (image generation, provider setup) exit 1 with a one-line message instead of a backtrace.
|
|
18
|
+
|
|
19
|
+
- **`--paint` works again, and `--image_quality` / `--image_style` reach the API.** Since 2.0.0 the image step handed `RubyLLM.paint` a `params:` keyword that ruby_llm 2.1 does not have, so every `--paint` run stopped with `ArgumentError: unknown keyword: :params` before any request was made. The options now go through `provider_options:`, which ruby_llm merges into the request, so `--image_quality hd --image_style vivid` take effect (#135).
|
|
20
|
+
|
|
21
|
+
- **`DelegateHandler` and `DelegateToForemanTool` load what they use.** `delegate_handler.rb` now requires `TaskDecomposer` and `TaskExecutor`, and `delegate_to_foreman_tool.rb` requires `TaskBoardTool`. Each worked only because its one caller also required those files, so loading either on its own and calling it raised `uninitialized constant`.
|
|
22
|
+
|
|
23
|
+
**Test suite**
|
|
24
|
+
|
|
25
|
+
- **Failing test runs exit non-zero.** `test_helper.rb`'s `exit` override, which stops aia's exit calls from ending a test run early, also swallowed Minitest's exit status, so `rake test` and single test files exited 0 when tests failed. The override now stands down after the suite runs.
|
|
26
|
+
|
|
27
|
+
- **Test suite loads on Ruby 4.1.** `ostruct` is a bundled gem since Ruby 4.0 and only reached the test bundle as a transitive dependency of `oj` 3.17.7; `oj` 3.17.8 dropped it, so `bundle update` left the suite unable to load `OpenStruct`. It is now a development dependency. The speech player test no longer stubs `ENV`, which Ruby 4.1 rejects as a shareable object.
|
|
28
|
+
|
|
29
|
+
- **Unit suite passes without API keys or a UTF-8 locale.** The network-building tests create real RubyLLM chats, which ruby_llm 2.1 refuses without a provider API key, so 37 tests errored unless `OPENAI_API_KEY` was set. They now skip that credential check; they never call an API. The gemspec version test errored under a non-UTF-8 locale; it now loads the gemspec and compares its version with `AIA::VERSION`. `test_helper.rb` requires `ostruct`, so test files that use `OpenStruct` also run on their own.
|
|
30
|
+
|
|
31
|
+
- **Every unit test file runs on its own.** Six files raised `uninitialized constant` when run alone, because aia loads a class each one uses lazily: `TaskDecomposer`, `TaskExecutor`, `TaskBoardTool` (one file each) and `ToolFilter::TFIDF` (three files). Each file now requires that class.
|
|
32
|
+
|
|
33
|
+
- **`ConfigTest` ignores the shell's `AIA_PLUGINS_DIR`.** The test that checks `paths.plugins_dir` defaults to `nil` read whatever the developer's shell had exported and failed, and the two tests that set the variable deleted it afterwards. All three now set the variable for their own run and restore it.
|
|
34
|
+
|
|
35
|
+
## [2.0.1] - 2026-11-02
|
|
36
|
+
|
|
37
|
+
### Fixed
|
|
38
|
+
|
|
39
|
+
- **`--chat` startup output is readable again.** ruby_llm 2.1 starts stdio MCP servers with their stderr connected to aia's, so server banners, npm notices, stack traces and validation dumps were printed over the "Connecting MCP servers" spinner and garbled it. That stderr now goes to `~/.config/aia/logs/mcp_servers.log`. Set `logger.mcp.server_stderr` to another path, `STDERR` (the 2.0.0 behavior) or `null` to discard it.
|
|
40
|
+
|
|
41
|
+
### Changed
|
|
42
|
+
|
|
43
|
+
- `logger.mcp.file` defaults to `~/.config/aia/logs/mcp.log` (was `STDOUT`), so MCP connection warnings no longer print over the spinner. Failed servers are still listed in the startup banner. A config file that sets `file: STDOUT` keeps the old behavior.
|
|
44
|
+
- Log directories are created when they don't exist.
|
|
45
|
+
|
|
46
|
+
## [2.0.0] - 2026-11-02
|
|
4
47
|
|
|
5
48
|
AIA 2.0 rebuilds the CLI on [robot_lab](https://github.com/MadBomber/robot_lab): every session is a crew of robots, MCP servers come from ruby_llm 2.1's built-in client, and any provider RubyLLM registers can be used. This entry summarizes everything since 1.1.1, the last 1.x release, including the `2.0.0.pre.alpha` and `2.0.0.pre.beta2` pre-releases.
|
|
6
49
|
|
|
@@ -425,7 +468,7 @@ If you used a 2.0 pre-release: the KBS rule engine, `/rules`, user-defined rule
|
|
|
425
468
|
- Added `handle_tool_crash` method that logs errors with 5-line traceback
|
|
426
469
|
- Tool crashes no longer crash AIA - conversation continues gracefully
|
|
427
470
|
|
|
428
|
-
## [0.9.24] 2025-12-17
|
|
471
|
+
## [0.9.24] - 2025-12-17
|
|
429
472
|
### Fixes
|
|
430
473
|
- Ran into a problem with the `shared_tools` gem and the --require parameter of AIA which required changes to both gems.
|
|
431
474
|
|
|
@@ -450,7 +493,7 @@ If you used a 2.0 pre-release: the KBS rule engine, `/rules`, user-defined rule
|
|
|
450
493
|
- Added `handle_tool_crash` method for graceful error handling
|
|
451
494
|
- Removed debug statements
|
|
452
495
|
|
|
453
|
-
## [0.9.23] 2025-12-06
|
|
496
|
+
## [0.9.23] - 2025-12-06
|
|
454
497
|
|
|
455
498
|
### New Features
|
|
456
499
|
- **MCP Server Configuration**: Added native support for defining MCP (Model Context Protocol) servers in the config file
|
|
@@ -483,7 +526,7 @@ If you used a 2.0 pre-release: the KBS rule engine, `/rules`, user-defined rule
|
|
|
483
526
|
MY_VAR: "value"
|
|
484
527
|
```
|
|
485
528
|
|
|
486
|
-
## [0.9.22] 2025-11-12
|
|
529
|
+
## [0.9.22] - 2025-11-12
|
|
487
530
|
|
|
488
531
|
### Bug Fixes
|
|
489
532
|
- **TEST SUITE**: Fixed all Mocha test isolation issues causing stub contamination between tests
|
|
@@ -499,14 +542,14 @@ If you used a 2.0 pre-release: the KBS rule engine, `/rules`, user-defined rule
|
|
|
499
542
|
- Standardized stub usage pattern across test suite for consistency
|
|
500
543
|
- Eliminated stub leakage that caused "unexpected invocation" and "AIA was instantiated in one test but receiving invocations in another" errors
|
|
501
544
|
|
|
502
|
-
## [0.9.21] 2025-10-08
|
|
545
|
+
## [0.9.21] - 2025-10-08
|
|
503
546
|
### Bug Fixes
|
|
504
547
|
- **Checkpoint Directive Output**: Fixed `//checkpoint` directive to return empty string instead of status message (lib/aia/directives/configuration.rb:155)
|
|
505
548
|
- Prevents checkpoint creation messages from entering AI context
|
|
506
549
|
- Outputs confirmation to STDOUT instead for user feedback
|
|
507
550
|
- Prevents potential AI manipulation of checkpoint system
|
|
508
551
|
|
|
509
|
-
## [0.9.20] 2025-10-06
|
|
552
|
+
## [0.9.20] - 2025-10-06
|
|
510
553
|
### Added
|
|
511
554
|
- **Enhanced Multi-Model Role System (ADR-005)**: Implemented per-model role assignment with inline syntax
|
|
512
555
|
- New inline syntax: `--model MODEL[=ROLE][,MODEL[=ROLE]]...`
|
|
@@ -570,7 +613,7 @@ If you used a 2.0 pre-release: the KBS rule engine, `/rules`, user-defined rule
|
|
|
570
613
|
- Enhanced `apply_file_config_to_struct` to detect and process model arrays with role hashes
|
|
571
614
|
- Enhanced `envar_options` to parse inline syntax for `:model` key (lib/aia/config/base.rb:212-217)
|
|
572
615
|
|
|
573
|
-
## [0.9.19] 2025-10-06
|
|
616
|
+
## [0.9.19] - 2025-10-06
|
|
574
617
|
|
|
575
618
|
### Bug Fixes
|
|
576
619
|
- **CRITICAL BUG FIX**: Fixed multi-model cross-talk issue (#118) where models could see each other's conversation history
|
|
@@ -633,7 +676,7 @@ bin/aia --chat --model lms/openai/gpt-oss-20b,ollama/gpt-oss:20b --tokens
|
|
|
633
676
|
# (Previously: LMS would say "5 times", Ollama "6 times" due to cross-talk)
|
|
634
677
|
```
|
|
635
678
|
|
|
636
|
-
## [0.9.18] 2025-10-05
|
|
679
|
+
## [0.9.18] - 2025-10-05
|
|
637
680
|
|
|
638
681
|
### Bug Fixes
|
|
639
682
|
- **BUG FIX**: Fixed RubyLLM provider error parsing to handle both OpenAI and LM Studio error formats
|
|
@@ -652,7 +695,7 @@ bin/aia --chat --model lms/openai/gpt-oss-20b,ollama/gpt-oss:20b --tokens
|
|
|
652
695
|
- Cleaned up debug puts statements from RubyLLMAdapter and provider_fix
|
|
653
696
|
- Added robust JSON parsing with fallback error handling
|
|
654
697
|
|
|
655
|
-
## [0.9.17] 2025-10-04
|
|
698
|
+
## [0.9.17] - 2025-10-04
|
|
656
699
|
|
|
657
700
|
### New Features
|
|
658
701
|
- **NEW FEATURE**: Enhanced local model support with comprehensive validation and error handling
|
|
@@ -702,7 +745,7 @@ aia --model ollama/llama3.2 --chat
|
|
|
702
745
|
> //models
|
|
703
746
|
```
|
|
704
747
|
|
|
705
|
-
## [0.9.16] 2025-09-26
|
|
748
|
+
## [0.9.16] - 2025-09-26
|
|
706
749
|
|
|
707
750
|
### New Features
|
|
708
751
|
- **NEW FEATURE**: Added support for Ollama AI provider
|
|
@@ -713,7 +756,7 @@ aia --model ollama/llama3.2 --chat
|
|
|
713
756
|
- **ENHANCEMENT**: Expanded AI provider ecosystem with three new local/self-hosted model options
|
|
714
757
|
- **ENHANCEMENT**: Improved flexibility for users preferring local LLM deployments
|
|
715
758
|
|
|
716
|
-
## [0.9.15] 2025-09-21
|
|
759
|
+
## [0.9.15] - 2025-09-21
|
|
717
760
|
|
|
718
761
|
### New Features
|
|
719
762
|
- **NEW FEATURE**: Added `//paste` directive to insert clipboard contents into prompts
|
|
@@ -723,7 +766,7 @@ aia --model ollama/llama3.2 --chat
|
|
|
723
766
|
- Enhanced DirectiveProcessor with clipboard integration using the clipboard gem
|
|
724
767
|
- Added comprehensive test coverage for paste directive functionality
|
|
725
768
|
|
|
726
|
-
## [0.9.14] 2025-09-19
|
|
769
|
+
## [0.9.14] - 2025-09-19
|
|
727
770
|
|
|
728
771
|
### New Features
|
|
729
772
|
- **NEW FEATURE**: Added `//checkpoint` directive to create named snapshots of conversation context
|
|
@@ -749,7 +792,7 @@ aia --model ollama/llama3.2 --chat
|
|
|
749
792
|
- Refactored help directive to collect directives from all registered modules
|
|
750
793
|
- Added comprehensive test coverage for checkpoint and restore functionality
|
|
751
794
|
|
|
752
|
-
## [0.9.13] 2025-09-02
|
|
795
|
+
## [0.9.13] - 2025-09-02
|
|
753
796
|
### New Features
|
|
754
797
|
- **NEW FEATURE**: Added `--tokens` flag to show token counts for each model
|
|
755
798
|
- **NEW FEATURE**: Added `--cost` flag to enable cost estimation for each model
|
|
@@ -767,7 +810,7 @@ aia --model ollama/llama3.2 --chat
|
|
|
767
810
|
- Enhanced test suite with improved assertions and coverage
|
|
768
811
|
- Updated various gem dependencies to latest stable versions
|
|
769
812
|
|
|
770
|
-
## [0.9.12] 2025-08-28
|
|
813
|
+
## [0.9.12] - 2025-08-28
|
|
771
814
|
|
|
772
815
|
### New Features
|
|
773
816
|
- **MAJOR NEW FEATURE**: Multi-model support - specify multiple AI models simultaneously with comma-separated syntax
|
|
@@ -834,15 +877,15 @@ aia --chat -m gpt-4o-mini,gpt-3.5-turbo
|
|
|
834
877
|
- TODO: focus on log file consistency using Logger
|
|
835
878
|
|
|
836
879
|
|
|
837
|
-
## [0.9.11] 2025-07-31
|
|
880
|
+
## [0.9.11] - 2025-07-31
|
|
838
881
|
- added a cost per 1 million input tokens to available_models query output
|
|
839
882
|
- updated ruby_llm to version 1.4.0
|
|
840
883
|
- updated all other gem dependencies to their latest versions
|
|
841
884
|
|
|
842
|
-
## [0.9.10] 2025-07-18
|
|
885
|
+
## [0.9.10] - 2025-07-18
|
|
843
886
|
- updated ruby_llm-mcp to version 0.6.1 which solves problems with MCP tools not being installed
|
|
844
887
|
|
|
845
|
-
## [0.9.9] 2025-07-10
|
|
888
|
+
## [0.9.9] - 2025-07-10
|
|
846
889
|
- refactored the Session and Config classes into more testable method_missing
|
|
847
890
|
- updated the test suire for both the Session and Config classes
|
|
848
891
|
- added support for MCP servers coming into AIA via the shared_tools gem
|
|
@@ -853,13 +896,13 @@ aia --chat -m gpt-4o-mini,gpt-3.5-turbo
|
|
|
853
896
|
- //available_models now has context window size and capabilities for each model returned
|
|
854
897
|
|
|
855
898
|
|
|
856
|
-
## [0.9.8] 2025-06-25
|
|
899
|
+
## [0.9.8] - 2025-06-25
|
|
857
900
|
- fixing an issue with pipelined prompts
|
|
858
901
|
- now showing the complete modality of the model on the processing line.
|
|
859
902
|
- changed -p option from prompts_dir to pipeline
|
|
860
903
|
- found problem with simple cov and deep cov w/r/t their reported test coverage; they have problems with heredoc and complex conditionals.
|
|
861
904
|
|
|
862
|
-
## [0.9.7] 2025-06-20
|
|
905
|
+
## [0.9.7] - 2025-06-20
|
|
863
906
|
|
|
864
907
|
- **NEW FEATURE**: Added `--available_models` CLI option to list all available AI models
|
|
865
908
|
- **NEW FEATURE**: Added `//tools` to show a list of available tools and their description
|
|
@@ -870,7 +913,7 @@ aia --chat -m gpt-4o-mini,gpt-3.5-turbo
|
|
|
870
913
|
- **DOCUMENTATION**: Updated README for better clarity and structure
|
|
871
914
|
- **DEPENDENCY**: Updated Gemfile.lock with latest dependency versions
|
|
872
915
|
|
|
873
|
-
## [0.9.6] 2025-06-13
|
|
916
|
+
## [0.9.6] - 2025-06-13
|
|
874
917
|
- fixed issue 84 with the //llms directive
|
|
875
918
|
- changed the monkey patch to the RubyLLM::Model::Modalities class at the suggestions of the RubyLLM author in prep for a PR against that gem.
|
|
876
919
|
- added the shared_tools gem - need to add examples on how to use it with the --tools option
|
|
@@ -878,11 +921,11 @@ aia --chat -m gpt-4o-mini,gpt-3.5-turbo
|
|
|
878
921
|
- added images/aia.png to README.md
|
|
879
922
|
- let claude code rewrite the README.md file. Some details were dropped but overall in reads better. Need to add the details to a wiki or other documentation site.
|
|
880
923
|
|
|
881
|
-
## [0.9.5] 2025-06-04
|
|
924
|
+
## [0.9.5] - 2025-06-04
|
|
882
925
|
- changed the RubyLLM::Modalities class to use method_missing for mode query
|
|
883
926
|
- hunting for why the //llms query directive is not finding image_to_image LLMs.
|
|
884
927
|
|
|
885
|
-
## [0.9.4] 2025-06-03
|
|
928
|
+
## [0.9.4] - 2025-06-03
|
|
886
929
|
- using RubyLLM v1.3.0
|
|
887
930
|
- setting up a docs infrastructure to behave like the ruby_llm gem's guides side
|
|
888
931
|
- fixed bug in the text-to-image workflow
|
|
@@ -890,7 +933,7 @@ aia --chat -m gpt-4o-mini,gpt-3.5-turbo
|
|
|
890
933
|
- need to pay attention to the test suite
|
|
891
934
|
- also need to ensure the non text2text modes are working
|
|
892
935
|
|
|
893
|
-
## [0.9.3rc1] 2025-05-24
|
|
936
|
+
## [0.9.3rc1] - 2025-05-24
|
|
894
937
|
- using ruby_llm v1.3.0rc1
|
|
895
938
|
- added a models database refresh based on integer days interval with the --refresh option
|
|
896
939
|
- config file now has a "last_refresh" String in format YYYY-MM-DD
|
|
@@ -899,41 +942,41 @@ aia --chat -m gpt-4o-mini,gpt-3.5-turbo
|
|
|
899
942
|
- fixed a bug in the prompt_manager gem which is now at v0.5.5
|
|
900
943
|
|
|
901
944
|
|
|
902
|
-
## [0.9.2] 2025-05-18
|
|
945
|
+
## [0.9.2] - 2025-05-18
|
|
903
946
|
- removing the MCP experiment
|
|
904
947
|
- adding support for RubyLLM::Tool usage in place of the MCP stuff
|
|
905
948
|
- updated prompt_manager to v0.5.4 which fixed shell integration problem
|
|
906
949
|
|
|
907
|
-
## [0.9.1] 2025-05-16
|
|
950
|
+
## [0.9.1] - 2025-05-16
|
|
908
951
|
- rethink MCP approach in favor of just RubyLLM::Tool
|
|
909
952
|
- fixed problem with //clear
|
|
910
953
|
- fixed a problem with a priming prompt in a chat loop
|
|
911
954
|
|
|
912
|
-
## [0.9.0] 2025-05-13
|
|
955
|
+
## [0.9.0] - 2025-05-13
|
|
913
956
|
- Adding experimental MCP Client support
|
|
914
957
|
- removed the CLI options --erb and --shell but kept them in the config file with a default of true for both
|
|
915
958
|
|
|
916
|
-
## [0.8.6] 2025-04-23
|
|
959
|
+
## [0.8.6] - 2025-04-23
|
|
917
960
|
- Added a client adapter for the ruby_llm gem
|
|
918
961
|
- Added the adapter config item and the --adapter option to select at runtime which client to use ai_client or ruby_llm
|
|
919
962
|
|
|
920
|
-
## [0.8.5] 2025-04-19
|
|
963
|
+
## [0.8.5] - 2025-04-19
|
|
921
964
|
- documentation updates
|
|
922
965
|
- integrated the https://pure.md web service for inserting web pages into the context window
|
|
923
966
|
- //include http?://example.com/stuff
|
|
924
967
|
- //webpage http?://example.com/stuff
|
|
925
968
|
|
|
926
|
-
## [0.8.2] 2025-04-18
|
|
969
|
+
## [0.8.2] - 2025-04-18
|
|
927
970
|
- fixed problems with pre-loaded context and chat repl
|
|
928
971
|
- piped content into `aia --chat` is now a part of the context/instructions
|
|
929
972
|
- content via "aia --chat < some_file" is added to the context/instructions
|
|
930
973
|
- `aia --chat context_file.txt context_file2.txt` now works
|
|
931
974
|
- `aia --chat prompt_id context)file.txt` also works
|
|
932
975
|
|
|
933
|
-
## [0.8.1] 2025-04-17
|
|
976
|
+
## [0.8.1] - 2025-04-17
|
|
934
977
|
- bumped version to 0.8.1 after correcting merge conflicts
|
|
935
978
|
|
|
936
|
-
## [0.8.0]
|
|
979
|
+
## [0.8.0] - 2025-04-15
|
|
937
980
|
- Updated PromptManager to v0.5.1 which has some of the functionality that was originally developed in the AIA.
|
|
938
981
|
- Enhanced README.md to include a comprehensive table of configuration options with defaults and associated environment variables.
|
|
939
982
|
- Added a note in README.md about the expandability of configuration options from a config file for dynamic prompt generation.
|
|
@@ -941,7 +984,7 @@ aia --chat -m gpt-4o-mini,gpt-3.5-turbo
|
|
|
941
984
|
- Ensured version consistency across `.version`, `aia.gemspec`, and `lib/aia/version.rb`.
|
|
942
985
|
- Verified and updated documentation to ensure readiness for release on RubyGems.org.
|
|
943
986
|
|
|
944
|
-
## [0.7.1]
|
|
987
|
+
## [0.7.1] - 2025-03-22
|
|
945
988
|
- Added `UIPresenter` class for handling user interface presentation.
|
|
946
989
|
- Added `DirectiveProcessor` class for processing chat-based directives.
|
|
947
990
|
- Added `HistoryManager` class for managing conversation and variable history.
|
|
@@ -955,7 +998,7 @@ aia --chat -m gpt-4o-mini,gpt-3.5-turbo
|
|
|
955
998
|
- Improved error handling and user feedback for directive processing.
|
|
956
999
|
- Enhanced logging and output options for chat sessions.
|
|
957
1000
|
|
|
958
|
-
## [0.7.0]
|
|
1001
|
+
## [0.7.0] - 2025-03-17
|
|
959
1002
|
- Major code refactoring for better organization and maintainability:
|
|
960
1003
|
- Extracted `DirectiveProcessor` class to handle chat-based directives
|
|
961
1004
|
- Extracted `HistoryManager` class for conversation and variable history management
|
|
@@ -966,13 +1009,13 @@ aia --chat -m gpt-4o-mini,gpt-3.5-turbo
|
|
|
966
1009
|
- Improved output handling to suppress STDOUT when chat mode is off and output file is specified
|
|
967
1010
|
- Updated spinner format in the process_prompt method for better user experience
|
|
968
1011
|
|
|
969
|
-
## [0.6.?] WIP
|
|
1012
|
+
## [0.6.?] - WIP
|
|
970
1013
|
- Implemented Tony Stark's Clean Slate Protocol on the develop branch
|
|
971
1014
|
|
|
972
|
-
## [0.5.17] 2024-05-17
|
|
1015
|
+
## [0.5.17] - 2024-05-17
|
|
973
1016
|
- removed replaced `semver` with `versionaire`
|
|
974
1017
|
|
|
975
|
-
## [0.5.16] 2024-04-02
|
|
1018
|
+
## [0.5.16] - 2024-04-02
|
|
976
1019
|
- fixed prompt pipelines
|
|
977
1020
|
- added //next and //pipeline directives as shortcuts to //config [next,pipeline]
|
|
978
1021
|
- Added new backend "client" as an internal OpenAI client
|
|
@@ -981,82 +1024,82 @@ aia --chat -m gpt-4o-mini,gpt-3.5-turbo
|
|
|
981
1024
|
- Added --voice default: alloy (if "siri" and Mac? then uses cli tool "say")
|
|
982
1025
|
- Added --image_size and --image_quality (--is --iq)
|
|
983
1026
|
|
|
984
|
-
## [0.5.15] 2024-03-30
|
|
1027
|
+
## [0.5.15] - 2024-03-30
|
|
985
1028
|
- Added the ability to accept piped in text to be appended to the end of the prompt text: curl $URL | aia ad_hoc
|
|
986
1029
|
- Fixed bugs with entering directives as follow-up prompts during a chat session
|
|
987
1030
|
|
|
988
|
-
## [0.5.14] 2024-03-09
|
|
1031
|
+
## [0.5.14] - 2024-03-09
|
|
989
1032
|
- Directly access OpenAI to do text to speech when using the `--speak` option
|
|
990
1033
|
- Added --voice to specify which voice to use
|
|
991
1034
|
- Added --speech_model to specify which TTS model to use
|
|
992
1035
|
|
|
993
|
-
## [0.5.13] 2024-03-03
|
|
1036
|
+
## [0.5.13] - 2024-03-03
|
|
994
1037
|
- Added CLI-utility `llm` as a backend processor
|
|
995
1038
|
|
|
996
|
-
## [0.5.12] 2024-02-24
|
|
1039
|
+
## [0.5.12] - 2024-02-24
|
|
997
1040
|
- Happy Birthday Ruby!
|
|
998
1041
|
- Added --next CLI option
|
|
999
1042
|
- Added --pipeline CLI option
|
|
1000
1043
|
|
|
1001
|
-
## [0.5.11] 2024-02-18
|
|
1044
|
+
## [0.5.11] - 2024-02-18
|
|
1002
1045
|
- allow directives to return information that is inserted into the prompt text
|
|
1003
1046
|
- added //shell command directive
|
|
1004
1047
|
- added //ruby ruby_code directive
|
|
1005
1048
|
- added //include path_to_file directive
|
|
1006
1049
|
|
|
1007
|
-
## [0.5.10] 2024-02-03
|
|
1050
|
+
## [0.5.10] - 2024-02-03
|
|
1008
1051
|
- Added --roles_dir to isolate roles from other prompts if desired
|
|
1009
1052
|
- Changed --prompts to --prompts_dir to be consistent
|
|
1010
1053
|
- Refactored common fzf usage into its own tool class
|
|
1011
1054
|
|
|
1012
|
-
## [0.5.9] 2024-02-01
|
|
1055
|
+
## [0.5.9] - 2024-02-01
|
|
1013
1056
|
- Added a "I'm working" spinner thing when "--verbose" is used as an indication that the backend is in the process of composing its response to the prompt.
|
|
1014
1057
|
|
|
1015
|
-
## [0.5.8] 2024-01-17
|
|
1058
|
+
## [0.5.8] - 2024-01-17
|
|
1016
1059
|
- Changed the behavior of the --dump option. It must now be followed by path/to/file.ext where ext is a supported config file format: yml, yaml, toml
|
|
1017
1060
|
|
|
1018
|
-
## [0.5.7] 2024-01-15
|
|
1061
|
+
## [0.5.7] - 2024-01-15
|
|
1019
1062
|
- Added ERB processing to the config_file
|
|
1020
1063
|
|
|
1021
|
-
## [0.5.6] 2024-01-15
|
|
1064
|
+
## [0.5.6] - 2024-01-15
|
|
1022
1065
|
- Adding processing for directives, shell integration and erb to the follow up prompt in a chat session
|
|
1023
1066
|
- some code refactoring.
|
|
1024
1067
|
|
|
1025
|
-
## [0.5.3] 2024-01-14
|
|
1068
|
+
## [0.5.3] - 2024-01-14
|
|
1026
1069
|
- adding ability to render markdown to the terminal using the "glow" CLI utility
|
|
1027
1070
|
|
|
1028
|
-
## [0.5.2] 2024-01-13
|
|
1071
|
+
## [0.5.2] - 2024-01-13
|
|
1029
1072
|
- wrap response when its going to the terminal
|
|
1030
1073
|
|
|
1031
|
-
## [0.5.1] 2024-01-12
|
|
1074
|
+
## [0.5.1] - 2024-01-12
|
|
1032
1075
|
- removed a wicked puts "loaded" statement
|
|
1033
1076
|
- fixed missed code when the options were changed to --out_file and --log_file
|
|
1034
1077
|
- fixed completion functions by updating $PROMPT_DIR to $AIA_PROMPTS_DIR to match the documentation.
|
|
1035
1078
|
|
|
1036
|
-
## [0.5.0] 2024-01-05
|
|
1079
|
+
## [0.5.0] - 2024-01-05
|
|
1037
1080
|
- breaking changes:
|
|
1038
1081
|
- changed `--config` to `--config_file`
|
|
1039
1082
|
- changed `--env` to `--shell`
|
|
1040
1083
|
- changed `--output` to `--out_file`
|
|
1041
1084
|
- changed default `out_file` to `STDOUT`
|
|
1042
1085
|
|
|
1043
|
-
## [0.4.3] 2023-12-31
|
|
1086
|
+
## [0.4.3] - 2023-12-31
|
|
1044
1087
|
- added --env to process embedded system environment variables and shell commands within a prompt.
|
|
1045
1088
|
- added --erb to process Embedded RuBy within a prompt because have embedded shell commands will only get you in a trouble. Having ERB will really get you into trouble. Remember the simple prompt is usually the best prompt.
|
|
1046
1089
|
|
|
1047
|
-
## [0.4.2] 2023-12-31
|
|
1090
|
+
## [0.4.2] - 2023-12-31
|
|
1048
1091
|
- added the --role CLI option to pre-pend a "role" prompt to the front of a primary prompt.
|
|
1049
1092
|
|
|
1050
|
-
## [0.4.1] 2023-12-31
|
|
1093
|
+
## [0.4.1] - 2023-12-31
|
|
1051
1094
|
- added a chat mode
|
|
1052
1095
|
- prompt directives now supported
|
|
1053
1096
|
- version bumped to match the `prompt_manager` gem
|
|
1054
1097
|
|
|
1055
|
-
## [0.3.20] 2023-12-28
|
|
1098
|
+
## [0.3.20] - 2023-12-28
|
|
1056
1099
|
- added work around to issue with multiple context files going to the `mods` backend
|
|
1057
1100
|
- added shellwords gem to sanitize prompt text on the command line
|
|
1058
1101
|
|
|
1059
|
-
## [0.3.19] 2023-12-26
|
|
1102
|
+
## [0.3.19] - 2023-12-26
|
|
1060
1103
|
- major code refactoring.
|
|
1061
1104
|
- supports config files \*.yml, \*.yaml and \*.toml
|
|
1062
1105
|
- usage implemented as a man page. --help will display the man page/
|
|
@@ -1069,7 +1112,7 @@ aia --chat -m gpt-4o-mini,gpt-3.5-turbo
|
|
|
1069
1112
|
3. envar values over-rides ...
|
|
1070
1113
|
4. default values
|
|
1071
1114
|
|
|
1072
|
-
## [0.3.0]
|
|
1115
|
+
## [0.3.0] - 2023-11-23
|
|
1073
1116
|
|
|
1074
1117
|
- Matching version to [prompt_manager](https://github.com/prompt_manager) This version allows for the user of history in the entry of values to prompt keywords. KW_HISTORY_MAX is set at 5. Changed CLI interaction to use historical selection and editing of prior keyword values.
|
|
1075
1118
|
|
data/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
<img src="docs/assets/images/aia.png" alt="Robots waiter ready to take your order."><br />
|
|
8
8
|
**The Prompt is the Code**<br />
|
|
9
|
-
<p>
|
|
9
|
+
<p>New in 2.1: <a href="#coding-agents-as-models-claude-code-codex-copilot">coding agents as models</a>. Point <code>--model</code> at <code>claude_code/</code>, <code>codex/</code> or <code>copilot/</code> and the Claude Code, Codex or GitHub Copilot CLI answers your prompt, alone or as a member of a crew.</p>
|
|
10
10
|
</div>
|
|
11
11
|
|
|
12
12
|
---
|
|
@@ -33,6 +33,7 @@ For more information on AIA visit these locations:
|
|
|
33
33
|
| Prompt management | File-based system with history, variables, and fuzzy search | Limited or none |
|
|
34
34
|
| Workflow pipelines | Native `--next` / `--pipeline` chaining | Manual chaining required |
|
|
35
35
|
| Local model support | Ollama and LM Studio out of the box | Varies |
|
|
36
|
+
| Coding agents as models | Claude Code, Codex and Copilot CLIs used like any other model, alone or in a crew | Not available |
|
|
36
37
|
| Tool integration | RubyLLM tools + MCP server ecosystem | Limited |
|
|
37
38
|
| Shell & ERB integration | Native — prompts are live Ruby/shell programs | External only |
|
|
38
39
|
| Agent orchestration | Debate, spawn, verify, decompose, delegate directives | Not available |
|
|
@@ -74,15 +75,15 @@ For more information on AIA visit these locations:
|
|
|
74
75
|
|
|
75
76
|
```plain
|
|
76
77
|
|
|
77
|
-
, , AIA v2.
|
|
78
|
+
, , AIA v2.1.0 is Online
|
|
78
79
|
(\____/)
|
|
79
|
-
(_oo_) Models:
|
|
80
|
-
(O) DB: refreshed 2026-
|
|
81
|
-
__|||__ \) Libs: ruby_llm v2.1.1, robot_lab v0.
|
|
82
|
-
[/ Tobor \] /
|
|
83
|
-
/ \_______/ \/
|
|
84
|
-
/ /___\
|
|
85
|
-
(\ /_____\
|
|
80
|
+
(_oo_) Models: claude-sonnet-4-6
|
|
81
|
+
(O) DB: refreshed 2026-11-01 at 22:28
|
|
82
|
+
__|||__ \) Libs: ruby_llm v2.1.1, robot_lab v0.6.0, simple_flow v0.4.0, trak_flow v0.2.0, typed_bus v0.0.1
|
|
83
|
+
[/ Tobor \] / Tools: none loaded
|
|
84
|
+
/ \_______/ \/ MCP: (none configured)
|
|
85
|
+
/ /___\ Crew: @tobor
|
|
86
|
+
(\ /_____\
|
|
86
87
|
::: :::
|
|
87
88
|
::: :::
|
|
88
89
|
|
|
@@ -175,6 +176,7 @@ Implement a schema registry with event-driven synchronization...
|
|
|
175
176
|
- [Ollama Integration](#ollama-integration)
|
|
176
177
|
- [LM Studio Integration](#lm-studio-integration)
|
|
177
178
|
- [Listing Local Models](#listing-local-models)
|
|
179
|
+
- [Coding Agents as Models (Claude Code, Codex, Copilot)](#coding-agents-as-models-claude-code-codex-copilot)
|
|
178
180
|
- [Shell Integration](#shell-integration)
|
|
179
181
|
- [Embedded Ruby (ERB)](#embedded-ruby-erb)
|
|
180
182
|
- [Prompt Sequences](#prompt-sequences)
|
|
@@ -296,7 +298,8 @@ aia --fuzzy
|
|
|
296
298
|
| Option | Description | Example |
|
|
297
299
|
|--------|-------------|---------|
|
|
298
300
|
| `--chat` | Start interactive chat session | `aia --chat` |
|
|
299
|
-
| `--model MODEL` | Specify AI model(s) to use. Supports `MODEL[=ROLE]` syntax | `aia --model gpt-4o-mini,gpt-3.5-turbo` or `aia --model gpt-4o=architect,claude=security` |
|
|
301
|
+
| `--model MODEL` | Specify AI model(s) to use. Supports `MODEL[=ROLE]` syntax. A bare provider name (`claude_code`) means that provider's default model | `aia --model gpt-4o-mini,gpt-3.5-turbo` or `aia --model gpt-4o=architect,claude=security` |
|
|
302
|
+
| `--provider SLUG` | Provider for models named without a `provider/` prefix. Also re-points models from `AIA_MODEL` or the config file at this provider, keeping their names. Scopes `--list-models` | `aia --provider ollama -m llama3.2` |
|
|
300
303
|
| `--consensus` | Enable consensus mode for multi-model | `aia --consensus` |
|
|
301
304
|
| `--no-consensus` | Force individual responses | `aia --no-consensus` |
|
|
302
305
|
| `--role ROLE` | Use a role/system prompt (default for all models) | `aia --role expert` |
|
|
@@ -348,6 +351,8 @@ AIA determines configuration settings using this order (highest to lowest priori
|
|
|
348
351
|
|
|
349
352
|
**Note:** When `-c` / `--config-file` is used, it replaces the user config and environment variables. Configuration resets to bundled defaults, then the specified file is applied, then CLI arguments take precedence.
|
|
350
353
|
|
|
354
|
+
**`--provider` sets the provider, not the model.** Models named with `--model` and no `provider/` prefix get it. Models that came from `AIA_MODEL` or a config file get it too, replacing their own prefix but keeping their names, because the command line outranks both. So `--provider claude_code` with `AIA_MODEL=lms/qwen3.8` exported asks Claude Code for a model named `qwen3.8`. To use a provider's default model, name the provider as the model: `--model claude_code` means `claude_code/default`.
|
|
355
|
+
|
|
351
356
|
### Configuration Methods
|
|
352
357
|
|
|
353
358
|
**Environment Variables:**
|
|
@@ -964,6 +969,46 @@ The `/available_models` directive (alias: `/models`) lists all models known to t
|
|
|
964
969
|
- 📡 **Offline**: Works without internet connection
|
|
965
970
|
- 🔧 **Control**: Full control over model and parameters
|
|
966
971
|
|
|
972
|
+
### Coding Agents as Models (Claude Code, Codex, Copilot)
|
|
973
|
+
|
|
974
|
+
An agent CLI can stand in for a model. With the matching
|
|
975
|
+
`ruby_llm-providers-*` gem installed, the provider prefix sends the prompt to
|
|
976
|
+
the agent's batch mode on stdin and reads its answer back from stdout. The
|
|
977
|
+
agent keeps its own tools, settings and MCP servers and works in the current
|
|
978
|
+
directory, so any aia prompt, pipeline or multi-model run can be driven by an
|
|
979
|
+
agent that reads and edits files.
|
|
980
|
+
|
|
981
|
+
| Prefix | Gem | CLI |
|
|
982
|
+
|---|---|---|
|
|
983
|
+
| `claude_code/` | `ruby_llm-providers-claude_code` | `claude -p` |
|
|
984
|
+
| `codex/` | `ruby_llm-providers-codex` | `codex exec` |
|
|
985
|
+
| `copilot/` | `ruby_llm-providers-copilot` | `copilot` (non-interactive) |
|
|
986
|
+
|
|
987
|
+
```bash
|
|
988
|
+
gem install ruby_llm-providers-claude_code
|
|
989
|
+
|
|
990
|
+
# The part after the slash is the agent's --model; a bare prefix means its default
|
|
991
|
+
aia --model claude_code/opus refactor_prompt
|
|
992
|
+
aia --model claude_code my_prompt
|
|
993
|
+
|
|
994
|
+
# --provider alone keeps the model name from AIA_MODEL or the config file and
|
|
995
|
+
# hands it to the agent; for the agent's default model use --model as above
|
|
996
|
+
aia --provider claude_code --model sonnet my_prompt
|
|
997
|
+
|
|
998
|
+
# Chat keeps the agent's session alive between turns (--resume)
|
|
999
|
+
aia --chat --model claude_code/sonnet
|
|
1000
|
+
|
|
1001
|
+
# Cross-vendor review: one agent implements, another reviews
|
|
1002
|
+
aia --model claude_code/sonnet=implementer,codex/default=reviewer --consensus review_prompt
|
|
1003
|
+
|
|
1004
|
+
aia --list-models --provider claude_code
|
|
1005
|
+
```
|
|
1006
|
+
|
|
1007
|
+
Because the agent brings its own tools, aia's `--tools` and MCP servers are
|
|
1008
|
+
not attached to these robots (a one-line notice says so). Permissions, the
|
|
1009
|
+
working directory, timeouts and extra CLI flags are set through the gem's
|
|
1010
|
+
`RubyLLM.config.<provider>_*` options; see each gem's README.
|
|
1011
|
+
|
|
967
1012
|
### Shell Integration
|
|
968
1013
|
|
|
969
1014
|
AIA automatically processes shell patterns in prompts:
|
|
@@ -1393,18 +1438,18 @@ mcp_servers:
|
|
|
1393
1438
|
|
|
1394
1439
|
#### Verifying MCP Server Configuration
|
|
1395
1440
|
|
|
1396
|
-
When MCP servers are configured, AIA
|
|
1441
|
+
When MCP servers are configured, AIA lists them in the startup robot with each server's tool count in parentheses. Servers that failed to connect are named after `FAILED:`:
|
|
1397
1442
|
|
|
1398
1443
|
```
|
|
1399
|
-
, , AIA v2.
|
|
1444
|
+
, , AIA v2.1.0 is Online
|
|
1400
1445
|
(\____/)
|
|
1401
|
-
(_oo_) Models:
|
|
1402
|
-
(O) DB: refreshed 2026-
|
|
1403
|
-
__|||__ \) Libs: ruby_llm v2.1.1, robot_lab v0.
|
|
1404
|
-
[/ Tobor \] /
|
|
1405
|
-
/ \_______/ \/
|
|
1406
|
-
/ /___\
|
|
1407
|
-
(\ /_____\
|
|
1446
|
+
(_oo_) Models: claude-sonnet-4-6
|
|
1447
|
+
(O) DB: refreshed 2026-11-01 at 22:28
|
|
1448
|
+
__|||__ \) Libs: ruby_llm v2.1.1, robot_lab v0.6.0, simple_flow v0.4.0, trak_flow v0.2.0, typed_bus v0.0.1
|
|
1449
|
+
[/ Tobor \] / Tools: 109 tools loaded
|
|
1450
|
+
/ \_______/ \/ MCP: github(42), brew(14), redis(53) | FAILED: htm
|
|
1451
|
+
/ /___\ Crew: @tobor
|
|
1452
|
+
(\ /_____\
|
|
1408
1453
|
::: :::
|
|
1409
1454
|
::: :::
|
|
1410
1455
|
|
|
@@ -99,8 +99,9 @@ module AIA
|
|
|
99
99
|
end
|
|
100
100
|
|
|
101
101
|
opts.on('--provider SLUG',
|
|
102
|
-
'
|
|
103
|
-
'
|
|
102
|
+
'Provider for models given without a provider/ prefix; also re-points ' \
|
|
103
|
+
'models from AIA_MODEL or the config file at it, keeping their names. ' \
|
|
104
|
+
'Scopes --list-models (any RubyLLM-registered provider)') do |slug|
|
|
104
105
|
options[:provider] = slug
|
|
105
106
|
end
|
|
106
107
|
|
data/lib/aia/config/defaults.yml
CHANGED
|
@@ -162,10 +162,15 @@ defaults:
|
|
|
162
162
|
file: STDOUT
|
|
163
163
|
level: warn
|
|
164
164
|
flush: true
|
|
165
|
+
# MCP connection logging goes to a file so warnings never interleave
|
|
166
|
+
# with the "Connecting MCP servers" spinner; failures still appear in
|
|
167
|
+
# the startup banner's FAILED list.
|
|
165
168
|
mcp:
|
|
166
|
-
file:
|
|
169
|
+
file: ~/.config/aia/logs/mcp.log
|
|
167
170
|
level: warn
|
|
168
171
|
flush: true
|
|
172
|
+
# stderr of stdio MCP server processes: a file path, STDERR, or null
|
|
173
|
+
server_stderr: ~/.config/aia/logs/mcp_servers.log
|
|
169
174
|
|
|
170
175
|
# ---------------------------------------------------------------------------
|
|
171
176
|
# Pipeline/Workflow Configuration
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
|
|
14
14
|
module AIA
|
|
15
15
|
class ModelSpec
|
|
16
|
+
# The model id used when a bare provider name is given (e.g. `claude_code`):
|
|
17
|
+
# the provider's own default model.
|
|
18
|
+
DEFAULT_MODEL = 'default'
|
|
19
|
+
|
|
16
20
|
attr_accessor :name, :role, :instance, :internal_id, :provider
|
|
17
21
|
|
|
18
22
|
def initialize(hash = {})
|
|
@@ -76,18 +80,23 @@ module AIA
|
|
|
76
80
|
|
|
77
81
|
private
|
|
78
82
|
|
|
79
|
-
# Extract a provider
|
|
80
|
-
#
|
|
83
|
+
# Extract a provider from the model name. "<provider>/<model-id>" splits
|
|
84
|
+
# on the slash; a bare "<provider>" with no slash names that provider's
|
|
85
|
+
# DEFAULT_MODEL, which is how agent-CLI providers such as claude_code,
|
|
86
|
+
# codex and copilot are usually given. The prefix is a provider exactly
|
|
87
|
+
# when RubyLLM knows it (registered already, or loadable as a
|
|
81
88
|
# conventional ruby_llm-providers-<prefix> gem) — no provider names are
|
|
82
89
|
# hardcoded here. Names whose first segment is not a provider (registry
|
|
83
|
-
# ids like "meta-llama/llama-4-maverick") pass
|
|
90
|
+
# ids like "meta-llama/llama-4-maverick", plain ids like "gpt-4o") pass
|
|
91
|
+
# through untouched.
|
|
84
92
|
def extract_provider_from_name!
|
|
85
|
-
return
|
|
93
|
+
return if @name.nil?
|
|
86
94
|
|
|
87
95
|
prefix, rest = @name.split('/', 2)
|
|
88
96
|
return unless ProviderRegistry.available?(prefix)
|
|
97
|
+
|
|
89
98
|
@provider = prefix
|
|
90
|
-
@name = rest
|
|
99
|
+
@name = rest || DEFAULT_MODEL
|
|
91
100
|
end
|
|
92
101
|
end
|
|
93
102
|
end
|