Repository navigation
Commit 724b114
fix: address PR #794 round-2 review feedback (cubic P1 + CR nits)
cubic flagged a real P1 on the previous round's commit and CodeRabbit
posted a few low-value nits worth picking up while we're here.
P1 (cubic) — `Telemetry.maskString` URL regex missed URLs carrying
basic-auth userinfo before the host. `https://admin:[email protected]/x`
fell through unredacted because the regex started with the host
alternation. Added an optional `(?:[^\/\s@]+@)?` userinfo prefix so the
whole URL — credentials + host — is captured into `<internal-host>`.
CR quick wins:
- Hoisted the `Telemetry` import to the top of the adversarial test
file (mid-file imports work in Bun but tooling that scans headers
miss them).
- Tightened the `/models` hint test to assert the full canonical string
``Run `altimate models` to see available models.`` so docs / changelog
/ code can't quietly diverge again.
Defense-in-depth from CR nits:
- Added `0.0.0.0` (any-interface bind) to maskInternalHost — shows up
in misconfigured proxy URLs and is functionally internal.
- Added a one-line comment to the silent `catch {}` in
isOpenAiErrorRetryable so a future refactor doesn't "fix" it into
something that throws on malformed JSON.
Also added 2 new adversarial tests pinning the userinfo+host case and
the `0.0.0.0` case (240/240 across the 5 affected files, up from 238).
Deferred to v0.7.2: extracting `makeAPICallError` to a shared fixture
(refactor, scope creep), reusing `codeFromBody` in
`isOpenAiErrorRetryable` (signature change), IPv4-mapped IPv6
(`::ffff:10.0.0.1`) coverage, byte-vs-char `RESPONSE_BODY_CAP` rename.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>1 parent fd28dd3 commit 724b114
3 files changed
Lines changed: 33 additions & 5 deletions
File tree
- packages/opencode
- src
- altimate/telemetry
- provider
- test/skill
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1073 | 1073 | | |
1074 | 1074 | | |
1075 | 1075 | | |
1076 | | - | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
1077 | 1081 | | |
1078 | 1082 | | |
1079 | 1083 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
40 | 44 | | |
41 | 45 | | |
42 | 46 | | |
| |||
258 | 262 | | |
259 | 263 | | |
260 | 264 | | |
| 265 | + | |
261 | 266 | | |
262 | 267 | | |
263 | 268 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
380 | 381 | | |
381 | 382 | | |
382 | 383 | | |
383 | | - | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
384 | 387 | | |
385 | 388 | | |
386 | 389 | | |
| |||
698 | 701 | | |
699 | 702 | | |
700 | 703 | | |
701 | | - | |
702 | | - | |
703 | 704 | | |
704 | 705 | | |
705 | 706 | | |
| |||
761 | 762 | | |
762 | 763 | | |
763 | 764 | | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
764 | 783 | | |
0 commit comments