Opt-in web-augmented Explain (:online) + Markdown in Suggest "why" - #75
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
:onlinesuffix — 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.:onlineonly when an explicitweb: truearrives and the provider is OpenRouter. No global toggle, one click at a time.:online · 🌐 web, and the disclaimer notes a live search ran. Off by default; hidden under Exam Mode (AI is fully gated there anyway).:onlinemodel 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.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
Markdowncomponent — consistent with the Explain/Summary panels.Testing
npm test→ 612 passing;npm run typecheck,npm run lint:kb,npm run build— all clean.openai/gpt-4o-mini:onlineat ~$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