Skip to content

Opt-in web-augmented Explain (:online) + Markdown in Suggest "why" - #75

Merged
kocaemre merged 1 commit into
developfrom
feat/ai-web-and-suggest-md
Jun 22, 2026
Merged

Opt-in web-augmented Explain (:online) + Markdown in Suggest "why"#75
kocaemre merged 1 commit into
developfrom
feat/ai-web-and-suggest-md

Conversation

@kocaemre

Copy link
Copy Markdown
Owner

Summary

Two AI-panel enhancements requested after the beta.18 review. (The third idea — game-plan effort/difficulty labels — is intentionally deferred to a later beta.)

1. Opt-in web-augmented Explain (:online)

OpenRouter runs a live web search when the model id carries a :online suffix — handy for "is there a current CVE / exploit / Metasploit module for this version?". Surfaced as a deliberate, per-call "Search web" button next to Explain, shown only when the provider is OpenRouter.

  • Never ambient. The proxy appends :online only when an explicit web: true arrives and the provider is OpenRouter. No global toggle, one click at a time.
  • Honest about egress. This sends scan-derived search queries off-host, so the button carries an egress warning, the panel header marks :online · 🌐 web, and the disclaimer notes a live search ran. Off by default; hidden under Exam Mode (AI is fully gated there anyway).
  • Cost is visible. The :online model is recorded verbatim in the usage ledger, so its notably higher cost (web search + larger context — ~3k input tokens vs ~220 in testing) shows up as its own row in /settings/usage. No schema change.
  • Suggest stays KB-grounded — web is Explain-only, by design.

2. Markdown in the Suggest card "why"

The suggestion rationale rendered raw, so backticked flags/paths and emphasis showed literally. Now rendered with the existing Markdown component — consistent with the Explain/Summary panels.

Testing

  • npm test612 passing; npm run typecheck, npm run lint:kb, npm run build — all clean.
  • Verified live (HTB Lame, real data): the "Search web" button appears only on OpenRouter; a web-augmented Explain returns content and records openai/gpt-4o-mini:online at ~$0.0056 vs ~$0.0001 for the plain call; the panel header shows :online · 🌐 web; and the Suggest "why" renders Markdown (no raw **).

🤖 Generated with Claude Code

…t "why"

Two small AI-panel enhancements (beta-test follow-ups):

1. Opt-in web search. OpenRouter runs a live web search when the model id
   carries a `:online` suffix — useful for "any current CVE/exploit for this
   version?". Added as a deliberate, per-call "Search web" button on Explain
   (next to Explain), shown ONLY on OpenRouter. The proxy appends `:online`
   only when an explicit `web: true` arrives AND the provider is OpenRouter, so
   it's never ambient. The panel header marks `:online · 🌐 web` and the
   disclaimer notes a live search ran. The `:online` model is recorded verbatim
   in the usage ledger, so its (notably higher) cost shows up distinctly in
   /settings/usage — no schema change. Suggest stays KB-grounded (no web).
   Egress note: this sends scan-derived queries off-host; it's off by default,
   one click at a time, and hidden under Exam Mode (AI is fully gated there).

2. Render Markdown in the Suggest card "why" text (reuses the existing Markdown
   component), so backticked flags/paths and emphasis render instead of showing
   raw — consistent with the Explain/Summary panels.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WDoCrduJx7h9Dv8XaTqrSr
@kocaemre
kocaemre merged commit aec4b13 into develop Jun 22, 2026
3 checks passed
@kocaemre
kocaemre deleted the feat/ai-web-and-suggest-md branch June 22, 2026 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant