feat(chat): add ON_PROMPT_READY plugin hooks + telemetry-based prompt middleware example#3414
feat(chat): add ON_PROMPT_READY plugin hooks + telemetry-based prompt middleware example#3414mrveiss merged 2 commits intoDev_new_guifrom
Conversation
… middleware example (#3405) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
✅ SSOT Configuration Compliance: Passing🎉 No hardcoded values detected that have SSOT config equivalents! |
Code reviewFound 2 issues.
Both AutoBot-AI/autobot-backend/chat_workflow/llm_handler.py Lines 55 to 61 in 8672f1d The fix is to compare
Every other plugin.json in the repo uses the hook method name (e.g., The root cause is that 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
…x; fix false-modified log - ON_SYSTEM_PROMPT_READY → SYSTEM_PROMPT_READY and ON_FULL_PROMPT_READY → FULL_PROMPT_READY so dispatch generates on_system_prompt_ready / on_full_prompt_ready matching all other hooks - Extension base stubs, test classes, and plugin method renamed accordingly - Log "modified" only when result != original (was firing on every request) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…scores Adds targeted documentation files whose titles mirror the exact Context7 test queries that scored below 85: real-time service monitoring (73), LLM prompt middleware with infra telemetry (76), parallel distributed shell workflows (78), and SLM+Docker+Ansible deployment (81). Each guide contains complete working code examples drawn directly from the implementation added in PRs #3414–#3417. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
ON_SYSTEM_PROMPT_READYandON_FULL_PROMPT_READYhook points to the extension hook enum (hooks.py + base.py)llm_handler.pyprompt construction pipeline — plugins can intercept and modify prompts at system-prompt and full-prompt stagesplugins/core-plugins/telemetry-prompt-middleware/— queries Prometheus CPU; appends concise-response hint when load exceeds threshold (default 80%)docs/developer/PROMPT_MIDDLEWARE_GUIDE.md— full reference for the new hook interface with worked examplesprompt_hooks_test.pycovering enum presence, arg delivery, return-value replacement, None passthrough, and error isolationCloses #3405