@cortexkit/magic-context 0.49.49 → 0.49.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +36 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10457,6 +10457,7 @@ var init_magic_context = __esm(() => {
|
|
|
10457
10457
|
query_instruction: union([string2(), literal(false)]).optional().describe("OpenAI-compatible query prefix override. A string is prepended verbatim to search queries; false disables the built-in model-family instruction. Qwen3-Embedding, gte-Qwen instruct, e5 instruct, and Nomic families have built-in recipes. Query-only changes do not re-embed stored content. User-level only; project values are ignored."),
|
|
10458
10458
|
document_prefix: string2().optional().describe("OpenAI-compatible stored-document prefix override, prepended verbatim. Defaults to the model-family recipe (empty for Qwen3/gte/e5 instruct; 'search_document: ' for Nomic). Changing it changes stored vectors and triggers re-embedding. User-level only; project values are ignored."),
|
|
10459
10459
|
truncate: string2().optional().describe("Optional truncate mode sent in the embedding request body (e.g. NVIDIA NIM accepts 'NONE' | 'START' | 'END'). Omitted from the request when unset."),
|
|
10460
|
+
dimensions: number2().int().min(1).max(8192).optional().describe("Optional output width for Matryoshka embedding models (e.g. Qwen3-Embedding-8B accepts 768 | 1024 | 2048 | 4096; OpenAI text-embedding-3-* accept smaller widths than native). Sent as the OpenAI-compatible `dimensions` request field. Omitted from the request when unset, so the endpoint default applies. Changing it changes the produced vectors and folds into the embedding model identity, so switching widths re-embeds rather than mixing vector spaces. Not supported for the local provider, and ignored from project config like the other embedding fields (a repository cannot choose how private text is embedded)."),
|
|
10460
10461
|
max_input_tokens: number2().int().positive().optional().describe("Optional maximum input tokens for chunk embeddings. Defaults conservatively to 512 when omitted."),
|
|
10461
10462
|
local_runtime: _enum(["auto", "native", "wasm"]).default("auto").describe("Local provider only: ONNX runtime selection. 'auto' uses native under Node and uses WASM under Bun versions before 1.4.0, where Bun's NAPI teardown race can panic on quit; native is restored automatically on Bun 1.4.0+. Inference runs in a dedicated worker after disabling POSIX telemetry in the native process environment. Compiled Bun hosts and hosts without a verified in-process opt-out use a subprocess instead. Windows native ONNX emits OS-controlled ETW diagnostics, not direct uploads. On Bun before 1.4.0, even explicit 'native' uses WASM because native worker teardown can crash the process. Set 'wasm' to avoid loading the native addon on newer hosts too."),
|
|
10462
10463
|
local_dtype: _enum([
|
|
@@ -10505,6 +10506,7 @@ var init_magic_context = __esm(() => {
|
|
|
10505
10506
|
...model ? { model } : {},
|
|
10506
10507
|
...endpoint ? { endpoint } : {},
|
|
10507
10508
|
...apiKey ? { api_key: apiKey } : {},
|
|
10509
|
+
...data.dimensions ? { dimensions: data.dimensions } : {},
|
|
10508
10510
|
...inputType ? { input_type: inputType } : {},
|
|
10509
10511
|
...queryInputType ? { query_input_type: queryInputType } : {},
|
|
10510
10512
|
...data.query_instruction !== undefined ? { query_instruction: data.query_instruction } : {},
|
|
@@ -10531,6 +10533,7 @@ var init_magic_context = __esm(() => {
|
|
|
10531
10533
|
provider: "openai-compatible",
|
|
10532
10534
|
model: data.model?.trim() ?? "",
|
|
10533
10535
|
endpoint: data.endpoint?.trim() ?? "",
|
|
10536
|
+
...data.dimensions ? { dimensions: data.dimensions } : {},
|
|
10534
10537
|
...apiKey ? { api_key: apiKey } : {},
|
|
10535
10538
|
...inputType ? { input_type: inputType } : {},
|
|
10536
10539
|
...queryInputType ? { query_input_type: queryInputType } : {},
|
|
@@ -11426,7 +11429,8 @@ var init_project_security = __esm(() => {
|
|
|
11426
11429
|
"provider",
|
|
11427
11430
|
"fallback_provider",
|
|
11428
11431
|
"query_instruction",
|
|
11429
|
-
"document_prefix"
|
|
11432
|
+
"document_prefix",
|
|
11433
|
+
"dimensions"
|
|
11430
11434
|
];
|
|
11431
11435
|
PROTECTED_TOKENS_TIER_OVERRIDES = Symbol.for("@cortexkit/magic-context/protected-tokens-tier-overrides");
|
|
11432
11436
|
PROJECT_COMMAND_STRING_FIELDS = ["description", "agent", "model"];
|
|
@@ -37114,7 +37118,7 @@ function finishDatabaseOpen(db, dbPath, explicitDbPath, latestSupportedVersion)
|
|
|
37114
37118
|
return null;
|
|
37115
37119
|
}
|
|
37116
37120
|
healWedgedChannel2Claims(db);
|
|
37117
|
-
if (!explicitDbPath) {
|
|
37121
|
+
if (!explicitDbPath && scheduleStartupMaintenanceOnOpen) {
|
|
37118
37122
|
const readsOpenCodeStore = harnessOwnsOpenCodeStore();
|
|
37119
37123
|
const state = { controller: new AbortController };
|
|
37120
37124
|
startupBackfills.set(db, state);
|
|
@@ -37155,6 +37159,7 @@ function finishDatabaseOpen(db, dbPath, explicitDbPath, latestSupportedVersion)
|
|
|
37155
37159
|
log(`[magic-context] message-index backfill failed (will resume next startup): ${getErrorMessage(error)}`);
|
|
37156
37160
|
});
|
|
37157
37161
|
}));
|
|
37162
|
+
state.run = runBackfills;
|
|
37158
37163
|
state.timer = scheduleAfterBootQuiet(runBackfills);
|
|
37159
37164
|
}
|
|
37160
37165
|
setDatabase(db);
|
|
@@ -38525,7 +38530,7 @@ function closeDatabase() {
|
|
|
38525
38530
|
}
|
|
38526
38531
|
return Promise.all(pendingDatabaseCloses).then(() => {});
|
|
38527
38532
|
}
|
|
38528
|
-
var databases, pendingAsyncOpens, pendingDatabaseCloses, startupBackfills, persistenceByDatabase, persistenceErrorByDatabase, pathByDatabase, lastSchemaFenceRejection = null, lastMigrationOnOpenRefusal = null, lastUnconfirmedMigrationHolders = null, LATEST_SUPPORTED_VERSION = 95, BOOT_SQLITE_BUSY_TIMEOUT_MS = 5000, RPC_DISCOVERY_PARSE_GRACE_MS, defaultRpcDiscoveryFs, rpcDiscoveryFs, RPC_DISCOVERY_DIR_PRUNE_MIN_AGE_MS = 60000, sqlitePragmaConfig, CHANNEL2_CLAIM_TTL_MS, channel2HealStatements;
|
|
38533
|
+
var databases, pendingAsyncOpens, pendingDatabaseCloses, startupBackfills, scheduleStartupMaintenanceOnOpen = true, persistenceByDatabase, persistenceErrorByDatabase, pathByDatabase, lastSchemaFenceRejection = null, lastMigrationOnOpenRefusal = null, lastUnconfirmedMigrationHolders = null, LATEST_SUPPORTED_VERSION = 95, BOOT_SQLITE_BUSY_TIMEOUT_MS = 5000, RPC_DISCOVERY_PARSE_GRACE_MS, defaultRpcDiscoveryFs, rpcDiscoveryFs, RPC_DISCOVERY_DIR_PRUNE_MIN_AGE_MS = 60000, sqlitePragmaConfig, CHANNEL2_CLAIM_TTL_MS, channel2HealStatements;
|
|
38529
38534
|
var init_storage_db = __esm(async () => {
|
|
38530
38535
|
init_data_path();
|
|
38531
38536
|
init_logger();
|
|
@@ -48518,6 +48523,7 @@ var init_issue_log_templates_generated = __esm(() => {
|
|
|
48518
48523
|
"injecting legacy compartments without visible-prefix trimming because latest stored compartment has no end_message_id",
|
|
48519
48524
|
"prefix trim: boundary \x01; pass=priced; no in-pass trim applied (Hidden completion accepts text-only calibrated prompts)",
|
|
48520
48525
|
'Pi subagent "\x01" is dropping unavailable built-in "\x01". This source-inspection task cannot read local files without read.',
|
|
48526
|
+
"v2 usage: ignored server-fallback reply inputTokens=\x01 (invalid server-fallback usage marker); keeping previous reading",
|
|
48521
48527
|
"auto-search: decision outcome=error reason=\x01 lanes=\x01 nearMisses=\x01 threshold=\x01 pool=\x01 rows=\x01 workerStarted=\x01 peek=\x01 elapsedMs=\x01",
|
|
48522
48528
|
"auto-search: decision outcome=no-candidates lanes=\x01 nearMisses=\x01 threshold=\x01 pool=\x01 rows=\x01 workerStarted=\x01 peek=\x01 elapsedMs=\x01",
|
|
48523
48529
|
"compartment trigger: not firing at \x01% — no eligible head; offset=\x01 protectedStart=\x01 eligibleEnd=\x01 rawTokens=\x01 chunkTokens=\x01",
|
|
@@ -48642,6 +48648,7 @@ var init_issue_log_templates_generated = __esm(() => {
|
|
|
48642
48648
|
"channel2 ceiling nudge delivery failed after its claim was no longer owned; lease state left unchanged:",
|
|
48643
48649
|
"compaction-marker drain: CAS-clear failed but no pending blob remains; another drain already cleared it",
|
|
48644
48650
|
"[\x01] primary (primary) failed validation/prompt: \x01: \x01; \x01 fallback(s) configured, subject to remaining budget",
|
|
48651
|
+
"v2 usage: ignored server-fallback reply inputTokens=\x01 (sum of two server runs); keeping previous reading",
|
|
48645
48652
|
"caveman cleanup: switched to current rules (language-neutral word rules), rewrote \x01 compressed text tags",
|
|
48646
48653
|
"[magic-context] sqlite writer site=\x01 db=opencode acquire_ms=\x01 hold_ms=\x01 work_ms=\x01 end_ms=\x01 outcome=committed",
|
|
48647
48654
|
'[magic-context] partial recomp failed session=\x01 code=\x01 reason="chunk coverage ends at \x01 but chunk end is \x01"\x020s',
|
|
@@ -50257,9 +50264,9 @@ var init_issue_log_templates_generated = __esm(() => {
|
|
|
50257
50264
|
"single-store embedding drain failed (ignored):",
|
|
50258
50265
|
"system prompt meta persist failed (fail-open):",
|
|
50259
50266
|
"system prompt sticky date record write failed:",
|
|
50260
|
-
"[\x01] \x01; skipping primary for this run until reset",
|
|
50261
50267
|
"[\x01] \x01: model not found, retrying with suggestion",
|
|
50262
50268
|
"run \x01 left for the lease: this host is stopping",
|
|
50269
|
+
"skipping \x01 until \x01: provider said to retry later\x020m",
|
|
50263
50270
|
"[dreamer] classify: stage=\x01 nothing to classify",
|
|
50264
50271
|
"[\x01] primary (\x01/\x01) failed: \x01: \x01; trying \x01 fallback(s)\x021m,2m",
|
|
50265
50272
|
"[historian] Dropped <facts> category \x01 (\x01 facts)",
|
|
@@ -50502,7 +50509,6 @@ var init_issue_log_templates_generated = __esm(() => {
|
|
|
50502
50509
|
"promoted fact embedding dispatch failed:",
|
|
50503
50510
|
"wrapup: compartment lease renewal failed",
|
|
50504
50511
|
"report for \x01 accepted (publish=immediate)",
|
|
50505
|
-
"[\x01] \x01; skipping \x01/\x01 for this run until reset\x022m,3m",
|
|
50506
50512
|
"[mural] skipped for \x01: no active memories",
|
|
50507
50513
|
"variant changed (\x01 -> \x01), triggering flush\x020s",
|
|
50508
50514
|
"variant changed (\x01 -> \x01), triggering flush",
|
|
@@ -51171,7 +51177,7 @@ var init_issue_log_templates_generated = __esm(() => {
|
|
|
51171
51177
|
}
|
|
51172
51178
|
return { parts, slots };
|
|
51173
51179
|
});
|
|
51174
|
-
ISSUE_LOG_IDENTIFIERS = "abort,aborted,above_cap,accepted,acquire,adopted,agent,agent-drops-applied,aligned,already-current,already-present,already_ran_this_turn,ambiguous,anchor-missing,anchors-disagree,appended,applied,archive,assistant,attachment,attempt_mismatch,audio,auth_failed,auto_search_hint,backoff,band-crossing,band-deescalation,baseline-reset,baseline-unavailable,baseline-unevaluable,batch,batch-timeout,behind,below-emergency-band,below-threshold,boot_recovery,boundary_repair,busy,bytes,cache_hit,cache_invalid,cached_m1_missing,cadence-growth,cadence-refire,candidate-preparation,candidate_conflict,candidate_loss,candidate_rows_changed,candidates,capture_failed,cas-exhausted,cas-exhaustion,catalog,category,ceiling-threshold-met,changes-request,channel-2-ceiling-nudge,checkpoint,chunk_empty_canonical_text,chunk_fts_mapping_incomplete,chunk_partial_vector_set,chunk_window_contract_mismatch,cleared_reasoning_through_tag,close,closed-book,commit_clusters,committed,compaction,compartment-removed,compartment_render_epoch,compiled-check,compressed,compressor,config-re-read,conflict,content,content-loss,context_boundary,cooldown_active,count,coverage_fold,ctx_search_hint,custom_tool_call,darwin,data,deadline,defer,deferred,deferred_materialization,deferred_publication,definitely-no-cut,degraded,destination-not-empty,diagnostics,directive-shaped-project-rule,directory,disabled,discarded_last,divergent,document,done,drained,dreamer,dreamer-task,drift,drop_seed,duplicate_submission_budget,embed,embedded,empty,empty-session,empty_output,end_block_index,endpoint_unsupported,entry,entry-removed,envelope_unreadable,epoch_change,error,error_content,error_text,evaluate-smart-notes,exact-ordinal-ids,exception,excluded,execute,exited,expired,explicit_flush,failed,fatal,fenced_path,file,file_contains,first_render,fit_retry,flush,fold,force,force_band,force_materialization,found,frozen_slot,fts-rowid-backfill,full,function_call,generation-invalidated,git_commit_after,git_identity_unavailable,git_tag_matching,has-state,heavy_reasoning,historian,historian-editor,historian_editor,hold,home_directory,host,host-checkpoint,host_compaction,host_cut_before_watermark,host_history_change,host_rerender,http_error,identity_paused,image,images,incremental,indexed,intact,invalid-pid,invalid_prompt,invalid_scheme,invocation,io,leaked-id,lease_active,legacy,length,live-geometry,lkg_anthropic_reasoning_run_invalid,lkg_content_mismatch,lkg_invalidated_reshape,lkg_miss,lkg_model_mismatch,lkg_output_mapping_unavailable,lkg_recovery_input_rebuild,lkg_recovery_unproven,lkg_restart_rebuild,lkg_seam_invalid,lkg_system_state_mismatch,lkg_unsafe_seam,m1_delta,magic-context-host-stall,maintain-docs,malformed,management_surface,manual-full-recomp,manual-wrapup-empty,max_mutation_id,memory,memory_hash_guard_rejected,merged-reasoning-strip-exception,merged-reasoning-strip-persistence-failure,message,messages,migrated,migration_guard,migration_required,mismatch,missing,missing-active-same-category-successor,missing_tool_messages,model_change,model_failed,model_or_limit_changed,mtime_after,mutation_drift,native,network_error,newer_schema,no-anchor,no-file,no-output,no-result,no_assistant,no_head,no_originating_cache_bust,no_recent_heavy_reasoning,non-finite-input,non_zero_exit,none,not-a-fork,not-accepted,not-ready,not_a_repo,not_certified,not_found,not_owned,not_tracked,note,note_nudge_anchor,object,ok,omp,opaque,open-tool-arc,openai-codex-responses,openai-responses,opencode,opencode2,orphan_tool_message,other,overflow,oversized,ownership_lost,pair_commit_failed,parent-missing,parse,parse-invalid,parse_failed,partial,partial-message-boundary,partial-recomp,parts,pass,pass-cap,patch,path_exists,pending_agent_drop,pending_materialization,pi,placeholder,polarity-missing-mechanism,populated,post-reduce-band-escalation,post-reduce-baseline-pending,post-reduce-compliance-grace,post-reduce-regrowth-reached,pressure_refold,prewarm,primary,probe_required,proceed,process,processed_image,profile_transition,prohibition-missing-marker,project,project_change,project_memory_epoch,projected_headroom,provider-overflow-abort,provider_error,provider_returned_no_vectors,publication-failed,query,range,ratio-below-ceiling,ratio-below-gentle,raw,read-outstanding,read_error,ready,reason,reasoning,reasoning-removal-persistence-failure,reasoning-removal-read-failure,recent-reduce-refresh,reclaimable-below-floor,recomp,reconnect,recovery-request-over-limit,recovery_prefix_released,recovery_tail_normalized,redacted_reasoning,redacted_thinking,refresh,refusal-grade-final-wire-over-limit,registration_retired_during_embed,release,reminder-strip,renew,repaired,replace,resolved,response,restore,result,retry,retryable-failure,rpc_error,run,scan,scheduler_defer,schema_fence,seam-temporal-strip,search-archive,search-failure,seeded,shifted,size-walk,skip,skipped,snapshot,source,source-revision,source_changed,source_removed,spawn-failed,spawn_failed,stacked,stale,stale-skip,stale_reduce,stale_snapshot,stalled,stalled_no_progress,start,start-failed,start_block_index,steer,step-finish,step-start,step_limit,sticky-turn-floor,stop,stopped,storage,storage-busy,storage_failure,store_not_found,store_schema_unknown,store_unreadable,string,strip,strip_seed,structural,subtask,summary,summary_message,superseded,synthetic-boundary-merged,synthetic-kept-entry,system_hash,system_injected,tag,tag-delta,tag-identity-rebuild-failed,tag-identity-recurring,tag-identity-repair-once,tag-identity-repair-pending,tag-summary,tag_identity_repair,tag_prefix,tail-below-minimum,tail_size,target-superseded,test-legacy,text,thinking,thinking_binding,thinking_hold,timeout,timeout-circuit-breaker,token-budget,token_budget,too-short,tool,tool_call,tool_definitions,tool_provider,tool_result,tool_use,transform,transient,truncated,trusted-final-wire-disarm,ttl_expiry,ttl_idle,turn,type,unanchored,unavailable,unbalanced-parens,uncaptured_replay,uncertain,unknown,unknown_write_rejection,unmatched_tool_call_id,unplaceable,unregistered,unresolved,update,upgrade,upgrade_state,url,user-memories,user-profile-is-not-project-memory,user_flush,user_memory_review,v1,v2,v2-archive-read,v2-archive-ready,v2-archive-result,validated,validation-failed,variant_change,verbose,verified,verify,video,view_error,waiting,waiting-for-entry,weak_lookahead_final_compartment,whole-session-smaller-than-tail,worker-busy,worker-error,worker-failed,wrapup,x64".split(",");
|
|
51180
|
+
ISSUE_LOG_IDENTIFIERS = "abort,aborted,above_cap,accepted,acquire,adopted,agent,agent-drops-applied,aligned,already-current,already-present,already_ran_this_turn,ambiguous,anchor-missing,anchors-disagree,appended,applied,archive,assistant,attachment,attempt_mismatch,audio,auth_failed,auto_search_hint,backoff,band-crossing,band-deescalation,baseline-reset,baseline-unavailable,baseline-unevaluable,batch,batch-timeout,behind,below-emergency-band,below-threshold,boot_recovery,boundary,boundary_repair,busy,bytes,cache_hit,cache_invalid,cached_m1_missing,cadence-growth,cadence-refire,candidate-preparation,candidate_conflict,candidate_loss,candidate_rows_changed,candidates,capture_failed,cas-exhausted,cas-exhaustion,catalog,category,ceiling-threshold-met,changes-request,channel-2-ceiling-nudge,checkpoint,chunk_empty_canonical_text,chunk_fts_mapping_incomplete,chunk_partial_vector_set,chunk_window_contract_mismatch,cleared_reasoning_through_tag,close,closed-book,commit_clusters,committed,compaction,compartment-removed,compartment_render_epoch,compiled-check,compressed,compressor,config-re-read,conflict,content,content-loss,context_boundary,cooldown_active,count,coverage_fold,ctx_search_hint,custom_tool_call,darwin,data,deadline,defer,deferred,deferred_materialization,deferred_publication,definitely-no-cut,degraded,destination-not-empty,diagnostics,dimensions_mismatch,directive-shaped-project-rule,directory,disabled,discarded_last,divergent,document,done,drained,dreamer,dreamer-task,drift,drop_seed,duplicate_submission_budget,embed,embedded,empty,empty-session,empty_output,end_block_index,endpoint_unsupported,entry,entry-removed,envelope_unreadable,epoch_change,error,error_content,error_text,evaluate-smart-notes,exact-ordinal-ids,exception,excluded,execute,exited,expired,explicit_flush,failed,fatal,fenced_path,file,file_contains,first_render,fit_retry,flush,fold,force,force_band,force_materialization,found,frozen_slot,fts-rowid-backfill,full,function_call,generation-invalidated,git_commit_after,git_identity_unavailable,git_tag_matching,has-state,heavy_reasoning,historian,historian-editor,historian_editor,hold,home_directory,host,host-checkpoint,host_compaction,host_cut_before_watermark,host_history_change,host_rerender,http_error,identity_paused,image,images,incremental,indexed,intact,invalid-pid,invalid_prompt,invalid_scheme,invocation,io,leaked-id,lease_active,legacy,length,live-geometry,lkg_anthropic_reasoning_run_invalid,lkg_content_mismatch,lkg_invalidated_reshape,lkg_miss,lkg_model_mismatch,lkg_output_mapping_unavailable,lkg_recovery_input_rebuild,lkg_recovery_unproven,lkg_restart_rebuild,lkg_seam_invalid,lkg_system_state_mismatch,lkg_unsafe_seam,m1_delta,magic-context-host-stall,maintain-docs,malformed,management_surface,manual-full-recomp,manual-wrapup-empty,max_mutation_id,memory,memory_hash_guard_rejected,merged-reasoning-strip-exception,merged-reasoning-strip-persistence-failure,message,messages,migrated,migration_guard,migration_required,mismatch,missing,missing-active-same-category-successor,missing_tool_messages,model_change,model_failed,model_or_limit_changed,mtime_after,mutation_drift,native,network_error,newer_schema,no-anchor,no-file,no-output,no-result,no_assistant,no_head,no_originating_cache_bust,no_recent_heavy_reasoning,non-finite-input,non_zero_exit,none,not-a-fork,not-accepted,not-ready,not_a_repo,not_certified,not_found,not_owned,not_tracked,note,note_nudge_anchor,object,ok,omp,opaque,open-tool-arc,openai-codex-responses,openai-responses,opencode,opencode2,orphan_tool_message,other,overflow,oversized,ownership_lost,pair_commit_failed,parent-missing,parse,parse-invalid,parse_failed,partial,partial-message-boundary,partial-recomp,parts,pass,pass-cap,patch,path_exists,pending_agent_drop,pending_materialization,pi,placeholder,polarity-missing-mechanism,populated,post-reduce-band-escalation,post-reduce-baseline-pending,post-reduce-compliance-grace,post-reduce-regrowth-reached,pressure_refold,prewarm,primary,probe_required,proceed,process,processed_image,profile_transition,prohibition-missing-marker,project,project_change,project_memory_epoch,projected_headroom,provider-overflow-abort,provider_error,provider_returned_no_vectors,publication-failed,query,range,ratio-below-ceiling,ratio-below-gentle,raw,read-outstanding,read_error,ready,reason,reasoning,reasoning-removal-persistence-failure,reasoning-removal-read-failure,recent-reduce-refresh,reclaimable-below-floor,recomp,reconnect,recovery-request-over-limit,recovery_prefix_released,recovery_tail_normalized,redacted_reasoning,redacted_thinking,refresh,refusal-grade-final-wire-over-limit,registration_retired_during_embed,release,reminder-strip,renew,repaired,replace,resolved,response,restore,result,retry,retryable-failure,rpc_error,run,scan,scheduler_defer,schema_fence,seam-temporal-strip,search-archive,search-failure,seeded,shifted,size-walk,skip,skipped,snapshot,source,source-revision,source_changed,source_removed,spawn-failed,spawn_failed,stacked,stale,stale-skip,stale_reduce,stale_snapshot,stalled,stalled_no_progress,start,start-failed,start_block_index,steer,step-finish,step-start,step_limit,sticky-turn-floor,stop,stopped,storage,storage-busy,storage_failure,store_not_found,store_schema_unknown,store_unreadable,string,strip,strip_seed,structural,subtask,summary,summary_message,superseded,synthetic-boundary-merged,synthetic-kept-entry,system_hash,system_injected,tag,tag-delta,tag-identity-rebuild-failed,tag-identity-recurring,tag-identity-repair-once,tag-identity-repair-pending,tag-summary,tag_identity_repair,tag_prefix,tail-below-minimum,tail_size,target-superseded,test-legacy,text,thinking,thinking_binding,thinking_hold,timeout,timeout-circuit-breaker,token-budget,token_budget,too-short,tool,tool_call,tool_definitions,tool_provider,tool_result,tool_use,transform,transient,truncated,trusted-final-wire-disarm,ttl_expiry,ttl_idle,turn,type,unanchored,unavailable,unbalanced-parens,uncaptured_replay,uncertain,unknown,unknown_write_rejection,unmatched_tool_call_id,unplaceable,unregistered,unresolved,update,upgrade,upgrade_state,url,usage,user-memories,user-profile-is-not-project-memory,user_flush,user_memory_review,v1,v2,v2-archive-read,v2-archive-ready,v2-archive-result,validated,validation-failed,variant_change,verbose,verified,verify,video,view_error,waiting,waiting-for-entry,weak_lookahead_final_compartment,whole-session-smaller-than-tail,worker-busy,worker-error,worker-failed,wrapup,x64".split(",");
|
|
51175
51181
|
});
|
|
51176
51182
|
|
|
51177
51183
|
// src/lib/log-lines.ts
|
|
@@ -52803,11 +52809,13 @@ async function probeEmbeddingEndpoint(options) {
|
|
|
52803
52809
|
}
|
|
52804
52810
|
const inputType = options.inputType?.trim();
|
|
52805
52811
|
const truncateMode = options.truncate?.trim();
|
|
52812
|
+
const requestedDimensions = typeof options.dimensions === "number" && Number.isInteger(options.dimensions) && options.dimensions > 0 ? options.dimensions : undefined;
|
|
52806
52813
|
const body = JSON.stringify({
|
|
52807
52814
|
model: options.model,
|
|
52808
52815
|
input: "magic-context probe",
|
|
52809
52816
|
...inputType ? { input_type: inputType } : {},
|
|
52810
|
-
...truncateMode ? { truncate: truncateMode } : {}
|
|
52817
|
+
...truncateMode ? { truncate: truncateMode } : {},
|
|
52818
|
+
...requestedDimensions ? { dimensions: requestedDimensions } : {}
|
|
52811
52819
|
});
|
|
52812
52820
|
let response;
|
|
52813
52821
|
try {
|
|
@@ -52845,6 +52853,14 @@ async function probeEmbeddingEndpoint(options) {
|
|
|
52845
52853
|
preview: await readPreview(parsed)
|
|
52846
52854
|
};
|
|
52847
52855
|
}
|
|
52856
|
+
if (requestedDimensions !== undefined && dimensions !== requestedDimensions) {
|
|
52857
|
+
return {
|
|
52858
|
+
kind: "dimensions_mismatch",
|
|
52859
|
+
status,
|
|
52860
|
+
requested: requestedDimensions,
|
|
52861
|
+
returned: dimensions
|
|
52862
|
+
};
|
|
52863
|
+
}
|
|
52848
52864
|
return { kind: "ok", status, dimensions };
|
|
52849
52865
|
}
|
|
52850
52866
|
const preview = await previewErrorBody(response);
|
|
@@ -56245,6 +56261,7 @@ async function checkEmbeddingConfig(magicContextConfigPath, installRoots) {
|
|
|
56245
56261
|
const apiKey = typeof embedding?.api_key === "string" ? embedding.api_key : undefined;
|
|
56246
56262
|
const inputType = typeof embedding?.input_type === "string" ? embedding.input_type.trim() : undefined;
|
|
56247
56263
|
const truncateMode = typeof embedding?.truncate === "string" ? embedding.truncate.trim() : undefined;
|
|
56264
|
+
const dimensions = typeof embedding?.dimensions === "number" ? embedding.dimensions : undefined;
|
|
56248
56265
|
let localIssues = 0;
|
|
56249
56266
|
if (!endpoint) {
|
|
56250
56267
|
log3.error("Embedding provider is openai-compatible but 'endpoint' is missing");
|
|
@@ -56278,6 +56295,7 @@ async function checkEmbeddingConfig(magicContextConfigPath, installRoots) {
|
|
|
56278
56295
|
apiKey,
|
|
56279
56296
|
...inputType ? { inputType } : {},
|
|
56280
56297
|
...truncateMode ? { truncate: truncateMode } : {},
|
|
56298
|
+
...dimensions !== undefined ? { dimensions } : {},
|
|
56281
56299
|
timeoutMs: 1e4
|
|
56282
56300
|
});
|
|
56283
56301
|
} catch (error) {
|
|
@@ -56290,6 +56308,10 @@ async function checkEmbeddingConfig(magicContextConfigPath, installRoots) {
|
|
|
56290
56308
|
case "ok":
|
|
56291
56309
|
log3.success(`Embedding endpoint OK (${outcome.status}, ${outcome.dimensions ?? "?"}-dim vectors)`);
|
|
56292
56310
|
return { issues: localIssues };
|
|
56311
|
+
case "dimensions_mismatch":
|
|
56312
|
+
log3.error(`Embedding endpoint ignored dimensions=${outcome.requested} and returned ${outcome.returned}-dim vectors (${outcome.status})`);
|
|
56313
|
+
log3.info(" The endpoint or model does not support the dimensions parameter. Remove embedding.dimensions, or use a Matryoshka-capable model/endpoint. Mismatched vectors are rejected at runtime.");
|
|
56314
|
+
return { issues: localIssues + 1 };
|
|
56293
56315
|
case "auth_failed":
|
|
56294
56316
|
log3.error(`Embedding endpoint rejected credentials (${outcome.status}) — check api_key / env var`);
|
|
56295
56317
|
if (outcome.preview)
|
|
@@ -58058,6 +58080,11 @@ function classifyEmbeddingOutcome(outcome) {
|
|
|
58058
58080
|
status: "pass",
|
|
58059
58081
|
message: `Embedding endpoint OK (${outcome.status}, ${outcome.dimensions ?? "?"}-dim vectors)`
|
|
58060
58082
|
};
|
|
58083
|
+
case "dimensions_mismatch":
|
|
58084
|
+
return {
|
|
58085
|
+
status: "fail",
|
|
58086
|
+
message: `Embedding endpoint ignored dimensions=${outcome.requested} and returned ${outcome.returned}-dim vectors (${outcome.status}); remove embedding.dimensions or use a Matryoshka-capable model`
|
|
58087
|
+
};
|
|
58061
58088
|
case "auth_failed":
|
|
58062
58089
|
return {
|
|
58063
58090
|
status: "fail",
|
|
@@ -58412,6 +58439,7 @@ ${formatDatabaseRepairGuidance(dbPath)}`);
|
|
|
58412
58439
|
const apiKey = typeof mergedEmbedding.api_key === "string" ? mergedEmbedding.api_key : undefined;
|
|
58413
58440
|
const inputType = typeof mergedEmbedding.input_type === "string" ? mergedEmbedding.input_type.trim() : undefined;
|
|
58414
58441
|
const truncateMode = typeof mergedEmbedding.truncate === "string" ? mergedEmbedding.truncate.trim() : undefined;
|
|
58442
|
+
const dimensions = typeof mergedEmbedding.dimensions === "number" ? mergedEmbedding.dimensions : undefined;
|
|
58415
58443
|
if (!endpoint || !model) {
|
|
58416
58444
|
add2(results, "fail", "Embedding provider is openai-compatible but endpoint/model is missing");
|
|
58417
58445
|
} else {
|
|
@@ -58422,6 +58450,7 @@ ${formatDatabaseRepairGuidance(dbPath)}`);
|
|
|
58422
58450
|
apiKey,
|
|
58423
58451
|
...inputType ? { inputType } : {},
|
|
58424
58452
|
...truncateMode ? { truncate: truncateMode } : {},
|
|
58453
|
+
...dimensions !== undefined ? { dimensions } : {},
|
|
58425
58454
|
timeoutMs: 1e4
|
|
58426
58455
|
});
|
|
58427
58456
|
const classified = classifyEmbeddingOutcome(outcome);
|