legionio 1.4.188 → 1.4.189
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/.github/workflows/ci.yml +41 -0
- data/CHANGELOG.md +11 -0
- data/lib/legion/api/llm.rb +2 -1
- data/lib/legion/api/prompts.rb +2 -1
- data/lib/legion/cli/commit_command.rb +1 -1
- data/lib/legion/cli/image_command.rb +1 -1
- data/lib/legion/cli/pr_command.rb +1 -1
- data/lib/legion/cli/prompt_command.rb +5 -2
- data/lib/legion/cli/review_command.rb +1 -1
- data/lib/legion/extensions.rb +2 -1
- data/lib/legion/notebook/generator.rb +1 -1
- data/lib/legion/trace_search.rb +2 -1
- data/lib/legion/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5780ec4e2aade493aadfb8bb89b34479fed6f780f1213c068175693c3c3714e3
|
|
4
|
+
data.tar.gz: 4a6afb98e55a763080a68f34aaae378484492e60e3b8af35acf68da6518d965b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7d386639fc8385b0c8a414385f07b6f9265e8d621a581804cfd726f9232bc412564cf6dcda870418866a58364a96662f740134f6eacfb8ceffc2f6ecd4c8b9ea
|
|
7
|
+
data.tar.gz: 489116a6993b078dcc234066339d986946211495f1824ace4f3075a173772ed43d00ef77689897708251bf6431c52c96eaf4c8a809bac59ae1f24daf5b861532
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -33,3 +33,44 @@ jobs:
|
|
|
33
33
|
uses: LegionIO/.github/.github/workflows/release.yml@main
|
|
34
34
|
secrets:
|
|
35
35
|
rubygems-api-key: ${{ secrets.RUBYGEMS_API_KEY }}
|
|
36
|
+
|
|
37
|
+
trigger-homebrew:
|
|
38
|
+
needs: release
|
|
39
|
+
if: needs.release.outputs.released == 'true'
|
|
40
|
+
runs-on: ubuntu-latest
|
|
41
|
+
steps:
|
|
42
|
+
- name: Trigger unified Homebrew build
|
|
43
|
+
env:
|
|
44
|
+
GH_TOKEN: ${{ secrets.HOMEBREW_DISPATCH_TOKEN }}
|
|
45
|
+
LEGIONIO_VERSION: ${{ needs.release.outputs.version }}
|
|
46
|
+
run: |
|
|
47
|
+
gh api repos/LegionIO/homebrew-tap/dispatches \
|
|
48
|
+
-f event_type=build-legion \
|
|
49
|
+
-f "client_payload[legionio_version]=$LEGIONIO_VERSION" \
|
|
50
|
+
-f "client_payload[ruby_version]=3.4.8" \
|
|
51
|
+
-f "client_payload[package_revision]=1"
|
|
52
|
+
|
|
53
|
+
docker-build:
|
|
54
|
+
name: Build Docker Image
|
|
55
|
+
needs: release
|
|
56
|
+
if: needs.release.outputs.released == 'true'
|
|
57
|
+
runs-on: ubuntu-latest
|
|
58
|
+
permissions:
|
|
59
|
+
packages: write
|
|
60
|
+
steps:
|
|
61
|
+
- uses: actions/checkout@v4
|
|
62
|
+
- uses: docker/setup-buildx-action@v3
|
|
63
|
+
- uses: docker/login-action@v3
|
|
64
|
+
with:
|
|
65
|
+
registry: ghcr.io
|
|
66
|
+
username: ${{ github.actor }}
|
|
67
|
+
password: ${{ secrets.GITHUB_TOKEN }}
|
|
68
|
+
- uses: docker/build-push-action@v5
|
|
69
|
+
with:
|
|
70
|
+
context: .
|
|
71
|
+
push: true
|
|
72
|
+
tags: |
|
|
73
|
+
ghcr.io/legionio/legion:${{ needs.release.outputs.version }}
|
|
74
|
+
ghcr.io/legionio/legion:latest
|
|
75
|
+
cache-from: type=gha
|
|
76
|
+
cache-to: type=gha,mode=max
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Legion Changelog
|
|
2
2
|
|
|
3
|
+
## [1.4.189] - 2026-03-23
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
- Add `caller:` identity to all LLM calls in API, CLI, extensions, and internal modules
|
|
7
|
+
- `API::Routes::Llm` sync path: `caller: { source: 'api', path: request.path }`
|
|
8
|
+
- `API::Routes::Prompts`: `caller: { source: 'api', endpoint: 'prompts' }`
|
|
9
|
+
- `CLI::Commit`, `CLI::Pr`, `CLI::Review`, `CLI::Prompt`, `CLI::Image`: `caller: { source: 'cli', command: '<cmd>' }`
|
|
10
|
+
- `Notebook::Generator`: `caller: { source: 'cli', command: 'notebook' }`
|
|
11
|
+
- `TraceSearch`: `caller: { source: 'cli', command: 'trace' }`
|
|
12
|
+
- `Extensions` inline LLM runners: `caller: { source: 'extension', command: 'llm_runner' }`
|
|
13
|
+
|
|
3
14
|
## [1.4.188] - 2026-03-23
|
|
4
15
|
|
|
5
16
|
### Changed
|
data/lib/legion/api/llm.rb
CHANGED
|
@@ -144,7 +144,8 @@ module Legion
|
|
|
144
144
|
json_response({ request_id: request_id, poll_key: "llm:#{request_id}:status" },
|
|
145
145
|
status_code: 202)
|
|
146
146
|
else
|
|
147
|
-
session = Legion::LLM.
|
|
147
|
+
session = Legion::LLM.chat(model: model, provider: provider,
|
|
148
|
+
caller: { source: 'api', path: request.path })
|
|
148
149
|
response = session.ask(message)
|
|
149
150
|
Legion::Logging.info "API: LLM chat request #{request_id} completed sync model=#{session.model}"
|
|
150
151
|
json_response(
|
data/lib/legion/api/prompts.rb
CHANGED
|
@@ -77,7 +77,8 @@ module Legion
|
|
|
77
77
|
halt code, json_error(rendered[:error], "prompt '#{name}' #{rendered[:error].tr('_', ' ')}", status_code: code)
|
|
78
78
|
end
|
|
79
79
|
|
|
80
|
-
session = Legion::LLM.
|
|
80
|
+
session = Legion::LLM.chat(model: model, provider: provider,
|
|
81
|
+
caller: { source: 'api', endpoint: 'prompts' })
|
|
81
82
|
response = session.ask(rendered[:rendered])
|
|
82
83
|
|
|
83
84
|
prompt_version = rendered[:prompt_version]
|
|
@@ -116,7 +116,7 @@ module Legion
|
|
|
116
116
|
opts[:model] = options[:model] if options[:model]
|
|
117
117
|
opts[:provider] = options[:provider]&.to_sym if options[:provider]
|
|
118
118
|
|
|
119
|
-
chat = Legion::LLM.chat(**opts)
|
|
119
|
+
chat = Legion::LLM.chat(**opts, caller: { source: 'cli', command: 'commit' })
|
|
120
120
|
prompt = build_prompt(diff, stat, log)
|
|
121
121
|
response = chat.ask(prompt)
|
|
122
122
|
response.content.strip
|
|
@@ -136,7 +136,7 @@ module Legion
|
|
|
136
136
|
llm_kwargs[:model] = options[:model] if options[:model]
|
|
137
137
|
llm_kwargs[:provider] = options[:provider].to_sym if options[:provider]
|
|
138
138
|
|
|
139
|
-
Legion::LLM.chat(messages: messages, **llm_kwargs)
|
|
139
|
+
Legion::LLM.chat(messages: messages, caller: { source: 'cli', command: 'image' }, **llm_kwargs)
|
|
140
140
|
rescue StandardError => e
|
|
141
141
|
out.error("LLM call failed: #{e.message}")
|
|
142
142
|
raise SystemExit, 1
|
|
@@ -163,7 +163,7 @@ module Legion
|
|
|
163
163
|
opts[:model] = options[:model] if options[:model]
|
|
164
164
|
opts[:provider] = options[:provider]&.to_sym if options[:provider]
|
|
165
165
|
|
|
166
|
-
chat = Legion::LLM.chat(**opts)
|
|
166
|
+
chat = Legion::LLM.chat(**opts, caller: { source: 'cli', command: 'pr' })
|
|
167
167
|
prompt = build_prompt(diff, stat, log, branch)
|
|
168
168
|
response = chat.ask(prompt)
|
|
169
169
|
parse_pr_response(response.content)
|
|
@@ -242,6 +242,7 @@ module Legion
|
|
|
242
242
|
|
|
243
243
|
response = Legion::LLM.chat(
|
|
244
244
|
messages: [{ role: 'user', content: rendered }],
|
|
245
|
+
caller: { source: 'cli', command: 'prompt' },
|
|
245
246
|
**llm_kwargs
|
|
246
247
|
)
|
|
247
248
|
|
|
@@ -275,8 +276,10 @@ module Legion
|
|
|
275
276
|
rendered_b = render_prompt(name, prompt_b[:version], vars, client, out)
|
|
276
277
|
return if rendered_b.nil?
|
|
277
278
|
|
|
278
|
-
response_a = Legion::LLM.chat(messages: [{ role: 'user', content: rendered_a }],
|
|
279
|
-
|
|
279
|
+
response_a = Legion::LLM.chat(messages: [{ role: 'user', content: rendered_a }],
|
|
280
|
+
caller: { source: 'cli', command: 'prompt' }, **llm_kwargs)
|
|
281
|
+
response_b = Legion::LLM.chat(messages: [{ role: 'user', content: rendered_b }],
|
|
282
|
+
caller: { source: 'cli', command: 'prompt' }, **llm_kwargs)
|
|
280
283
|
|
|
281
284
|
if options[:json]
|
|
282
285
|
out.json({ name: name, version_a: prompt_a[:version], version_b: prompt_b[:version],
|
|
@@ -134,7 +134,7 @@ module Legion
|
|
|
134
134
|
opts[:model] = options[:model] if options[:model]
|
|
135
135
|
opts[:provider] = options[:provider]&.to_sym if options[:provider]
|
|
136
136
|
|
|
137
|
-
chat = Legion::LLM.chat(**opts)
|
|
137
|
+
chat = Legion::LLM.chat(**opts, caller: { source: 'cli', command: 'review' })
|
|
138
138
|
prompt = build_review_prompt(diff_text, context)
|
|
139
139
|
response = chat.ask(prompt)
|
|
140
140
|
parse_review(response.content, context)
|
data/lib/legion/extensions.rb
CHANGED
|
@@ -565,7 +565,8 @@ module Legion
|
|
|
565
565
|
kwargs.dig(*keys).to_s
|
|
566
566
|
end
|
|
567
567
|
if defined?(Legion::LLM)
|
|
568
|
-
Legion::LLM.chat(messages: [{ role: 'user', content: prompt }], model: model
|
|
568
|
+
Legion::LLM.chat(messages: [{ role: 'user', content: prompt }], model: model,
|
|
569
|
+
caller: { source: 'extension', command: 'llm_runner' })
|
|
569
570
|
else
|
|
570
571
|
{ success: false, reason: :llm_unavailable }
|
|
571
572
|
end
|
|
@@ -57,7 +57,7 @@ module Legion
|
|
|
57
57
|
kwargs = { messages: [{ role: 'user', content: prompt }] }
|
|
58
58
|
kwargs[:model] = model if model
|
|
59
59
|
kwargs[:provider] = provider.to_sym if provider
|
|
60
|
-
Legion::LLM.chat(**kwargs)
|
|
60
|
+
Legion::LLM.chat(**kwargs, caller: { source: 'cli', command: 'notebook' })
|
|
61
61
|
end
|
|
62
62
|
|
|
63
63
|
def self.parse_notebook_response(response)
|
data/lib/legion/trace_search.rb
CHANGED
|
@@ -67,7 +67,8 @@ module Legion
|
|
|
67
67
|
{ role: 'system', content: schema_context },
|
|
68
68
|
{ role: 'user', content: query }
|
|
69
69
|
],
|
|
70
|
-
schema: FILTER_SCHEMA
|
|
70
|
+
schema: FILTER_SCHEMA,
|
|
71
|
+
caller: { source: 'cli', command: 'trace' }
|
|
71
72
|
)
|
|
72
73
|
Legion::Logging.error "[TraceSearch] LLM filter generation failed for query: #{query.inspect}" if !result[:valid] && defined?(Legion::Logging)
|
|
73
74
|
result[:data] if result[:valid]
|
data/lib/legion/version.rb
CHANGED