Commit 60ebbe1
Fix runtime description leak on list_issue_fields legacy variant
The pkg/translations TranslationHelper is first-write-wins on cache
hits: if two callers pass the same key with different fallback
strings, only the first fallback is remembered. Both ListIssueFields
(MS-aware) and ListIssueFieldsLegacy shared the translation key
TOOL_LIST_ISSUE_FIELDS_DESCRIPTION, so at runtime the second-registered
variant (legacy) inherited the first's description — leaking the
MS-flavoured 'single_select, multi_select' text into the FF-off surface.
Only list_issue_fields was affected: issue_write and list_issues use
identical top-level descriptions across variants (their MS-vs-legacy
differentiation is in InputSchema property descriptions, which are
hardcoded strings not routed through the translation helper).
Fix: give the legacy variant its own translation key
(TOOL_LIST_ISSUE_FIELDS_LEGACY_DESCRIPTION). Simplify buildListIssueFields
to accept the already-resolved description string, so the two variants
resolve their translation before calling the shared builder.
Live-verified against a local binary:
- FF off: description no longer contains 'multi_select'
- FF on: description contains 'multi_select'
Regression test: Test_ListIssueFields_LegacyDoesNotLeakMSDescription
UnderRealTranslationHelper uses an in-test cache that mimics the real
helper's first-write-wins behaviour. Confirmed the test fails if both
variants share a key and passes with them split.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 352a2bc commit 60ebbe1
2 files changed
Lines changed: 52 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
132 | 137 | | |
133 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
134 | 143 | | |
135 | 144 | | |
136 | 145 | | |
137 | 146 | | |
138 | 147 | | |
139 | 148 | | |
140 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
141 | 154 | | |
142 | 155 | | |
143 | 156 | | |
144 | 157 | | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
| 158 | + | |
150 | 159 | | |
151 | 160 | | |
152 | 161 | | |
153 | 162 | | |
154 | | - | |
| 163 | + | |
155 | 164 | | |
156 | 165 | | |
157 | 166 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
0 commit comments