Skip to content

Refactor/decouple main session#71

Merged
Ec3o merged 43 commits into
mainfrom
refactor/decouple-main-session
Jun 2, 2026
Merged

Refactor/decouple main session#71
Ec3o merged 43 commits into
mainfrom
refactor/decouple-main-session

Conversation

@Ec3o

@Ec3o Ec3o commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

What

How


Closes #

uchouT added 30 commits May 17, 2026 17:23
- Delete MainStorage interface; SessionStorage now carries listSessions.
- Remove TopologyNode from session package (lives in core).
- Drop getAllSessionL2s / putNode / getChildren / removeNode / getGlobal / putGlobal.
- InMemoryStorageAdapter now implements SessionStorage only.
- Update CreateMainSessionOptions / LoadMainSessionOptions to use SessionStorage.
- Stub createMainSession.integrate() child collection; file is deleted in Task 3.
- Skip MainSession integrate() / synthesis-from-integrate tests; will be removed in Task 3.
* docs: add shared memory design spec

* docs: clarify shared memory release plan — bundle into unpublished release

* docs: add shared memory implementation plan

* feat(core): define SharedMemoryStore interface and SharedMemoryEntry type

* feat(core): add InMemorySharedMemoryStore with writeLock serialization

* feat(core): add renderSharedMemoryIndex

* feat(core): expose sharedMemory config and four SDK methods on StelloAgent

* style(core): match requireStorage Chinese error pattern and add semicolons in shared memory SDK

* feat(core): add stello_memory_recall builtin tool

* feat(core): add stello_memory_remember builtin tool

* feat(core): add stello_memory_forget builtin tool

* feat(session): add sharedMemoryIndex slot in context assembly

* feat(core): inject sharedMemoryIndex on every session.send via adapter

* refactor(core): drop legacy MemoryEngine and FileSystemMemoryEngine

删除 MemoryEngine 接口、FileSystemMemoryEngine 实现及其测试目录。
从 StelloAgentConfig、StelloEngineOptions、DefaultEngineFactoryOptions、
StelloEngine 接口、index.ts 公开导出中移除所有 memory 字段和相关类型引用。
保留 TurnRecord / AssembledContext(仍被 EngineLifecycleAdapter 和 BootstrapResult 使用)。

* feat(core): export SharedMemoryStore types, InMemorySharedMemoryStore, and three tool factories

* test(core): add end-to-end test for shared memory index injection

* docs(core): refresh agent-creation skill for shared memory and document resolver caveat

* feat(core): re-export TurnRecord and AssembledContext for downstream lifecycle implementers
* feat(session): add optional compression cache persistence to SessionStorage

* refactor(session): address review — add clear method, Chinese JSDoc, type-level tests

* feat(session): add hydrate/flush helpers for compression cache persistence

* refactor(session): address review — fire-and-forget flush + warn on cache errors

* feat(session): hydrate compression cache from storage at session startup

* refactor(session): document hydrate race edge case; improve hydration test stub

* feat(session): flush compression cache to storage after compress

* refactor(session): extract compression flush helper; skip redundant cache-hit writes

* test(session): end-to-end hydrate/flush cycle for compression cache

* refactor(session): address review — move e2e test, strengthen hydrate assertion

- Move 'flushed snapshot from one session is hydrated by the next' out of
  'compress persistence — flush after success' into a new sibling describe
  block 'end-to-end: flush ↔ hydrate cycle', with its own warn-spy guard.
  The test exercises the full hydrate+flush round-trip across two session
  instances and is the only test touching hydrateCompressionCache from
  this side; co-locating it with flush-only tests was misleading.

- Strengthen the bonus assertion from a 'sessionB.send resolves' smoke
  check to a meaningful claim about hydrate consumption:
  compressFnB is now a vi.fn() spy and we assert at most one call.

  The stricter 'compressFnB NOT called' assertion is not achievable in
  this end-to-end setup because cache-hit keys on
  compressedCount === compressCount, and the recentBudget computation
  uses ESTIMATED_SUMMARY_TOKENS (500) when compressionCache is null
  (Session A's first send) vs. the actual hydrated summary length
  (Session B after hydrate) — yielding different compressedCount values
  and thus a forced cache miss on Session B's first send. This is an
  inherent property of the current cache key, not a wiring bug.
  Inline comment explains the trade-off.

* test(session): drop non-discriminating compress call assertion from e2e

* refactor(session): drop unused clearCompressionCache optional method

* test(session): replace any with SessionStorage typings to satisfy lint

测试中 16 处 `any` 改为 `SessionStorage` / `CompressionCacheSnapshot`,并删除未使用的 sessionB 变量。无运行时行为变化。
uchouT and others added 13 commits May 22, 2026 19:00
* feat(core): add renderTopologyMarkdown with you-are-here marker

* feat(session): add topologyContext to SessionSendOptions and assembleSessionContext

* fix(session): also inject topologyContext in tool-result replay path

* feat(core): add topologyContextProvider to session adapter

* feat(core): topologyContextDecorator and default topology provider in StelloAgent

* feat(core): add label option to DefaultFnOptions for compress/consolidate
stepFun/DeepSeek 等推理模型在 tool call 场景的多轮对话中,
要求历史 assistant 消息必须包含原始的 reasoning_content,
否则 API 返回 400。

- Message/LLMResult/LLMChunk 增加 reasoningContent 字段
- OpenAI-compatible adapter 提取和回传 reasoning_content
- Session 层持久化 reasoningContent 到 assistant 记录
- 新增 3 个 adapter 测试覆盖 round-trip

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…trip

feat(session): 支持推理模型 reasoning_content 多轮对话回传
…ontent-parts

feat: support multimodal content parts
@Ec3o Ec3o merged commit 631938d into main Jun 2, 2026
2 checks passed
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