Commit 7eee6a5
fix(logs): address Copilot review on capability presence vs availability (#112)
Copilot pointed out that defaultLogSourcesForBox conflated two
distinct cases:
1. The agent doesn't surface a gear name at all (older agent that
pre-dates the gear).
2. The agent reports the gear as unavailable.
Both used IsAvailable() and collapsed into "return empty list",
which violates the function comment's fail-open promise: a
forward-compatibility gap would silently strip the source list.
Use caps.Has() to distinguish presence from availability:
- If the agent surfaces neither access-log nor logs by name → fail
open to the legacy [haproxy, system] pair (older-agent path).
- If the agent surfaces at least one and reports both unavailable →
return empty (the only case where the JS shows an empty dropdown).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 08d9d88 commit 7eee6a5
1 file changed
Lines changed: 23 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
122 | | - | |
123 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
124 | 132 | | |
125 | 133 | | |
126 | 134 | | |
| |||
131 | 139 | | |
132 | 140 | | |
133 | 141 | | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
141 | 148 | | |
142 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
143 | 153 | | |
144 | 154 | | |
145 | 155 | | |
146 | 156 | | |
147 | 157 | | |
148 | 158 | | |
149 | 159 | | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
150 | 163 | | |
151 | 164 | | |
0 commit comments