Commit 809056d
authored
fix(lmtool): stop double-counting classNameDetection on every invoke (#1651)
* fix(lmtool): stop double-counting classNameDetection on every invoke
findFullyQualifiedClassName was called twice for every invocation that used a simple class name:
1. inside constructDebugCommand to resolve the actual command
2. immediately after, to build the targetInfo message shown to the model
Each call also emitted its own classNameDetection telemetry event, so the classNameDetection success/failure counts in ddtelfiltered were inflated by 2x.
This makes the apparent ~49% noPackage failure rate look much worse than reality (the true rate is closer to ~25% before accounting for other root causes addressed in #1650).
Fix: resolve the detection once at the caller, emit telemetry once, and pass the resolved name into both constructDebugCommand and the targetInfo branch.
Side benefit: removes a redundant file system walk from the hot launch path.
* review: reword dedup comments to drop incorrect '2x telemetry' claim
Reviewer correctly pointed out that the original main branch only had a duplicate findFullyQualifiedClassName FS walk in the targetInfo branch; the recordLaunchInternal({name:'classNameDetection'}) emission was only inside constructDebugCommand, not duplicated. The 'inflates noPackage by 2x' rationale was wrong — observed metrics are not inflated by the dup.
Reworded both comments to focus on the FS-walk dedup + ownership clarity. Functional code unchanged; only comments updated.1 parent 54a4ceb commit 809056d
1 file changed
Lines changed: 44 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
198 | 224 | | |
199 | 225 | | |
200 | 226 | | |
| |||
223 | 249 | | |
224 | 250 | | |
225 | 251 | | |
226 | | - | |
227 | | - | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
228 | 255 | | |
229 | 256 | | |
230 | 257 | | |
| |||
591 | 618 | | |
592 | 619 | | |
593 | 620 | | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
594 | 627 | | |
595 | 628 | | |
596 | 629 | | |
597 | | - | |
| 630 | + | |
| 631 | + | |
598 | 632 | | |
599 | 633 | | |
600 | 634 | | |
| |||
610 | 644 | | |
611 | 645 | | |
612 | 646 | | |
613 | | - | |
614 | | - | |
615 | | - | |
616 | | - | |
617 | | - | |
618 | | - | |
619 | | - | |
620 | | - | |
621 | | - | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
632 | 653 | | |
633 | 654 | | |
634 | 655 | | |
| |||
0 commit comments