deerflow2/backend/packages/harness/deerflow
ly-wang19 579e416459
perf(runtime): index messages in MemoryRunEventStore to avoid O(n) scans (#3531)
list_messages re-scanned every event in the thread on each call (category
filter + seq filter) — O(total events) per paginated request on the default
run-events backend. Maintain a messages-only, seq-sorted projection of _events
(shared dict refs, no copies) and locate the seq window with bisect:
list_messages drops to O(log m + page) and count_messages to O(1). The index is
kept in lockstep at every mutation site (put / put_batch via _put_one,
delete_by_run, delete_by_thread).

Externally observable behavior is unchanged — the full RunEventStore contract
suite passes across memory/db/jsonl.

Add a test covering pagination over non-contiguous message seqs (messages
interleaved with trace events), including in-gap and exact-boundary cursors.

Co-authored-by: ly-wang19 <ly-wang19@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-12 22:58:30 +08:00
..
agents chore(todo): remove unused completion reminder counter (#3530) 2026-06-12 22:48:47 +08:00
community feat(community): add SearXNG and Browserless web search/fetch tools (#3451) 2026-06-12 09:45:26 +08:00
config feat(im): Add user-owned IM channel connections (#3487) 2026-06-12 15:24:58 +08:00
guardrails feat(guardrails): add pre-tool-call authorization middleware with pluggable providers (#1240) 2026-03-23 18:07:33 +08:00
mcp fix(mcp): close stdio sessions on their owning loop to avoid cross-task cancel-scope error (#3379) (#3392) 2026-06-07 21:37:30 +08:00
models feat(models): add StepFun reasoning model adapter (#3461) 2026-06-09 18:01:43 +08:00
persistence feat(im): Add user-owned IM channel connections (#3487) 2026-06-12 15:24:58 +08:00
reflection refactor: split backend into harness (deerflow.*) and app (app.*) (#1131) 2026-03-14 22:55:52 +08:00
runtime perf(runtime): index messages in MemoryRunEventStore to avoid O(n) scans (#3531) 2026-06-12 22:58:30 +08:00
sandbox fix(sandbox): persist lazily-acquired sandbox state via Command (#3464) 2026-06-11 17:50:36 +08:00
skills fix(skills): keep skill archive installation off the event loop (#3505) 2026-06-12 15:17:40 +08:00
subagents feat(subagents): extend deferred MCP tool loading to subagents (#3432) 2026-06-08 23:17:22 +08:00
tools feat(subagents): extend deferred MCP tool loading to subagents (#3432) 2026-06-08 23:17:22 +08:00
tracing fix(tracing): propagate session_id and user_id into Langfuse traces (#2944) 2026-05-21 16:49:31 +08:00
uploads fix upload file size contract (#3408) 2026-06-06 15:12:17 +08:00
utils fix(skills): harden slash skill activation across chat channels (#3466) 2026-06-09 23:07:17 +08:00
__init__.py refactor: split backend into harness (deerflow.*) and app (app.*) (#1131) 2026-03-14 22:55:52 +08:00
client.py feat(memory): add memory.token_counting config to avoid tiktoken network dependency (#3429) (#3465) 2026-06-10 23:26:15 +08:00