Commit Graph
1 Commits
Author SHA1 Message Date
chenjwandDuTao c4cdb5fb1b Fix/bot Fix Memory Consolidation Issues and Integrate Vikingbot as OpenViking Optional Dependency (#492)
* fix

* add log

* add log

* update

* Opt memory

* Opt memory

* Opt memory

* Opt memory

* Fix memory consolidation issues: duplicate session write, hook error, and async

- Fix _consolidate_memory hook error by creating temporary Session when given message list
- Remove duplicate session save logic from _consolidate_memory (handled by caller)
- Make normal memory consolidation async like /new command
- Other fixes: streaming response in CLI and OpenAPI channel

* Integrate vikingbot as openviking optional dependency

- Add vikingbot dependencies to pyproject.toml optional-dependencies
- Update install prompts from vikingbot[X] to openviking[bot-X]
- Update README installation instructions
- Configure setuptools to find vikingbot in bot/ directory
- Add vikingbot package data and script entry

* Remove bot/pyproject.toml

vikingbot is now integrated as part of openviking, no need for separate pyproject.toml

* Update vikingbot installation instructions in root READMEs

- Update from 'uv pip install -e bot/' to 'uv pip install -e ".[bot]"'
- Add quotes around openviking[bot] for shell safety

* update

* Use singleton pattern for VikingClient in hooks

Cache VikingClient instances by workspace_id to avoid repeated client creation
- Add _client_cache dictionary for caching
- Add get_cached_client() helper function
- Update both hooks to use cached client

* Use global singleton for VikingClient instead of per-workspace cache

- Change from per-workspace_id cache to true global singleton
- Create client with None as agent_id (works for all workspaces)
- Simplify client management

* uv run ruff format

---------

Co-authored-by: DuTao <dutao.1786@bytedance.com>
2026-03-09 22:11:03 +08:00