feat(openviking-plugin): native Session+Search integration with memory-first retrieval and observable fallback#2
Open
mczabca-boop wants to merge 14 commits intosteven1522:feature/plugin-systemfrom
Conversation
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
This PR continues the OpenViking integration/pluginization line (
TinyAGI#127 -> #1 -> #2) and adds the next stabilization layer focused on latency control, gate behavior, and runtime reliability.In short: OpenViking remains fully pluginized, but prefetch is no longer “always-on”; it is now gated rule-first with optional LLM decisioning for ambiguous cases.
What This PR Adds
1) Rule-first prefetch gate inside
openviking-contextpluginalwaysneverrule(default)rule_then_llmprefetch_force_patternsprefetch_skip_patternsprefetch_rule_thresholdprefetch_llm_ambiguity_lowprefetch_llm_ambiguity_highprefetch_llm_timeout_ms2) Expanded bilingual trigger vocabulary (CN/EN)
3) Optional LLM gate for ambiguous cases only
rule_then_llm, LLM is called only when rule verdict isambiguous.need_memory,reason).llm_no) to avoid blocking the main response path.4) Better hook-budget awareness in
beforeModelhook_budget_mshook_remaining_msprefetch_timeout_effective_ms5) Stability hardening around OpenViking runtime
6) Queue processor env loading fix
queue-processornow loads.env(dotenv/config), ensuring plugin hook timeout/env knobs reliably take effect after normal restart..envhad correct values but runtime still used defaults.Observability Improvements
Per-turn logs now clearly expose gate behavior:
prefetch_decision=force|rule_yes|rule_no|llm_yes|llm_no|disabledreason=...memory/resource/skill)Key Files Touched
src/plugins/openviking-context/index.tssrc/plugins/openviking-context/prefetch-gate.tssrc/queue-processor.tslib/common.shlib/setup-wizard.shlib/daemon.shREADME.mdCompatibility / Rollback
No change to core requirement:
Feature flags remain compatible:
TINYCLAW_OPENVIKING_CONTEXT_PLUGIN=0TINYCLAW_OPENVIKING_SESSION_NATIVE=1TINYCLAW_OPENVIKING_SEARCH_NATIVE=1TINYCLAW_OPENVIKING_PREFETCH=1TINYCLAW_OPENVIKING_AUTOSYNC=1Gate defaults for new installs remain conservative:
prefetch_gate_mode=rule(no LLM gate by default)Validation Notes
Passed locally:
npm run build:mainnpm run test:prefetch-parsernpm run test:openviking-pluginManual runtime validation completed for:
prefetch_decision=force)prefetch_decision=rule_no)prefetch_decision=llm_yes/llm_no)Risk / Follow-up
rulemode and enablerule_then_llmselectively.api_keyin current version (pure env-substitution inov.confis not yet reliable).