Skip to content

v4.17.0

Choose a tag to compare

@rodrigoslayertech rodrigoslayertech released this 17 Jul 01:42
· 72 commits to main since this release
v4.17.0
a3a7ea6

Focus: the assistant no longer reads the reader's page over their shoulder — attaching it is now a choice, and a visible one.

Changes

  • 💬 Added a Page context chip to the assistant composer. When it is on, the current page's Markdown is attached to the prompt verbatim; when it is off, it is not. It is off by default, and the choice is remembered per browser under docsector.assistant.context.v1. Until now every prompt carried up to 7000 characters of the current page whether the question was about it or not, spending the model's context window on text nobody asked for.
  • ⚡ The endpoint now skips the asset fetch entirely when the chip is off — up to three ASSETS subrequests saved per prompt, so requests are cheaper and faster, not merely shorter.
  • 🎯 Added a self-describing form for suggested prompts: an entry may be { text: 'Summarize this page.', pageContext: true } to mark a prompt that only makes sense with the page attached. Clicking it turns the chip on, so the reader can see why. Plain strings keep working in the same list, and the engine's own default now carries the flag.
  • 🔒 The endpoint now caps context.title, locale and route.path before they reach the system prompt. The request payload is shaped in the browser, so those fields were untrusted and uncapped (only the text selection was bounded).
  • 🛠️ Fixed $&, $` and $' in a project's config corrupting the generated endpoint and MCP server: String.replaceAll interpolates those patterns in the replacement, so a suggested prompt like 'What does $& mean?' emitted the placeholder token into the generated file. Latent until now, and more reachable with richer prompt config.
  • 🧹 Removed a dead context.request branch in the endpoint. It was unreachable, but it fed the URL that performs the same-origin check on page-markdown candidates, so a future reordering would have handed that check to the caller.
  • 🌍 Replaced the decorative assistant.context label with assistant.pageContext.{label,on,off} in both locales. Off does not hide the page from the assistant — retrieval still covers your whole index — so the wording is "attach", never "exclude".
  • 📚 Updated the AI Assistant manual page in both locales, plus the README and the project scaffold.
  • ✅ Validated with 310 passing tests (21 new), including the first coverage of the generated endpoint: the template is imported with its config placeholder supplied, then driven with a fake ASSETS binding to assert the subrequest never happens when the chip is off, and that the page title and text selection still ship.

Notes

  • Behavior change: the assistant now answers from the retrieval index unless the reader attaches the page. Vague questions ("what does this mean?") get better once the chip is on. The chip is always visible in the composer and the choice sticks, so it is a one-time click for readers who always want it.
  • A request that omits the flag still gets the page. The only client that omits it is a browser bundle cached from before 4.17, which has no chip to click — so it keeps the behavior it shipped with. This is a compatibility shim; the default is off and it lives in the browser.
  • Projects that overrode assistant.context in their language files can drop it — the key is no longer read. The object form of suggestedPrompts requires 4.17.0; older versions ignore object entries.