Skip to content

fix knowledge CLI crashes: query TypeError and health nil path (0.6.7)#8

Merged
Esity merged 1 commit intomainfrom
fix/knowledge-query-health-nil-path
Apr 15, 2026
Merged

fix knowledge CLI crashes: query TypeError and health nil path (0.6.7)#8
Esity merged 1 commit intomainfrom
fix/knowledge-query-health-nil-path

Conversation

@Esity
Copy link
Copy Markdown
Contributor

@Esity Esity commented Apr 15, 2026

Summary

  • legionio knowledge query crashed with TypeError: no implicit conversion of Symbol into Integerretrieve_chunks was returning the raw { success:, entries:, count: } Hash from retrieve_relevant instead of extracting the entries array; downstream code iterated the Hash as key-value pairs and called [:symbol] on the resulting Array tuples
  • legionio knowledge health crashed with TypeError: no implicit conversion of nil into String — the CLI passes path: nil when --corpus-path is omitted, which fell straight into Find.find(nil); now falls back to Legion::Settings.dig(:knowledge, :corpus_path) and returns a clear { success: false, error: 'corpus_path is required' } when no path is available

Test plan

  • bundle exec rspec — 190 examples, 0 failures
  • bundle exec rubocop — 0 offenses
  • New specs in query_spec.rb: stubs retrieve_relevant returning a Hash and asserts sources array is correctly extracted
  • New specs in maintenance_spec.rb: covers nil path with no settings, nil path with nil settings value, and nil path with valid settings fallback

- retrieve_chunks now extracts entries array from retrieve_relevant's
  Hash response instead of returning the raw Hash, preventing
  TypeError: no implicit conversion of Symbol into Integer on
  legionio knowledge query
- health now guards against nil path by falling back to
  Legion::Settings.dig(:knowledge, :corpus_path) and returning
  success: false with a clear error when no path is available,
  preventing TypeError: no implicit conversion of nil into String on
  legionio knowledge health
- bump to 0.6.7
@Esity Esity merged commit 55fbb93 into main Apr 15, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant