Skip to content

[WIP] session.commit时做一个自动拆分,保护记忆提取不超过模型上下文#2431

Draft
chenjw wants to merge 4 commits into
mainfrom
feat/memory_token_budget
Draft

[WIP] session.commit时做一个自动拆分,保护记忆提取不超过模型上下文#2431
chenjw wants to merge 4 commits into
mainfrom
feat/memory_token_budget

Conversation

@chenjw
Copy link
Copy Markdown
Collaborator

@chenjw chenjw commented Jun 4, 2026

Description

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 chenjw marked this pull request as draft June 4, 2026 06:32
@chenjw chenjw changed the title [feat] session.commit是做一个自动拆分,保护记忆提取不超过模型上下文 [WIP] session.commit是做一个自动拆分,保护记忆提取不超过模型上下文 Jun 4, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 4, 2026

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
🏅 Score: 85
🧪 PR contains tests
🔒 No security concerns identified
✅ No TODO sections
🔀 Multiple PR themes

Sub-PR theme: Add monorepo/git script examples

Relevant files:

  • scripts/monorepo_demo.py
  • scripts/monorepo_packed_vectors.py
  • scripts/monorepo_with_vectors.py
  • scripts/shared_git_repo.py
  • scripts/init_git_repo.py
  • scripts/custom_object_store_demo.py

Sub-PR theme: Add snapshot/versioning API and documentation

Relevant files:

  • openviking/server/routers/snapshot.py
  • tests/test_dulwich.py
  • tests/misc/test_vikingfs_git_snapshot.py
  • docs/design/versioning-api-design.md
  • docs/design/versioning-git-scheme.md
  • docs/design/snapshot-openapi.yaml
  • docs/monorepo-vs-polyrepo.md

⚡ Recommended focus areas for review

Redundant code in _build_phase_updater_factory

The _build_phase_updater_factory method has redundant code where both branches (checking for provider._get_registry) return identical CallableUpdaterFactory instances. This can be simplified to avoid duplication.

if not hasattr(provider, "_get_registry"):
    return CallableUpdaterFactory(
        updater_cls=_GenericMemoryPhaseUpdater,
        factory=lambda shared_context: _GenericMemoryPhaseUpdater(
            memory_updater=self._create_updater(registry, transaction_handle),
            post_apply=post_apply,
        ),
    )

return CallableUpdaterFactory(
    updater_cls=_GenericMemoryPhaseUpdater,
    factory=lambda shared_context: _GenericMemoryPhaseUpdater(
        memory_updater=self._create_updater(registry, transaction_handle),
        post_apply=post_apply,
    ),
)

@chenjw chenjw changed the title [WIP] session.commit是做一个自动拆分,保护记忆提取不超过模型上下文 [WIP] session.commit时做一个自动拆分,保护记忆提取不超过模型上下文 Jun 4, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 4, 2026

PR Code Suggestions ✨

No code suggestions found for the PR.

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