What happened?
kagi lens list and kagi lens get fail with a parse error on accounts whose Kagi UI language is not English (reproduced with Norwegian):
$ kagi lens list
parse error: lens '4248' missing edit url
Root cause
parse_lens_list in src/parser.rs resolves the edit link with:
let edit_selector = selector(r#".lens_edit_lens a[aria-label="Edit lens"]"#)?;
Two problems with the live page (verified against /html/settings/lenses server HTML, 2026-09-12):
- The
.lens_edit_lens wrapper no longer exists. The edit anchor now sits directly inside the form.__lens_item:
<a aria-label='Rediger linse'
class="btn-icon m-n4"
href="/settings/update_lens?id=4248">…svg…</a>
aria-label is localized — a Norwegian-locale account renders aria-label='Rediger linse', so even unwrapping the selector would not match non-English accounts.
This means every lens fails at the edit_url extraction, aborting the whole list.
Suggested fix
Fall back to matching the edit link by href prefix, which is locale-independent and wrapper-independent:
let edit_fallback_selector = selector(r#"a[href^="/settings/update_lens?id="]"#)?;
// …
let edit_url = item
.select(&edit_selector)
.next()
.or_else(|| item.select(&edit_fallback_selector).next())
.and_then(|node| node.value().attr("href"))
// …
I have implemented and tested this locally: lens list returns all 14 lenses and lens get works, E2E against a Norwegian-locale account. Happy to open a PR with the fix + a regression test using the live markup above — just say the word (or I can attach the full patch here).
Environment
- kagi-cli 0.20.0 (homebrew tap
microck/kagi)
- macOS 15 (arm64)
- Kagi UI language: Norwegian (Bokmål)
What happened?
kagi lens listandkagi lens getfail with a parse error on accounts whose Kagi UI language is not English (reproduced with Norwegian):Root cause
parse_lens_listinsrc/parser.rsresolves the edit link with:Two problems with the live page (verified against
/html/settings/lensesserver HTML, 2026-09-12):.lens_edit_lenswrapper no longer exists. The edit anchor now sits directly inside theform.__lens_item:aria-labelis localized — a Norwegian-locale account rendersaria-label='Rediger linse', so even unwrapping the selector would not match non-English accounts.This means every lens fails at the
edit_urlextraction, aborting the whole list.Suggested fix
Fall back to matching the edit link by
hrefprefix, which is locale-independent and wrapper-independent:I have implemented and tested this locally:
lens listreturns all 14 lenses andlens getworks, E2E against a Norwegian-locale account. Happy to open a PR with the fix + a regression test using the live markup above — just say the word (or I can attach the full patch here).Environment
microck/kagi)