Skip to content

Comments

feat(openviking-plugin): native Session+Search integration with memory-first retrieval and observable fallback#2

Open
mczabca-boop wants to merge 4 commits intosteven1522:feature/plugin-systemfrom
mczabca-boop:feat/openviking-on-pr1-base
Open

feat(openviking-plugin): native Session+Search integration with memory-first retrieval and observable fallback#2
mczabca-boop wants to merge 4 commits intosteven1522:feature/plugin-systemfrom
mczabca-boop:feat/openviking-on-pr1-base

Conversation

@mczabca-boop
Copy link

Summary

This PR integrates TinyClaw with OpenViking native architecture (Session + Memory + Search), while keeping a safe rollback path to legacy markdown retrieval/writeback.

This PR is stacked on #1 and functionally continues the OpenViking direction from TinyAGI#127.

What this PR adds

  • Native OpenViking session lifecycle as primary write path
    • Create/reuse session
    • Write user/assistant messages to session
    • Commit on reset/session-end
  • Native OpenViking search as primary prefetch path
    • Prefer typed retrieval from memory/resource/skill
    • Memory-first composition for injected context
    • Structured short snippets instead of large raw turn blocks
  • Persistent local session mapping
    • (channel, senderId, agentId) -> openviking_session_id
  • Compatibility fallback retained
    • Legacy markdown (active.md / closed/*.md) remains available and explicitly logged
  • Better observability
    • Session write/commit success/failure logs
    • Retrieval hit distribution by type
    • Explicit fallback reason logging
    • Native prefetch dump for debugging (prefetch_dump_native_latest.txt)

Setup and runtime improvements

  • Setup flow improved for OpenViking usage
    • OpenViking enablement flow in setup
    • OpenViking config bootstrap updates
    • OpenAI-based OpenViking path emphasized in current flow
  • Startup/runtime hardening
    • OpenViking startup checks and safer defaults
    • Timeout handling improvements for prefetch/commit paths

Key files touched

  • src/queue-processor.ts
  • src/tools/openviking-tool.ts
  • src/lib/openviking-prefetch.ts
  • src/lib/openviking-session-map.ts
  • lib/templates/agent-tools/openviking/openviking-tool.js
  • lib/setup-wizard.sh
  • lib/daemon.sh

Compatibility / rollback

  • Feature flags keep rollback straightforward:
    • TINYCLAW_OPENVIKING_SESSION_NATIVE=1
    • TINYCLAW_OPENVIKING_SEARCH_NATIVE=1
    • TINYCLAW_OPENVIKING_PREFETCH=1
    • TINYCLAW_OPENVIKING_AUTOSYNC=1
  • Disabling native flags falls back to prior behavior.

Validation notes

  • Build passes (npm run build:main)
  • End-to-end tests verified:
    • Session resolve/write/commit logs present
    • Native search hits include memory/resource/skill distribution
    • Reset + post-reset factual recall works from retrieved context
    • Fallback path remains explicit and observable

Risk / follow-up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant