Skip to content

fix(memory): enable agent memory save via MCP tools + builtin stream guard - #10887

Merged
diegosouzapw merged 2 commits into
release/v3.8.50from
fix/9115-memory-mcp-tools-extract
Aug 20, 2026
Merged

diegosouzapw merged 2 commits into
release/v3.8.50from
fix/9115-memory-mcp-tools-extract

Conversation

@diegosouzapw

Copy link
Copy Markdown
Collaborator

Clean extraction of #9115's value commit (by @Egorich-print), whose branch had accumulated 66 commits over 3 weeks — mostly already-merged release history (ChatGPT Web provider, Devin provider, i18n ru, dashboard param-filter fixes, CI changes, Vertex error classifier, etc, all shipped separately). Only ONE commit matched the PR's stated title/scope.

Original commit preserved verbatim, with one exception: the bundled toFts5MatchQuery import fix was dropped — it depends on a separate ftsQuery.ts extraction commit (from earlier in the same 66-commit branch) that was never merged and doesn't exist on the current release tip. That FTS5 sanitizer work is out of scope for this PR's title and can be a separate follow-up if still needed.

Summary

  • memoryTools: apiKeyId is now optional; falls back to the caller principal (HTTP auth headers / OMNIROUTE_API_KEY env) so agents can store memory without knowing their key id.
  • memorySkillsInjection: server-side memory_* builtins are only injected for non-stream requests (stream clients execute tools client-side via MCP).
  • memoryBuiltins (new): memory_save/update/search/delete builtin tools with per-provider schemas + interception dispatch.
  • Tests: MCP auto-owner fallback, cross-principal isolation, stream guard.

Validation

  • npm run typecheck:core — clean
  • node scripts/check/check-file-size.mjs / check-changelog-integrity.mjs — OK
  • tests/unit/skills-memory-builtins.test.ts + tests/unit/chatcore-memory-skills-injection.test.ts — 19/19 passing
  • tests/integration/memory-pipeline.test.ts — 14/14 passing

Co-authored-by: Egor egorich-print@users.noreply.github.com

Egorich-print and others added 2 commits August 20, 2026 17:12
…stream guard

- memoryTools: apiKeyId now optional; falls back to caller principal
  (HTTP auth headers / OMNIROUTE_API_KEY env) so agents can store memory
  without knowing their key id
- memorySkillsInjection: server-side memory_* builtins only injected for
  non-stream requests (stream clients execute tools client-side via MCP)
- memoryBuiltins: memory_save/update/search/delete builtin tools with
  per-provider schemas + interception dispatch
- retrieval: fix toFts5MatchQuery import (ReferenceError on FTS5 path)
- tests: MCP auto-owner fallback, cross-principal isolation, stream guard
Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
@diegosouzapw
diegosouzapw merged commit 8718328 into release/v3.8.50 Aug 20, 2026
7 of 10 checks passed
@diegosouzapw
diegosouzapw deleted the fix/9115-memory-mcp-tools-extract branch August 21, 2026 15:33
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…guard (cheaper-inference#10887)

Merged — clean single-commit extraction from cheaper-inference#9115's genuinely new content (see PR body for the full extraction rationale: 66-commit branch, only 1 commit matched the stated scope). typecheck/file-size/changelog gates clean, 19/19 unit + 14/14 integration tests passing.
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.

2 participants