Commit 9914239
authored
* fix: Add fallback channels when NixOS API discovery fails (#52)
Resolves issue where users encountered "Invalid channel 'stable'" errors
when the NixOS API was unreachable or slow, leaving channel discovery
with empty results.
Changes:
- Add static FALLBACK_CHANNELS mapping for reliable offline operation
- Increase API timeout from 5s to 10s for slow connections
- Remove deprecated channels (20.09, 24.11 EOL June 2025)
- Add using_fallback flag to ChannelCache
- Display warnings in nixos_channels() when fallback is active
- Update 7 tests to verify fallback behavior
- Ensure all channel-based tools work with fallback channels
The fallback channels provide a safety net while maintaining the
dynamic discovery feature for up-to-date channel information.
* fix(tests): Update NixHub tests to reflect actual API data
Ruby version positions in NixHub API have shifted as new versions
were released. Updated tests to use Ruby 3.0.x (positions 36-42)
instead of Ruby 2.6.7 (position 52), which is beyond the standard
limit=50 upper bound.
Changes:
- test_ai_response_for_missing_version: Use Ruby 3.0 instead of 2.6
- test_efficient_search_strategy: Updated to test Ruby 3.0
- test_finding_older_ruby_version: Use Ruby 3.0 (within limit=50)
- test_version_not_in_nixhub: Remove assertion for 2.6, test 2.7/3.0
These changes ensure tests remain stable as new Ruby versions are
released to NixHub, while still testing the intended behavior of
finding older versions with appropriate limits.
1 parent 46b4d4d commit 9914239
File tree
6 files changed
+312
-69
lines changed- .claude
- mcp_nixos
- tests
6 files changed
+312
-69
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
41 | 51 | | |
42 | 52 | | |
43 | 53 | | |
| |||
49 | 59 | | |
50 | 60 | | |
51 | 61 | | |
| 62 | + | |
52 | 63 | | |
53 | 64 | | |
54 | 65 | | |
| |||
66 | 77 | | |
67 | 78 | | |
68 | 79 | | |
69 | | - | |
| 80 | + | |
| 81 | + | |
70 | 82 | | |
71 | 83 | | |
72 | 84 | | |
| |||
77 | 89 | | |
78 | 90 | | |
79 | 91 | | |
80 | | - | |
| 92 | + | |
81 | 93 | | |
82 | 94 | | |
83 | 95 | | |
| |||
91 | 103 | | |
92 | 104 | | |
93 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
94 | 112 | | |
95 | 113 | | |
96 | 114 | | |
| |||
140 | 158 | | |
141 | 159 | | |
142 | 160 | | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
143 | 166 | | |
144 | 167 | | |
145 | 168 | | |
| |||
523 | 546 | | |
524 | 547 | | |
525 | 548 | | |
526 | | - | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
527 | 558 | | |
528 | 559 | | |
529 | 560 | | |
| |||
543 | 574 | | |
544 | 575 | | |
545 | 576 | | |
546 | | - | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
547 | 581 | | |
548 | 582 | | |
549 | 583 | | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
555 | 590 | | |
556 | 591 | | |
557 | 592 | | |
558 | 593 | | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
559 | 597 | | |
560 | 598 | | |
561 | 599 | | |
| |||
0 commit comments