Skip to content

【WIP,测试中,先别通过】Feature/memory opt#1159

Open
chenjw wants to merge 15 commits intomainfrom
feature/memory_opt
Open

【WIP,测试中,先别通过】Feature/memory opt#1159
chenjw wants to merge 15 commits intomainfrom
feature/memory_opt

Conversation

@chenjw
Copy link
Copy Markdown
Collaborator

@chenjw chenjw commented Apr 1, 2026

Description

  1. 遥测系统增强 (openviking/telemetry/)
  • 新增 tracer.py (542行) - 完整的追踪系统
  • init.py 中添加遥测初始化
  • 修复:添加 span ended 检查和 AsyncioInstrumentor 支持后台任务
  1. 内存系统优化 (openviking/session/memory/)
  • 重构 URI 处理和内存提取逻辑 (utils/uri.py)
  • 改进 memory_updater.py (78行变更)
  • 优化 extract_loop.py 和 tools.py
  • 新增 memory events 模板 (prompts/templates/memory/events.yaml)
  1. 会话支持 (openviking/session/, openviking/client/session.py)
  • 新增 created_at 支持 for add_message
  • 优化 compressor_v2.py
  1. VLM 后端更新
  • 统一调整 litellm_vlm.py, openai_vlm.py, volcengine_vlm.py 后端
  1. 配置与 CLI
  • 新增 telemetry 配置 (telemetry_config.py)
  • 更新 open_viking_config.py

Related Issue

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test update

Changes Made

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this on the following platforms:
    • Linux
    • macOS
    • Windows

Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Screenshots (if applicable)

Additional Notes

chenjw and others added 5 commits March 30, 2026 21:37
Bot proxy endpoints (/chat, /chat/stream) previously required auth
unconditionally, while other endpoints like /find use get_request_context
which allows dev mode without API keys. This caused inconsistent behavior
where ov find worked but ov chat failed with 401.

Now bot endpoints use the same get_request_context dependency for
consistent auth behavior across all endpoints.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Update URI utilities for better path handling
- Improve memory type registry and updater
- Enhance session extraction context provider
- Update memory prompt templates

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- bot/ov_server.py: pass message timestamp to session.add_message()
- client/session.py: pass created_at to underlying client
- sync_client.py: add created_at parameter to add_message()

When created_at is not provided, the server will use current time.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ground tasks

- Add end_time check in tracer.info/set/error to avoid "Tried calling _add_event on an ended span"
- Add AsyncioInstrumentor to auto-create child spans for asyncio.create_task
- Add @tracer decorator to _run_memory_extraction for background task tracing
- Add opentelemetry-instrumentation-asyncio dependency

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

Failed to generate code suggestions for PR

chenjw and others added 4 commits April 1, 2026 22:21
The openviking/telemetry/langfuse.py was not being imported anywhere
in the openviking package. Project uses bot/vikingbot/integrations/langfuse.py
instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@chenjw chenjw requested review from qin-ctx and zhoujh01 April 2, 2026 04:50
chenjw and others added 2 commits April 2, 2026 13:18
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove unused sys import
- Sort import block alphabetically
- Remove unused span variable

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@chenjw chenjw changed the title Feature/memory opt 【WIP】Feature/memory opt Apr 2, 2026
- 合并两个方法,统一模板渲染逻辑
- 添加extract_context参数支持模板渲染
- 添加[content_template]日志标签用于调试events渲染问题

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@chenjw chenjw changed the title 【WIP】Feature/memory opt 【WIP先别通过】Feature/memory opt Apr 2, 2026
@chenjw chenjw changed the title 【WIP先别通过】Feature/memory opt 【WIP,测试中,先别通过】Feature/memory opt Apr 2, 2026
chenjw and others added 3 commits April 2, 2026 16:25
1. tools.py: 导入缺失的 truncate_content 函数和 ToolContext 类型
2. tools.py: 修复 f-string 无占位符的问题
3. test_memory_utils.py: 删除引用不存在函数的测试

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This reverts commit ede6192.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant