mirror of
https://github.com/lobehub/lobehub.git
synced 2026-03-27 13:29:15 +07:00
* ♻️ refactor: use incremental diff for snapshot messages to prevent OOM Replace full messages/messagesAfter duplication per step with baseline + delta approach: - Step 0 and compression resets store full messagesBaseline - Other steps store only messagesDelta (new messages added) - Strip llm_stream events from snapshot (not useful for post-analysis) - Strip messages from done.finalState (reconstructible from delta chain) - Strip duplicate toolResults from context.payload - Reduce context_engine_result event size by removing messages and toolsConfig - Add reconstructMessages() utility for rebuilding full state from delta chain - AiAgentService constructor now accepts runtimeOptions for DI Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ♻️ refactor: add incremental toolset delta for snapshot - Store operationToolSet as toolsetBaseline in step 0 only (immutable) - Track activatedStepTools changes via per-step activatedStepToolsDelta - Strip operationToolSet/toolManifestMap/tools/toolSourceMap from done.finalState - Add reconstructToolsetBaseline() and reconstructActivatedStepTools() utilities Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🐛 fix: correct snapshot delta recording and restore context-engine output - P1: messagesDelta now always stores only appended messages (afterMessages.slice), fixing duplication when isBaseline was true (step 0 / compression reset) - P2: Restore context_engine_result.output (processedMessages) — needed by inspect CLI for --env, --system-role, and -m commands - Add P1 regression test for message deduplication Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>