Repository navigation
fix: bypass ReAct for knowledge-base intent (book button) — #209 Fix 1 - #210
Merged
Merged
Conversation
The menu slug was renamed from wp-agentic-admin to agentic-admin in #206, but three hook/screen-id checks still referenced the old slug. As a result, the dedicated admin page never enqueued the React app (empty page), and the sidebar diamond button incorrectly rendered on top of it. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
When the user enables the docs/book toggle, route directly to a new processWithDocSearch path instead of running the ReAct tool-selection loop. Small models (Qwen 3 1.7B in prompt-based JSON mode) hallucinate tool calls when no clear match exists — e.g. asking "what hook injects content in the footer?" with the book button on previously invoked role-capabilities-check or rewrite-list. The user's explicit RAG intent should win. New path runs an in-browser vector search, builds a context-augmented prompt, and streams a direct LLM answer with no tool selection. Respects the user's "disable thinking before tool" setting by appending /nothink, and still defensively strips <think> blocks (Qwen sometimes ignores the flag — same pattern as react-agent.js:241). Leaked thinking tokens, when thinking is enabled, route through the standard onThinkingStart/Chunk/End callbacks so they collapse into the thought-process timeline entry instead of leaking into the visible chat body. Falls back to a context-less conversational answer (still no tools) when the index is empty or the vector lookup fails — never silently re-routes into ReAct. Partially addresses #209 (Fix 1). Fixes 2 and 3 (post-hoc tool validation, soften read-file priming) tracked separately in the same umbrella issue. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
4 tasks
Auto-load paths called modelLoader.isModelCached() and modelLoader.load() without arguments, falling back to DEFAULT_MODEL (Qwen3-1.7B) regardless of the user's saved selection. Now reads agentic_admin_model from localStorage and passes it through. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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
Why
Qwen 3 1.7B (the default model, prompt-based JSON mode) hallucinates tool calls when no tool clearly matches. With the book button on, the user has stated their intent — fishing for tools is wrong.
Repro (before): book button on + "Whats the hook that allows me to inject content in the footer?" → invokes `role-capabilities-check` or `rewrite-list`.
After: routes to doc-search, no tool call, clean conversational answer.
Partially addresses #209 (Fix 1 of 3). Fix 2 (post-hoc tool validation) and Fix 3 (soften read-file priming) tracked in the same umbrella.
Notes
Test plan
🤖 Generated with Claude Code