Keep shared-interaction evidence, pagination, and token truncation accurate while bounding anchor inputs, proximity scans, contact discovery, and reply aggregation. Resolve participants across all imported history and isolate damaged database candidates without changing the final analysis tree.
Use the all-history contact snapshot and validate raw session candidates inside the cancellable scan loop. Bound model-visible structural results to the configured token budget while preserving full tool details and continuation metadata.
Count complete tool payloads with the runtime tokenizer so Chinese evidence respects the configured model context budget.\n\nResolve contact sources incrementally with cancellation checks and targeted member lookups to keep long cross-chat investigations responsive.
Make unscoped candidate preparation honor cancellation and wall-time limits before message scanning. Enumerate database files lazily, retain only the newest eligible sessions, and resolve owners without loading full member statistics.
Use the all-history contacts snapshot when translating stable contact references into cross-chat scopes, so older source sessions are not silently excluded from historical analysis.
Replace message content and structured user entity references in one database statement. Treat omitted references as an explicit clear so edited prompts cannot replay stale identities.
Prevent generic assistant or summary writes from persisting structured entity references. Keep compressed-summary references on the dedicated internal path and ignore malformed assistant references during replay and compression.
Keep the shared runtime in tool_running until every concurrent call finishes. Route renderer progress and completion by toolCallId so one result cannot hide another active tool.
Show a retry-only state when summary index reads fail so transient errors cannot expose the full rebuild action and erase summaries. Also align newly added implementation comments with repository style.
Match ownerless QQ exports safely across UID and UIN drift, preserve merged message scopes through single and batch imports, and apply only sender mappings proven by overlapping platform message IDs. Reject incomplete group mappings to avoid member identity corruption.
Carry owner metadata through merge exports when every source agrees and the owner resolves to a merged member. Drop conflicting or unmappable owner identifiers.
Keep one-member private exports source-local until exact message overlap proves they belong to the same chat. This prevents unrelated outgoing-only chats from losing messages when platform IDs collide.
Record background preload polling failures with the original Error and clarify that logging review severity and tests should follow user impact rather than mechanical rules.