* fix(semantic-index): stabilize embedding warmup
Improve warmup job reliability and prevent raw API response body from
reaching app.log. Status code alone is sufficient for diagnosing failures;
stripping the response detail eliminates the risk of chat content being
written to the log via OpenAI-compatible services that echo submitted input.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(semantic-index): clear preload error after warmup retry
When local model preload fails, a later warmup can successfully recreate the extractor through embedDocuments but leave modelPreloadStatus stuck on error.
Mark the local model ready after a completed warmup writes chunks, and cover the retry path with a regression test.
* fix(semantic-index): guard warmup model status updates
Capture the model configuration used by a warmup job before it starts, and only clear local preload errors when the current local model still matches that job.
Add a regression test for switching local models while an older warmup is still completing.
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Wait for initial contact rows before scrolling to groupmates so tab navigation does not land on temporary rows. Avoid writing contacts session facts or latest facts when a session DB fingerprint changes during computation.
Replace friend rows after manual friend promotion so response-layer overrides are reflected even when the contacts snapshot signature is unchanged. Keep preserving the groupmate rows after local removal to avoid scroll jumps.
Start stable desktop update downloads in the background during automatic checks, then prompt only after the update is ready to install.
Keep manual update checks interactive so users still confirm the download after explicitly checking.
Return a recorded SOCKS proxy before a fallback DIRECT rule so local model downloads fail explicitly instead of silently bypassing the configured system proxy.
Make desktop proxy saves await Electron session proxy application before model download proxy resolution.
Resolve HTTP, HTTPS, and SOCKS system proxy rules for semantic index model downloads while preserving DIRECT precedence.
Pass a model download proxy through the semantic index worker and local embedding provider so local Hugging Face downloads use the effective proxy.
Restart idle local workers when the proxy changes before preload, build, or search calls, and initialize app logging inside the worker process for preload diagnostics.
Combine the PR review fixes for push import validation, deduplication, system sender handling, and pull import lock scoping into one reviewable change.
- Change default port from 5200 to 3110 in sync config-manager, Vue store,
and settings UI to match CLI DEFAULT_API_PORT
- Desktop API server now tries up to 10 consecutive ports when preferred
port is occupied (e.g. CLI already running); reports actual bound port
- Scope Desktop import route lock to session (Set<string>) matching the
push-importer fix
- Docs: remove unimplemented JSONL/X-Dry-Run claims, fix port references,
replace platform-specific examples with generic ones
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Reject path-traversal sessionIds (SAFE_SESSION_ID_RE)
- Reject X-Dry-Run header with 400 instead of silently writing
- Propagate DataDirCompatibilityError as 409 instead of swallowing to 500
- Scope concurrency lock to session instead of process-wide boolean
- Fix hash dedup hole: load hashes for ALL existing messages, not just
those without platformMessageId
- Fix backfill segment index: detect when written timestamps predate the
existing tail and use full generateSessionIndex rebuild instead of
incremental; apply same fix to shared incremental-importer used by
Desktop and pull sync
- Validate member platformId, message content/platformMessageId types, and
option enum values in validatePayload before any writes
- Use writeParseResultToDb in fullImport to populate member_name_history;
pre-deduplicate messages before delegating and auto-create minimal members
for senders absent from the members list
- Add content-hash to existingKeys when accepting a pmid-keyed row so a
same-content no-pmid copy later in the same batch is caught
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Removes the legacy apps/cli/src/import/importer.ts (hand-rolled FTS, dedup,
session-ID generation) and apps/cli/src/import/chatlab-reader.ts (buffered
in-memory JSON/JSONL parser). DirectImporter in sync/adapters.ts now calls
streamImport / incrementalImport from stream-import.ts, which use the
@openchatlab/parser streaming pipeline and node-runtime shared logic.
Changes:
- Add sessionId? to StreamImportOptions so callers can fix the target session
ID instead of auto-generating one (needed by pull engine full-import path)
- Rewrite DirectImporter.incrementalImportFile and fullImportFile to use
the shared importers; map IncrementalImportResult fields to ImportResult
- Remove legacy exports from apps/cli/src/import/index.ts
- Rewrite importer.test.ts to use streamImport + a temp ChatLab JSON file
(same two data-dir compatibility gate assertions as before)
- Delete importer.ts and chatlab-reader.ts
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Session index is now built inside the shared incremental-importer, so the
explicit post-import worker.generateIncrementalSessions(sessionId) calls in
the Desktop layer were no-ops. Remove all four call sites.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Correct default port from 5200 to 3110 (matches DEFAULT_API_PORT in config)
- Replace platform-specific example identifiers with generic ones to avoid
trademark concerns; update session IDs, member IDs, and groupId format
- Add a copyable quick-test curl snippet to the import protocol doc (cn + en)
- Expose lastPlatformMessageId and importedAt in sessions/:id doc example
- Remove brand-name references from platform field descriptions in
chatlab-format.md (kept valid platform identifiers in the enum table)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Session index (segment/message_context tables) was previously generated
inconsistently: CLI used postImportHook, Desktop relied on a separate
explicit RPC call, and the CLI sync/pull legacy importer never built it.
Move generateSessionIndex / generateIncrementalSessionIndex into the
shared importers (streaming-importer.ts, incremental-importer.ts) so
every caller gets it automatically. Remove the now-redundant calls from
CLI's postImportHook. Also add the calls to the legacy importer.ts used
by CLI sync/pull, which had no session index at all.
Incremental imports use generateIncrementalSessionIndex, which preserves
existing AI summaries. Full imports call generateSessionIndex only on
newly created sessions where no summaries exist.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Both fields are documented in chatlab-api.md but were missing from the
response. lastPlatformMessageId is used as the incremental import boundary.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements the Push Import protocol documented in chatlab-import.md.
Creates a new session on first call, appends and deduplicates on
subsequent calls (platformMessageId preferred, content hash fallback).
Adds IMPORT_IN_PROGRESS (409) and IMPORT_FAILED (500) error codes.
Includes a global concurrency lock and incremental session index
generation after each write.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- stream-json and stream-chain were used directly in GoogleChatTakeoutResolver
but not declared in node-runtime's package.json; fixes module resolution
failure in non-hoisted installs
- when detectFormat returns multiChat but scanMultiChatFile returns empty,
the code fell through to single-file import and could silently import the
first chat; now returns early with an error message in both cases
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>