@cortexkit/magic-context 0.49.52 → 0.49.54

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.
Files changed (2) hide show
  1. package/dist/index.js +419 -237
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -25677,7 +25677,7 @@ function reportOpenCodeV2PluginCache(result, report, options) {
25677
25677
  case "stale":
25678
25678
  report.warn(`OpenCode 2 is running an outdated Magic Context${slotName} (${versions}); OpenCode does not install new releases on its own`);
25679
25679
  report.info(` To upgrade, ${OPENCODE_V2_PLUGIN_UPDATE_HINT},`);
25680
- report.info(" or quit OpenCode (including `opencode service stop`) and run `magic-context doctor --fix`.");
25680
+ report.info((options.platform ?? process.platform) === "win32" ? ` or quit OpenCode and delete ${result.slot}; the next start installs the current ${result.distTag ? `${tag} ` : ""}release.` : " or quit OpenCode (including `opencode service stop`) and run `magic-context doctor --fix`.");
25681
25681
  return { fixed: false, issue: false };
25682
25682
  case "in_use":
25683
25683
  report.warn(`Outdated Magic Context in the OpenCode 2 plugin cache (${versions}) was not cleared: OpenCode is running (pid ${result.pids?.join(", ")})`);
@@ -34613,12 +34613,235 @@ var init_ctx_reduce_nudge = __esm(() => {
34613
34613
  init_tail_hygiene_output_count();
34614
34614
  });
34615
34615
 
34616
+ // ../plugin/src/hooks/magic-context/final-wire-completeness.ts
34617
+ var init_final_wire_completeness = __esm(() => {
34618
+ init_logger();
34619
+ });
34620
+
34621
+ // ../plugin/src/features/magic-context/merged-reasoning-decisions.ts
34622
+ var decodedDecisions, MAX_DECODED_DECISION_BYTES;
34623
+ var init_merged_reasoning_decisions = __esm(() => {
34624
+ decodedDecisions = new Map;
34625
+ MAX_DECODED_DECISION_BYTES = 32 * 1024 * 1024;
34626
+ });
34627
+ // ../plugin/src/features/magic-context/session-decision-calibration.ts
34628
+ var init_session_decision_calibration = __esm(() => {
34629
+ init_decision_calibration();
34630
+ init_harness_provider_map();
34631
+ });
34632
+
34633
+ // ../plugin/src/features/magic-context/protection-window.ts
34634
+ var init_protection_window = __esm(async () => {
34635
+ init_session_decision_calibration();
34636
+ await init_storage_tags();
34637
+ });
34638
+
34639
+ // ../plugin/src/features/magic-context/storage-meta-shared.ts
34640
+ var BOOLEAN_META_KEYS, NULL_BIND_META_KEYS, sessionMetaExistsStatements;
34641
+ var init_storage_meta_shared = __esm(async () => {
34642
+ init_harness_provider_map();
34643
+ await init_sqlite();
34644
+ BOOLEAN_META_KEYS = new Set(["isSubagent", "compartmentInProgress", "cacheAlertSent"]);
34645
+ NULL_BIND_META_KEYS = new Set([
34646
+ "cachedM0Bytes",
34647
+ "cachedM0MuralDataUrl",
34648
+ "cachedM0MuralHash",
34649
+ "cachedM1Bytes",
34650
+ "cachedM0ProjectMemoryEpoch",
34651
+ "cachedM0WorkspaceFingerprint",
34652
+ "cachedM0ProjectUserProfileVersion",
34653
+ "cachedM0MaxCompartmentSeq",
34654
+ "cachedM0MaxMemoryId",
34655
+ "cachedM0MaxMutationId",
34656
+ "cachedM0MaxMemoryMutationId",
34657
+ "cachedM0ProjectDocsHash",
34658
+ "cachedM0MaterializedAt",
34659
+ "cachedM0SessionFactsVersion",
34660
+ "cachedM0UpgradeState",
34661
+ "cachedM0ProjectIdentity",
34662
+ "lastObservedModelKey",
34663
+ "upgradeRemindedAt",
34664
+ "upgradeReminderLastSentAt",
34665
+ "piStableIdScheme"
34666
+ ]);
34667
+ sessionMetaExistsStatements = new WeakMap;
34668
+ });
34669
+
34670
+ // ../plugin/src/features/magic-context/storage-replay-document.ts
34671
+ import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
34672
+ var MISSING_REPLAY_DOCUMENT_COLUMN, replaySnapshots, decisionTablePresent, trailingBlankReadCache, TRAILING_BLANK_CACHE_MAX_CHARS, DECISION_CONFLICT;
34673
+ var init_storage_replay_document = __esm(async () => {
34674
+ init_logger();
34675
+ await init_storage_meta_shared();
34676
+ MISSING_REPLAY_DOCUMENT_COLUMN = Symbol("missing replay document column");
34677
+ replaySnapshots = new AsyncLocalStorage2;
34678
+ decisionTablePresent = new WeakMap;
34679
+ trailingBlankReadCache = new WeakMap;
34680
+ TRAILING_BLANK_CACHE_MAX_CHARS = 4 * 1024 * 1024;
34681
+ DECISION_CONFLICT = Symbol("replay decision changed concurrently");
34682
+ });
34683
+
34684
+ // ../plugin/src/features/magic-context/storage-meta-persisted.ts
34685
+ var emergencyRecoveryArmedSessions, emergencyRecoveryArmedAtBySession, providerOverflowReconfirmedSessions, providerOverflowKnownLimitSessions, AUTO_SEARCH_NO_HINT_REASONS, DRAIN_WINDOW_MS, WRAPUP_IN_PROGRESS_TTL_MS, COMPACTION_MODE_RECORD_VALUES, EMERGENCY_DRAIN_MAX_LATCH_MS, pendingAutoSearchRetirements, bindingRecoveriesAwaitingClear, COMPACTION_MARKER_PENDING_BUDGET_MS, preSnapshotSessions, warnedProtectedTokenTierOverrides;
34686
+ var init_storage_meta_persisted = __esm(async () => {
34687
+ init_magic_context();
34688
+ init_harness_provider_map();
34689
+ init_logger();
34690
+ init_write_transaction_timing();
34691
+ init_merged_reasoning_decisions();
34692
+ await __promiseAll([
34693
+ init_protection_window(),
34694
+ init_storage_meta_shared(),
34695
+ init_storage_replay_document()
34696
+ ]);
34697
+ emergencyRecoveryArmedSessions = new Set;
34698
+ emergencyRecoveryArmedAtBySession = new Map;
34699
+ providerOverflowReconfirmedSessions = new Set;
34700
+ providerOverflowKnownLimitSessions = new Set;
34701
+ AUTO_SEARCH_NO_HINT_REASONS = new Set([
34702
+ "below-threshold",
34703
+ "timeout",
34704
+ "empty",
34705
+ "error",
34706
+ "stacked",
34707
+ "too-short"
34708
+ ]);
34709
+ DRAIN_WINDOW_MS = 10 * 60 * 1000;
34710
+ WRAPUP_IN_PROGRESS_TTL_MS = 5 * 60 * 1000;
34711
+ COMPACTION_MODE_RECORD_VALUES = new Set([
34712
+ "on",
34713
+ "off",
34714
+ "on_notice_pending",
34715
+ "off_notice_pending",
34716
+ "off_cleanup_pending"
34717
+ ]);
34718
+ EMERGENCY_DRAIN_MAX_LATCH_MS = 30 * 60 * 1000;
34719
+ pendingAutoSearchRetirements = new WeakMap;
34720
+ bindingRecoveriesAwaitingClear = new Map;
34721
+ COMPACTION_MARKER_PENDING_BUDGET_MS = 5 * 60000;
34722
+ preSnapshotSessions = new Map;
34723
+ warnedProtectedTokenTierOverrides = new WeakSet;
34724
+ });
34725
+
34726
+ // ../plugin/src/features/magic-context/storage-reasoning-removal.ts
34727
+ var init_storage_reasoning_removal = __esm(async () => {
34728
+ await init_storage_replay_document();
34729
+ });
34730
+
34731
+ // ../plugin/src/features/magic-context/overflow-detection.ts
34732
+ var PREFIX_BOUND_THINKING_MODELS, PREFIX_BOUND_THINKING_PATTERN;
34733
+ var init_overflow_detection = __esm(() => {
34734
+ PREFIX_BOUND_THINKING_MODELS = [
34735
+ ["fable", 5, 1],
34736
+ ["fable", 5, 2],
34737
+ ["mythos", 5, 1],
34738
+ ["mythos", 5, 2],
34739
+ ["opus", 5, 5],
34740
+ ["sonnet", 5, 5],
34741
+ ["haiku", 5, 5]
34742
+ ];
34743
+ PREFIX_BOUND_THINKING_PATTERN = new RegExp(`(?:^|[-_.:/])(?:${PREFIX_BOUND_THINKING_MODELS.map(([family, major, minor]) => `${family}[-_.]?${major}[-_.]${minor}`).join("|")})(?:$|[-_.:/@])`, "i");
34744
+ });
34745
+
34746
+ // ../plugin/src/hooks/magic-context/sentinel.ts
34747
+ var REMOVED_REASONING_MARK, NEUTRALIZED_ORIGINALS;
34748
+ var init_sentinel = __esm(() => {
34749
+ init_overflow_detection();
34750
+ init_harness_provider_map();
34751
+ REMOVED_REASONING_MARK = Symbol.for("magic-context.removed-reasoning");
34752
+ NEUTRALIZED_ORIGINALS = new WeakMap;
34753
+ });
34754
+
34755
+ // ../plugin/src/hooks/magic-context/active-anthropic-turn.ts
34756
+ var init_active_anthropic_turn = __esm(() => {
34757
+ init_sentinel();
34758
+ });
34759
+
34760
+ // ../plugin/src/shared/marker-only-text.ts
34761
+ var init_marker_only_text = () => {};
34762
+ // ../plugin/src/hooks/magic-context/served-shape-repair.ts
34763
+ var sources;
34764
+ var init_served_shape_repair = __esm(async () => {
34765
+ init_tag_content_primitives();
34766
+ await init_storage_replay_document();
34767
+ sources = new WeakMap;
34768
+ });
34769
+
34770
+ // ../plugin/src/hooks/magic-context/strip-content.ts
34771
+ var METADATA_PART_TYPES, CLEARED_REASONING_TYPES, REASONING_IGNORED_PART_TYPES, REASONING_PART_TYPES, emptyImageParts;
34772
+ var init_strip_content = __esm(async () => {
34773
+ init_merged_reasoning_decisions();
34774
+ init_marker_only_text();
34775
+ init_sentinel();
34776
+ init_tag_content_primitives();
34777
+ init_marker_only_text();
34778
+ await init_served_shape_repair();
34779
+ METADATA_PART_TYPES = new Set([
34780
+ "step-start",
34781
+ "step-finish",
34782
+ "snapshot",
34783
+ "patch",
34784
+ "agent",
34785
+ "retry",
34786
+ "subtask",
34787
+ "compaction"
34788
+ ]);
34789
+ CLEARED_REASONING_TYPES = new Set(["thinking", "reasoning"]);
34790
+ REASONING_IGNORED_PART_TYPES = new Set([
34791
+ "step-start",
34792
+ "step-finish",
34793
+ "snapshot",
34794
+ "patch",
34795
+ "agent",
34796
+ "retry",
34797
+ "subtask",
34798
+ "compaction"
34799
+ ]);
34800
+ REASONING_PART_TYPES = new Set(["reasoning", "thinking", "redacted_thinking"]);
34801
+ emptyImageParts = new WeakMap;
34802
+ });
34803
+
34804
+ // ../plugin/src/hooks/magic-context/reasoning-budget.ts
34805
+ var init_reasoning_budget = __esm(async () => {
34806
+ init_merged_reasoning_decisions();
34807
+ init_prompt_surface();
34808
+ init_active_anthropic_turn();
34809
+ init_read_session_formatting();
34810
+ init_sentinel();
34811
+ await __promiseAll([
34812
+ init_storage_meta_persisted(),
34813
+ init_storage_reasoning_removal(),
34814
+ init_storage_tags(),
34815
+ init_strip_content()
34816
+ ]);
34817
+ });
34818
+
34819
+ // ../plugin/src/hooks/magic-context/opaque-thinking.ts
34820
+ var init_opaque_thinking = __esm(async () => {
34821
+ await init_reasoning_budget();
34822
+ });
34823
+
34824
+ // ../plugin/src/hooks/magic-context/final-wire-token-estimate.ts
34825
+ var wireTextTokens;
34826
+ var init_final_wire_token_estimate = __esm(async () => {
34827
+ init_tool_definition_tokens();
34828
+ init_decision_calibration();
34829
+ init_final_wire_completeness();
34830
+ init_image_token_estimate();
34831
+ init_read_session_formatting();
34832
+ init_tokenizer_calibration();
34833
+ init_logger();
34834
+ await init_opaque_thinking();
34835
+ wireTextTokens = createTokenCountMemo(1e5, 128 * 1024 * 1024);
34836
+ });
34837
+
34616
34838
  // ../plugin/src/hooks/magic-context/emergency-drop.ts
34617
34839
  var T1_TOOLS, T2_TOOLS;
34618
- var init_emergency_drop = __esm(() => {
34840
+ var init_emergency_drop = __esm(async () => {
34619
34841
  init_reclaim_protection();
34620
34842
  init_ctx_reduce_nudge();
34621
34843
  init_read_session_formatting();
34844
+ await init_final_wire_token_estimate();
34622
34845
  T1_TOOLS = new Set(["read", "todowrite", "task", "aft_outline", "aft_zoom"]);
34623
34846
  T2_TOOLS = new Set(["edit", "write", "apply_patch", "grep", "glob", "aft_search"]);
34624
34847
  });
@@ -34667,12 +34890,14 @@ function pickNearestPriorOwner(candidates, currentMessageId, times) {
34667
34890
  }
34668
34891
  var insertTagStatements, updateTagStatusStatements, updateTagDropModeStatements, updateTagMessageIdStatements, getTagNumbersByMessageIdStatements, deleteTagsByMessageIdStatements, getMaxTagNumberBySessionStatements, getTagNumberByMessageIdStatements, getAssignableTagNumberByMessageIdStatements, hasPiFallbackMessageTagStatements, updateTagByteSizeStatements, updateTagInputByteSizeStatements, recentTagOwnerStatements, RECLAIM_HINT_EXCLUDED_TOOLS, getActiveToolTagsForAgeReclaimStatements, scopedActiveTokenTotalStatements, updateTagTokenCountStatements, updateTagInputTokenCountStatements, tagOwnerSummaries, TAG_OWNER_COLUMNS = "id, type, message_id, tool_owner_message_id, tag_number, reasoning_token_count", TAG_OWNER_APPENDED_WITH_SHAPE_SQL, droppedTagStatements, inertWhitespaceStatements, inertWhitespaceByNumberStatements, foldStatements, getOwnerScopedToolTagNumbersStatements, getMinMessageTagNumberForRawIdStatements, getActiveTagsBySessionStatements, getNullOwnerToolTagsBySessionStatements, getDroppedTagsBySessionStatements, getMaxDroppedTagNumberStatements, newestToolTagNumberStatements, droppedNumberStatements, tagByIdStatements, getToolTagNumberByOwnerStatements, getNullOwnerToolTagStatements, adoptNullOwnerToolTagStatements, getToolOwnerByTagIdStatements, deleteToolTagsByOwnerStatements;
34669
34892
  var init_storage_tags = __esm(async () => {
34670
- init_emergency_drop();
34671
34893
  init_tag_owner_id();
34672
34894
  init_migration_v95_perf_indexes();
34673
34895
  init_storage_ops();
34674
34896
  init_storage_tag_identity_revision();
34675
- await init_sqlite();
34897
+ await __promiseAll([
34898
+ init_emergency_drop(),
34899
+ init_sqlite()
34900
+ ]);
34676
34901
  insertTagStatements = new WeakMap;
34677
34902
  updateTagStatusStatements = new WeakMap;
34678
34903
  updateTagDropModeStatements = new WeakMap;
@@ -35217,227 +35442,6 @@ var init_edit_marker = __esm(() => {
35217
35442
  DIFF_KEYS = new Set(["oldString", "newString", "content", "old_string", "new_string"]);
35218
35443
  });
35219
35444
 
35220
- // ../plugin/src/hooks/magic-context/final-wire-completeness.ts
35221
- var init_final_wire_completeness = __esm(() => {
35222
- init_logger();
35223
- });
35224
-
35225
- // ../plugin/src/features/magic-context/merged-reasoning-decisions.ts
35226
- var decodedDecisions, MAX_DECODED_DECISION_BYTES;
35227
- var init_merged_reasoning_decisions = __esm(() => {
35228
- decodedDecisions = new Map;
35229
- MAX_DECODED_DECISION_BYTES = 32 * 1024 * 1024;
35230
- });
35231
- // ../plugin/src/features/magic-context/session-decision-calibration.ts
35232
- var init_session_decision_calibration = __esm(() => {
35233
- init_decision_calibration();
35234
- init_harness_provider_map();
35235
- });
35236
-
35237
- // ../plugin/src/features/magic-context/protection-window.ts
35238
- var init_protection_window = __esm(async () => {
35239
- init_session_decision_calibration();
35240
- await init_storage_tags();
35241
- });
35242
-
35243
- // ../plugin/src/features/magic-context/storage-meta-shared.ts
35244
- var BOOLEAN_META_KEYS, NULL_BIND_META_KEYS, sessionMetaExistsStatements;
35245
- var init_storage_meta_shared = __esm(async () => {
35246
- init_harness_provider_map();
35247
- await init_sqlite();
35248
- BOOLEAN_META_KEYS = new Set(["isSubagent", "compartmentInProgress", "cacheAlertSent"]);
35249
- NULL_BIND_META_KEYS = new Set([
35250
- "cachedM0Bytes",
35251
- "cachedM0MuralDataUrl",
35252
- "cachedM0MuralHash",
35253
- "cachedM1Bytes",
35254
- "cachedM0ProjectMemoryEpoch",
35255
- "cachedM0WorkspaceFingerprint",
35256
- "cachedM0ProjectUserProfileVersion",
35257
- "cachedM0MaxCompartmentSeq",
35258
- "cachedM0MaxMemoryId",
35259
- "cachedM0MaxMutationId",
35260
- "cachedM0MaxMemoryMutationId",
35261
- "cachedM0ProjectDocsHash",
35262
- "cachedM0MaterializedAt",
35263
- "cachedM0SessionFactsVersion",
35264
- "cachedM0UpgradeState",
35265
- "cachedM0ProjectIdentity",
35266
- "lastObservedModelKey",
35267
- "upgradeRemindedAt",
35268
- "upgradeReminderLastSentAt",
35269
- "piStableIdScheme"
35270
- ]);
35271
- sessionMetaExistsStatements = new WeakMap;
35272
- });
35273
-
35274
- // ../plugin/src/features/magic-context/storage-replay-document.ts
35275
- import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
35276
- var MISSING_REPLAY_DOCUMENT_COLUMN, replaySnapshots, decisionTablePresent, trailingBlankReadCache, TRAILING_BLANK_CACHE_MAX_CHARS, DECISION_CONFLICT;
35277
- var init_storage_replay_document = __esm(async () => {
35278
- init_logger();
35279
- await init_storage_meta_shared();
35280
- MISSING_REPLAY_DOCUMENT_COLUMN = Symbol("missing replay document column");
35281
- replaySnapshots = new AsyncLocalStorage2;
35282
- decisionTablePresent = new WeakMap;
35283
- trailingBlankReadCache = new WeakMap;
35284
- TRAILING_BLANK_CACHE_MAX_CHARS = 4 * 1024 * 1024;
35285
- DECISION_CONFLICT = Symbol("replay decision changed concurrently");
35286
- });
35287
-
35288
- // ../plugin/src/features/magic-context/storage-meta-persisted.ts
35289
- var emergencyRecoveryArmedSessions, emergencyRecoveryArmedAtBySession, providerOverflowReconfirmedSessions, providerOverflowKnownLimitSessions, AUTO_SEARCH_NO_HINT_REASONS, DRAIN_WINDOW_MS, WRAPUP_IN_PROGRESS_TTL_MS, COMPACTION_MODE_RECORD_VALUES, EMERGENCY_DRAIN_MAX_LATCH_MS, pendingAutoSearchRetirements, COMPACTION_MARKER_PENDING_BUDGET_MS, preSnapshotSessions, warnedProtectedTokenTierOverrides;
35290
- var init_storage_meta_persisted = __esm(async () => {
35291
- init_magic_context();
35292
- init_harness_provider_map();
35293
- init_logger();
35294
- init_write_transaction_timing();
35295
- init_merged_reasoning_decisions();
35296
- await __promiseAll([
35297
- init_protection_window(),
35298
- init_storage_meta_shared(),
35299
- init_storage_replay_document()
35300
- ]);
35301
- emergencyRecoveryArmedSessions = new Set;
35302
- emergencyRecoveryArmedAtBySession = new Map;
35303
- providerOverflowReconfirmedSessions = new Set;
35304
- providerOverflowKnownLimitSessions = new Set;
35305
- AUTO_SEARCH_NO_HINT_REASONS = new Set([
35306
- "below-threshold",
35307
- "timeout",
35308
- "empty",
35309
- "error",
35310
- "stacked",
35311
- "too-short"
35312
- ]);
35313
- DRAIN_WINDOW_MS = 10 * 60 * 1000;
35314
- WRAPUP_IN_PROGRESS_TTL_MS = 5 * 60 * 1000;
35315
- COMPACTION_MODE_RECORD_VALUES = new Set([
35316
- "on",
35317
- "off",
35318
- "on_notice_pending",
35319
- "off_notice_pending",
35320
- "off_cleanup_pending"
35321
- ]);
35322
- EMERGENCY_DRAIN_MAX_LATCH_MS = 30 * 60 * 1000;
35323
- pendingAutoSearchRetirements = new WeakMap;
35324
- COMPACTION_MARKER_PENDING_BUDGET_MS = 5 * 60000;
35325
- preSnapshotSessions = new Map;
35326
- warnedProtectedTokenTierOverrides = new WeakSet;
35327
- });
35328
-
35329
- // ../plugin/src/features/magic-context/storage-reasoning-removal.ts
35330
- var init_storage_reasoning_removal = __esm(async () => {
35331
- await init_storage_replay_document();
35332
- });
35333
-
35334
- // ../plugin/src/features/magic-context/overflow-detection.ts
35335
- var PREFIX_BOUND_THINKING_MODELS, PREFIX_BOUND_THINKING_PATTERN;
35336
- var init_overflow_detection = __esm(() => {
35337
- PREFIX_BOUND_THINKING_MODELS = [
35338
- ["fable", 5, 1],
35339
- ["fable", 5, 2],
35340
- ["mythos", 5, 1],
35341
- ["mythos", 5, 2],
35342
- ["opus", 5, 5],
35343
- ["sonnet", 5, 5],
35344
- ["haiku", 5, 5]
35345
- ];
35346
- PREFIX_BOUND_THINKING_PATTERN = new RegExp(`(?:^|[-_.:/])(?:${PREFIX_BOUND_THINKING_MODELS.map(([family, major, minor]) => `${family}[-_.]?${major}[-_.]${minor}`).join("|")})(?:$|[-_.:/@])`, "i");
35347
- });
35348
-
35349
- // ../plugin/src/hooks/magic-context/sentinel.ts
35350
- var REMOVED_REASONING_MARK, NEUTRALIZED_ORIGINALS;
35351
- var init_sentinel = __esm(() => {
35352
- init_overflow_detection();
35353
- init_harness_provider_map();
35354
- REMOVED_REASONING_MARK = Symbol.for("magic-context.removed-reasoning");
35355
- NEUTRALIZED_ORIGINALS = new WeakMap;
35356
- });
35357
-
35358
- // ../plugin/src/hooks/magic-context/active-anthropic-turn.ts
35359
- var init_active_anthropic_turn = __esm(() => {
35360
- init_sentinel();
35361
- });
35362
-
35363
- // ../plugin/src/shared/marker-only-text.ts
35364
- var init_marker_only_text = () => {};
35365
- // ../plugin/src/hooks/magic-context/served-shape-repair.ts
35366
- var sources;
35367
- var init_served_shape_repair = __esm(async () => {
35368
- init_tag_content_primitives();
35369
- await init_storage_replay_document();
35370
- sources = new WeakMap;
35371
- });
35372
-
35373
- // ../plugin/src/hooks/magic-context/strip-content.ts
35374
- var METADATA_PART_TYPES, CLEARED_REASONING_TYPES, REASONING_IGNORED_PART_TYPES, REASONING_PART_TYPES, emptyImageParts;
35375
- var init_strip_content = __esm(async () => {
35376
- init_merged_reasoning_decisions();
35377
- init_marker_only_text();
35378
- init_sentinel();
35379
- init_tag_content_primitives();
35380
- init_marker_only_text();
35381
- await init_served_shape_repair();
35382
- METADATA_PART_TYPES = new Set([
35383
- "step-start",
35384
- "step-finish",
35385
- "snapshot",
35386
- "patch",
35387
- "agent",
35388
- "retry",
35389
- "subtask",
35390
- "compaction"
35391
- ]);
35392
- CLEARED_REASONING_TYPES = new Set(["thinking", "reasoning"]);
35393
- REASONING_IGNORED_PART_TYPES = new Set([
35394
- "step-start",
35395
- "step-finish",
35396
- "snapshot",
35397
- "patch",
35398
- "agent",
35399
- "retry",
35400
- "subtask",
35401
- "compaction"
35402
- ]);
35403
- REASONING_PART_TYPES = new Set(["reasoning", "thinking", "redacted_thinking"]);
35404
- emptyImageParts = new WeakMap;
35405
- });
35406
-
35407
- // ../plugin/src/hooks/magic-context/reasoning-budget.ts
35408
- var init_reasoning_budget = __esm(async () => {
35409
- init_merged_reasoning_decisions();
35410
- init_prompt_surface();
35411
- init_active_anthropic_turn();
35412
- init_read_session_formatting();
35413
- init_sentinel();
35414
- await __promiseAll([
35415
- init_storage_meta_persisted(),
35416
- init_storage_reasoning_removal(),
35417
- init_storage_tags(),
35418
- init_strip_content()
35419
- ]);
35420
- });
35421
-
35422
- // ../plugin/src/hooks/magic-context/opaque-thinking.ts
35423
- var init_opaque_thinking = __esm(async () => {
35424
- await init_reasoning_budget();
35425
- });
35426
-
35427
- // ../plugin/src/hooks/magic-context/final-wire-token-estimate.ts
35428
- var wireTextTokens;
35429
- var init_final_wire_token_estimate = __esm(async () => {
35430
- init_tool_definition_tokens();
35431
- init_decision_calibration();
35432
- init_final_wire_completeness();
35433
- init_image_token_estimate();
35434
- init_read_session_formatting();
35435
- init_tokenizer_calibration();
35436
- init_logger();
35437
- await init_opaque_thinking();
35438
- wireTextTokens = createTokenCountMemo(1e5, 128 * 1024 * 1024);
35439
- });
35440
-
35441
35445
  // ../plugin/src/hooks/magic-context/tool-input-size.ts
35442
35446
  var encoder2;
35443
35447
  var init_tool_input_size = __esm(() => {
@@ -48246,10 +48250,16 @@ var init_issue_log_templates_generated = __esm(() => {
48246
48250
  "rewrite permission: allowed=\x01 ride=none served_shape_repair=\x01 signed_prefix_release=\x01 fold_prefix_loss=\x01 first_render=\x01 cache_expired=\x01 thinking_hold=\x01 recovery_has_head=\x01 recovery_head_changed=\x01 recovery_headless_rebuild=\x01 proven_external_fold=\x01 recovered_shape_proof=\x01",
48247
48251
  "[magic-context][pi][\x01] collectMessageEntryIdsByRef: resolved=\x01/\x01 (fingerprint=\x01, branchEntries=\x01, messageEntries=\x01) — unmapped slots fall through to synthesized ids; boundary lookup still works for any compartment whose start/end message is among the resolved set\x020s",
48248
48252
  "[magic-context] storage fatal: refusing to migrate \x01 from upstream migration v\x01 to v\x01 because RPC discovery file \x01 is uncertain (\x01 arm), so the absence of a live OpenCode server cannot be proven. If no OpenCode server is running, it is safe to delete \x01 and retry.\x020p",
48253
+ "served check: a pass without rebuild permission changed served messages first_index=\x01 recorded=\x01 after_first=\x01 served=\x01 class=\x01 seen_by=\x01 kind=replay permitted=unknown decision=\x01 \x01 thinking_hold=\x01 first_render=\x01 host_checkpoint_head=\x01 emergency=\x01 previous_kind=\x01 host=\x01",
48249
48254
  "rewrite permission: allowed=\x01 ride=\x01 served_shape_repair=\x01 signed_prefix_release=\x01 fold_prefix_loss=\x01 first_render=\x01 cache_expired=\x01 thinking_hold=\x01 recovery_has_head=\x01 recovery_head_changed=\x01 recovery_headless_rebuild=\x01 proven_external_fold=\x01 recovered_shape_proof=\x01",
48255
+ "served check: a pass without rebuild permission changed served messages first_index=\x01 recorded=\x01 after_first=\x01 served=\x01 class=\x01 seen_by=\x01 kind=input permitted=unknown decision=\x01 \x01 thinking_hold=\x01 first_render=\x01 host_checkpoint_head=\x01 emergency=\x01 previous_kind=\x01 host=\x01",
48256
+ "served check: a pass without rebuild permission changed served messages first_index=\x01 recorded=\x01 after_first=\x01 served=\x01 class=\x01 seen_by=\x01 kind=pass permitted=unknown decision=\x01 \x01 thinking_hold=\x01 first_render=\x01 host_checkpoint_head=\x01 emergency=\x01 previous_kind=\x01 host=\x01",
48250
48257
  "[shadow] backfill scope \x01 for \x01 retired without progress — the shadow registration was retired or replaced while the provider call was in flight, so the vectors were discarded; \x01+ items remain and automatic registration will not retry unchanged candidates",
48251
48258
  "[magic-context] ORT_DISABLE_TELEMETRY=1 prevents ONNX uploads on POSIX. Windows native ONNX uses OS-controlled ETW diagnostics instead and exposes no JavaScript telemetry-disable API; Windows diagnostic settings and trace collectors govern collection.",
48259
+ "served check: a pass without rebuild permission changed served messages first_index=\x01 recorded=\x01 after_first=\x01 served=\x01 class=\x01 seen_by=\x01 kind=replay permitted=\x01 decision=\x01 \x01 thinking_hold=\x01 first_render=\x01 host_checkpoint_head=\x01 emergency=\x01 previous_kind=\x01 host=\x01",
48252
48260
  "[magic-context] storage warning: continuing migration for \x01; OpenCode server PID \x01 was not confirmed because its liveness or identity check could not run. This commonly means an OS sandbox denied kill(0) or ps. No live OpenCode server was confirmed.\x020p",
48261
+ "served check: a pass without rebuild permission changed served messages first_index=\x01 recorded=\x01 after_first=\x01 served=\x01 class=\x01 seen_by=\x01 kind=input permitted=\x01 decision=\x01 \x01 thinking_hold=\x01 first_render=\x01 host_checkpoint_head=\x01 emergency=\x01 previous_kind=\x01 host=\x01",
48262
+ "served check: a pass without rebuild permission changed served messages first_index=\x01 recorded=\x01 after_first=\x01 served=\x01 class=\x01 seen_by=\x01 kind=pass permitted=\x01 decision=\x01 \x01 thinking_hold=\x01 first_render=\x01 host_checkpoint_head=\x01 emergency=\x01 previous_kind=\x01 host=\x01",
48253
48263
  "usage reading \x01 set aside (\x01): Pi re-estimated its whole unreduced session branch because a context edit or compaction follows the last recorded usage (for example after a retried request); keeping the previous reading until provider usage arrives",
48254
48264
  "prefix trim: boundary \x01 absent from current messages; pass=priced; no in-pass trim applied (degraded pass \x01; boundary does not sort before the first live message \x01; whole window served until a cache-busting pass moves the boundary into the window)",
48255
48265
  "prefix trim: boundary \x01 absent from current messages; pass=defer; no in-pass trim applied (degraded pass \x01; boundary does not sort before the first live message \x01; whole window served until a cache-busting pass moves the boundary into the window)",
@@ -48282,23 +48292,37 @@ var init_issue_log_templates_generated = __esm(() => {
48282
48292
  "projection-cache admission-rejected session=\x01 byte_charge=\x01 entry_budget=\x01 total_budget=\x01 previous_entry_kept=\x01 consequence=full_sync_each_pass_unless_request_snapshot_available fallback=need_full_sync_then_full_request",
48283
48293
  "historian oversize admission refused before spawn: producer_source_exceeds_window producer_source_tokens=\x01 usable_input_tokens=\x01 producer_input_limit_tokens=\x01 context_limit_tokens=\x01 max_output_tokens=\x01 estimator_margin=\x01",
48284
48294
  "WARN: Magic Context \x01 config migration refused: \x01. Legacy and CortexKit config paths collapse to one file, but Magic Context will not overwrite or merge them automatically. Please consolidate manually into \x01. Paths: \x01\x022p,3p",
48295
+ "served check: a pass without rebuild permission changed served messages first_index=\x01 recorded=\x01 after_first=\x01 served=\x01 class=\x01 seen_by=\x01 kind=replay permitted=unknown decision=unknown ride=unknown previous_kind=\x01 host=\x01",
48296
+ "served check: a pass without rebuild permission changed served messages first_index=\x01 recorded=\x01 after_first=\x01 served=\x01 class=\x01 seen_by=\x01 kind=input permitted=unknown decision=unknown ride=unknown previous_kind=\x01 host=\x01",
48285
48297
  "history boundary repair: compartment end \x01 is not in the active host branch; re-anchored on the start of history; removed compartments none for the historian to rebuild; the cached prefix is rebuilt on this pass\x020i",
48286
48298
  "history boundary repair: compartment end \x01 is not in the active host branch; re-anchored on the start of history; removed compartments \x01-\x01 (\x01) for the historian to rebuild; the cached prefix is rebuilt on this pass\x020i",
48299
+ "served check: a pass without rebuild permission changed served messages first_index=\x01 recorded=\x01 after_first=\x01 served=\x01 class=\x01 seen_by=\x01 kind=pass permitted=unknown decision=unknown ride=unknown previous_kind=\x01 host=\x01",
48287
48300
  "foreign context rows accepted: count=\x01 chars=\x01 beforePreparedRow0=\x01 beforePreparedRow1=\x01 beforePreparedRow2=\x01 beforePreparedRow3=\x01; inserted by another extension after Magic Context's pass, outside managed history",
48301
+ "served check: a pass without rebuild permission changed served messages first_index=\x01 recorded=\x01 after_first=\x01 served=\x01 class=\x01 seen_by=\x01 kind=replay permitted=\x01 decision=unknown ride=unknown previous_kind=\x01 host=\x01",
48302
+ "served check: a pass without rebuild permission changed served messages first_index=\x01 recorded=\x01 after_first=\x01 served=\x01 class=\x01 seen_by=\x01 kind=input permitted=\x01 decision=unknown ride=unknown previous_kind=\x01 host=\x01",
48303
+ "served check: a pass without rebuild permission changed served messages first_index=\x01 recorded=\x01 after_first=\x01 served=\x01 class=\x01 seen_by=\x01 kind=pass permitted=\x01 decision=unknown ride=unknown previous_kind=\x01 host=\x01",
48288
48304
  "transform stage: stage=rust.state_sync_detail phase=\x01 elapsed=\x01ms collect_ms=\x01 serialize_ms=\x01 page_build_ms=\x01 status_ms=\x01 transport_ms=\x01 module_ack_ms=\x01 compartments=\x01 tags=\x01 bytes=\x01 pages=\x01 raw_reads=\x01 raw_messages=\x01",
48289
48305
  "history boundary repair: compartment end \x01 is not in the host store; re-anchored on the start of history; removed compartments none for the historian to rebuild; the cached prefix is rebuilt on this pass\x020i",
48290
48306
  "history boundary repair: compartment end \x01 is not in the host store; re-anchored on the start of history; removed compartments \x01-\x01 (\x01) for the historian to rebuild; the cached prefix is rebuilt on this pass\x020i",
48291
48307
  "transform: unknown provider usage; using provider-proven input for priced pass inputTokens=\x01 percentage=\x01 trusted=\x01 wireTokens=\x01 pressureTokens=\x01 grewPastSavedReading=\x01 sizedPlan=clears_reasoning+covered_rows",
48292
48308
  "[dreamer] compress-cues: circuit breaker tripped — \x01 consecutive chunk timeouts (model too slow for its time slice); per-chunk elapsed [\x01ms] vs \x01ms slice; stopping run incomplete with \x01 chunk(s) unattempted",
48309
+ "served check: a change in front of kept signed thinking on a prefix-bound model first_index=\x01 kept_thinking_index=\x01 recorded_thinking_index=\x01 thinking_stripped=\x01 kind=replay permitted=unknown seen_by=\x01 host=\x01",
48293
48310
  "[magic-context][pi][\x01] collectMessageEntryIds length mismatch: expected=\x01 got=\x01 (compactionIndex=\x01 firstKeptEntryId=\x01 totalBranchEntries=\x01) — best-effort mapping returned; boundary trim may not match exactly\x020s",
48294
48311
  "transform: unknown provider usage; using provider-proven input for priced pass inputTokens=\x01 percentage=\x01 trusted=\x01 wireTokens=\x01 pressureTokens=\x01 grewPastSavedReading=\x01 sizedPlan=keeps_reasoning+covered_rows",
48312
+ "served check: a change in front of kept signed thinking on a prefix-bound model first_index=\x01 kept_thinking_index=\x01 recorded_thinking_index=\x01 thinking_stripped=\x01 kind=input permitted=unknown seen_by=\x01 host=\x01",
48313
+ "served check counts: compared=\x01 unknown=\x01 refused=\x01 append_only=\x01 changed=\x01 shorter=\x01 model_changed=\x01 unpermitted_change=\x01 mixed_replay=\x01 thinking_prefix_change=\x01 same_shape_change=\x01 full_checks=\x01 reason=periodic",
48314
+ "served check: a change in front of kept signed thinking on a prefix-bound model first_index=\x01 kept_thinking_index=\x01 recorded_thinking_index=\x01 thinking_stripped=\x01 kind=pass permitted=unknown seen_by=\x01 host=\x01",
48295
48315
  "[magic-context] storage warning: continuing migration for \x01; Pi/OMP PID \x01 was not confirmed as a live harness because the process image or command line was ambiguous. No live Pi harness was confirmed.\x020p",
48296
48316
  "[shadow] backfill scope \x01 for \x01 retired without progress — the selected source rows changed before the writer loaded them; \x01+ items remain and automatic registration will not retry unchanged candidates",
48297
48317
  "[shadow] backfill scope \x01 for \x01 retired without progress — the write completed without satisfying the selected candidate; \x01+ items remain and automatic registration will not retry unchanged candidates",
48318
+ "served check: a change in front of kept signed thinking on a prefix-bound model first_index=\x01 kept_thinking_index=\x01 recorded_thinking_index=\x01 thinking_stripped=\x01 kind=replay permitted=\x01 seen_by=\x01 host=\x01",
48298
48319
  "transform: unknown provider usage; using wire estimate for priced pass inputTokens=\x01 percentage=\x01 trusted=\x01 wireTokens=\x01 pressureTokens=\x01 grewPastSavedReading=\x01 sizedPlan=clears_reasoning+covered_rows",
48320
+ "served check: a change in front of kept signed thinking on a prefix-bound model first_index=\x01 kept_thinking_index=\x01 recorded_thinking_index=\x01 thinking_stripped=\x01 kind=input permitted=\x01 seen_by=\x01 host=\x01",
48299
48321
  "transform: unknown provider usage; using wire estimate for priced pass inputTokens=\x01 percentage=\x01 trusted=\x01 wireTokens=\x01 pressureTokens=\x01 grewPastSavedReading=\x01 sizedPlan=keeps_reasoning+covered_rows",
48322
+ "served check: a change in front of kept signed thinking on a prefix-bound model first_index=\x01 kept_thinking_index=\x01 recorded_thinking_index=\x01 thinking_stripped=\x01 kind=pass permitted=\x01 seen_by=\x01 host=\x01",
48300
48323
  "[magic-context] openai-compatible embedding rate limited (HTTP 429): pausing requests for \x01s (Retry-After); background embedding resumes after the pause and searches run lexical-only until then",
48301
48324
  "[migration] OpenCode harness labels left unverified for \x01 session(s): no readable OpenCode session database (\x01) at \x01. Nothing was relabelled; `magic-context doctor` reports the affected sessions.\x020s,2p",
48325
+ "served check counts: compared=\x01 unknown=\x01 refused=\x01 append_only=\x01 changed=\x01 shorter=\x01 model_changed=\x01 unpermitted_change=\x01 mixed_replay=\x01 thinking_prefix_change=\x01 same_shape_change=\x01 full_checks=\x01 reason=\x01",
48302
48326
  "pi ordinal alignment: stored ordinals run \x01 ahead of the branch walk (newest compartment end \x01 stored at \x01, branch ordinal \x01); numbering the branch from \x01 so stored coordinates keep their meaning",
48303
48327
  "transform: unknown provider usage; using provider-proven input for priced pass inputTokens=\x01 percentage=\x01 trusted=\x01 wireTokens=\x01 pressureTokens=\x01 grewPastSavedReading=\x01 sizedPlan=clears_reasoning",
48304
48328
  "[magic-context] openai-compatible embedding rate limited (HTTP 429): pausing requests for \x01s (backoff); background embedding resumes after the pause and searches run lexical-only until then",
@@ -48341,11 +48365,16 @@ var init_issue_log_templates_generated = __esm(() => {
48341
48365
  "historian redundancy skip: summarizer not needed this pass — force band is \x01%; queued/automatic drops are projected to reclaim to \x01% (target \x01%) on this pass (ride=none)",
48342
48366
  "transform: unknown provider usage; using provider-proven input for priced pass inputTokens=\x01 percentage=\x01 trusted=\x01 wireTokens=\x01 pressureTokens=\x01 sizedPlan=keeps_reasoning",
48343
48367
  "Pi content-decision ledger unreadable: tag identity duplicates are served unmerged and no stored decision is replayed or written; the stored field is left untouched: \x01",
48368
+ "compaction-marker drain: marker unchanged (reason=left-unchanged); serving rebuilt history and keeping the pending marker for the next pass with rewrite permission: \x01",
48369
+ "compaction-marker drain: marker unchanged (reason=left-unchanged); serving rebuilt history and keeping the pending marker for the next pass with rewrite permission:",
48344
48370
  "[magic-context] Magic Context storage is at \x01, outside the folder Engram backs up (~/.local/share/cortexkit/magic-context). It is not included in CortexKit backups.\x020p",
48345
48371
  "[magic-context] Magic Context storage is at \x01, outside the folder Engram backs up (~/.local/share/cortexkit/magic-context). It is not included in CortexKit backups.",
48346
48372
  "provider_usage_not_single_request: message_end input \x01 exceeds pressure evidence bound \x01; ignoring possible turn-aggregate billing usage and using request estimates",
48347
48373
  "historian redundancy skip: summarizer not needed this pass — force band is \x01%; queued/automatic drops are projected to reclaim to \x01% (target \x01%) on this pass (ride=\x01)",
48374
+ "compaction-marker drain: marker unchanged (reason=busy-writer); serving rebuilt history and keeping the pending marker for the next pass with rewrite permission: \x01",
48375
+ "served check: a replay differed from the request served before it first_index=\x01 recorded=\x01 after_first=\x01 served=\x01 class=\x01 seen_by=\x01 refused_pass_permitted=unknown host=\x01",
48348
48376
  "transform: recovery chain stops: \x01ms of the \x01ms inline join budget is left, under the \x01ms a chained run needs; the request is still about \x01 tokens, over the 95% line \x01",
48377
+ "compaction-marker drain: marker unchanged (reason=busy-writer); serving rebuilt history and keeping the pending marker for the next pass with rewrite permission:",
48349
48378
  "compartment injection degraded: boundary \x01 not visible for \x01 passes and no compartment boundary is visible; requesting fresh materialization to re-cut the baseline\x021s",
48350
48379
  "transform: unknown provider usage; using saved provider reading for priced pass inputTokens=\x01 percentage=\x01 countPercentage=\x01 sizedPlan=clears_reasoning+covered_rows",
48351
48380
  "historian redundancy skip: summarizer not needed this pass — usage is \x01%; queued/automatic drops are projected to reclaim to \x01% (target \x01%) on this pass (ride=none)",
@@ -48363,6 +48392,7 @@ var init_issue_log_templates_generated = __esm(() => {
48363
48392
  "[magic-context] registered tools: ctx_search, ctx_memory, ctx_note, ctx_expand, todowrite; registered /todos (ctx_reduce unavailable in compaction-off mode)",
48364
48393
  "model unavailable in isolated retry: it is provided by a disabled extension; configure it through models.json or add a built-in/provider-configured fallback",
48365
48394
  "[pi-subagent] registered tools: ctx_search, todowrite (ctx_note/ctx_expand omitted: --no-session child; memory=\x01, embedding=\x01, git_commits=\x01, dreamer_actions=\x01)",
48395
+ "served check: a replay differed from the request served before it first_index=\x01 recorded=\x01 after_first=\x01 served=\x01 class=\x01 seen_by=\x01 refused_pass_permitted=\x01 host=\x01",
48366
48396
  "overflow detected in compaction-off mode: reportedLimit=\x01 provenance=\x01 pattern=\x01 — recorded limit only (recovery disarmed; native compaction owns the window)",
48367
48397
  "native-attachment-cache reencode_drift session=\x01 drifted_chunks=\x01 first_start=\x01 first_end=\x01 consequence=served_prefix_bytes_changed_under_unchanged_cache_keys",
48368
48398
  "system prompt hash changed: \x01 → \x01 (len=\x01), adopting on the request whose messages are already final (idle-expired request); presetChanged=unknown elements=[\x01]",
@@ -48408,6 +48438,7 @@ var init_issue_log_templates_generated = __esm(() => {
48408
48438
  "[magic-context] compaction-marker slow writer site=\x01 acquire_ms=\x01 statements_ms=\x01 commit_ms=\x01 wal_autocheckpoint=\x01 wal_pages_before=\x01 wal_pages_after=\x01",
48409
48439
  "history boundary unresolved: prefix trim refused (\x01) and the untrimmed request estimate \x01 (trusted=\x01) exceeds the context limit \x01; not sending it; \x01\x023m",
48410
48440
  "history boundary unresolved: prefix trim refused (\x01) and the untrimmed request estimate \x01 (trusted=\x01) exceeds the context limit \x01; not sending it; \x01",
48441
+ "[magic-context] \x01 session(s) with a pending compaction-marker move already serve its history; the move waits for a pass with rewrite permission",
48411
48442
  "compartment trigger: not firing at \x01% — no eligible head (live-prompt floor at \x01); offset=\x01 protectedStart=\x01 eligibleEnd=\x01 rawTokens=\x01 chunkTokens=\x01",
48412
48443
  '[magic-context] historian.model "\x01" lacks provider prefix ("provider/model-id"); using the default context limit for chunk-budget derivation.\x020m',
48413
48444
  '[magic-context] historian.model "\x01" lacks provider prefix ("provider/model-id"); using the default context limit for chunk-budget derivation.',
@@ -48474,10 +48505,12 @@ var init_issue_log_templates_generated = __esm(() => {
48474
48505
  "[magic-context] [ERROR] compaction-marker: candidate worker unavailable \x01: file missing; marker unchanged, advancement deferred\x020p",
48475
48506
  "[magic-context] [ERROR] compaction-marker: candidate worker unavailable \x01: file missing; marker unchanged, advancement deferred",
48476
48507
  "[magic-context] skipping hidden agent '\x01' — prompt unavailable at config time (dir=\x01); will re-register on a later complete pass\x021p",
48508
+ "signed thinking hold: held=false reason=force_band heavyStepsBack=\x01 heavyStepTokens=\x01 usage=\x01% cap=\x01% (sized reading, local count)",
48477
48509
  "[dreamer] compress-cues: stopping before chunk \x01/\x01 — remaining budget \x01ms is below the \x01ms chunk floor; banking \x01 compressed cue(s)",
48478
48510
  'historian failure: source=chunk-coverage reason="chunk omits raw message \x01 while still claiming coverage through \x01" chunkRange=\x01-\x01',
48479
48511
  "historian pathological component split: range=\x01-\x01 resultBoundary=\x01 removedTokens=\x01 producerSourceTokens=\x01 producerInputLimitTokens=\x01",
48480
48512
  "transform: recovery chain stops: the historian's drain budget is spent; the request is still about \x01 tokens, over the 95% line \x01",
48513
+ "signed thinking hold: held=false reason=above_cap heavyStepsBack=\x01 heavyStepTokens=\x01 usage=\x01% cap=\x01% (sized reading, local count)",
48481
48514
  "[magic-context] sqlite writer site=compaction-marker-replace db=opencode acquire_ms=\x01 hold_ms=\x01 work_ms=\x01 end_ms=\x01 outcome=failed",
48482
48515
  '[magic-context] partial recomp failed session=\x01 code=\x01 reason="chunk omits raw message \x01 while still claiming coverage through \x01"\x020s',
48483
48516
  "auto-search: decision outcome=no-candidates reason=\x01 lanes=\x01 nearMisses=\x01 threshold=\x01 pool=\x01 rows=\x01 workerStarted=\x01 peek=\x01 elapsedMs=\x01",
@@ -48491,6 +48524,7 @@ var init_issue_log_templates_generated = __esm(() => {
48491
48524
  "auto-search: decision outcome=\x01 reason=start-failed lanes=\x01 nearMisses=\x01 threshold=\x01 pool=\x01 rows=\x01 workerStarted=\x01 peek=\x01 elapsedMs=\x01",
48492
48525
  "auto-search: decision outcome=\x01 reason=worker-error lanes=\x01 nearMisses=\x01 threshold=\x01 pool=\x01 rows=\x01 workerStarted=\x01 peek=\x01 elapsedMs=\x01",
48493
48526
  "mc-module: render identity session=\x01 changed=\x01 observed=\x01 coordinator=\x01 transition=\x01 tool_present=\x01 profile=\x01 effective=\x01 persisted=\x01",
48527
+ "latest-turn thinking recovery: restore no longer possible (missing-thinking-original); removing the turn's thinking instead",
48494
48528
  "rust compaction-marker admission deferred: reason=capture_inputs fit=\x01 estimated=\x01 trusted=\x01 proxy_tokens=\x01 proxy_bytes=\x01 limit=\x01",
48495
48529
  "tag identity recurred after its one repair: serving without a second rebuild (one cache change) session=\x01 identity=\x01 numbers=\x01\x020s",
48496
48530
  "[magic-context] fail-closed blocking armed (\x01); primary sessions will error until storage recovers or the build is upgraded",
@@ -48501,6 +48535,7 @@ var init_issue_log_templates_generated = __esm(() => {
48501
48535
  "[rpc] another Magic Context RPC server is active for this project (pid \x01, port \x01); starting separate instance on a new port",
48502
48536
  "TRANSIENT STORAGE FAILURE SQLITE_BUSY_OR_LOCKED: LKG unavailable (lkg_emergency_armed); refusing unreduced \x01-message input",
48503
48537
  "[git-commits] indexed \x01: scanned=\x01 inserted=\x01 updated=\x01 evicted=\x01 embedded=0 (embedding skipped: skipEmbed=\x01 gitCommitEnabled=\x01)\x020p",
48538
+ "latest-turn thinking recovery: unbound because a newer message of the turn was accepted (now last=\x01) (stage=\x01 first=\x01 last=\x01)",
48504
48539
  "[auto-search] decision save hit a busy store for session \x01; serving without a hint and retrying the save on a later pass: \x01\x020s",
48505
48540
  "auto-search: decision outcome=\x01 reason=completed lanes=\x01 nearMisses=\x01 threshold=\x01 pool=\x01 rows=\x01 workerStarted=\x01 peek=\x01 elapsedMs=\x01",
48506
48541
  "compartment trigger: not firing at \x01% — below meaningfulness; offset=\x01 protectedStart=\x01 eligibleEnd=\x01 rawTokens=\x01 chunkTokens=\x01",
@@ -48519,6 +48554,7 @@ var init_issue_log_templates_generated = __esm(() => {
48519
48554
  "auto-search: decision outcome=below-threshold lanes=\x01 nearMisses=\x01 threshold=\x01 pool=\x01 rows=\x01 workerStarted=\x01 peek=\x01 elapsedMs=\x01",
48520
48555
  "auto-search: decision outcome=timeout reason=\x01 lanes=\x01 nearMisses=\x01 threshold=\x01 pool=\x01 rows=\x01 workerStarted=\x01 peek=\x01 elapsedMs=\x01",
48521
48556
  "rust compaction-marker admission deferred: reason=output_fit fit=\x01 estimated=\x01 trusted=\x01 proxy_tokens=\x01 proxy_bytes=\x01 limit=\x01",
48557
+ "compaction-marker drain: candidate preparation deferred; pending marker kept for the next pass with rewrite permission",
48522
48558
  "transform: historian join timed out — reclaim and final fit checks continue; historian keeps running in the background",
48523
48559
  "signed thinking fit: could not copy the pass input (\x01); an over-window held request will be refused rather than retried",
48524
48560
  "[magic-context] WARN canonical ordinal warm-up failed for \x01 (\x01: \x01); counts remain bounded and callers must defer or retry\x020s",
@@ -48537,9 +48573,11 @@ var init_issue_log_templates_generated = __esm(() => {
48537
48573
  "compartment trigger: not firing at \x01% — no eligible head; offset=\x01 protectedStart=\x01 eligibleEnd=\x01 rawTokens=\x01 chunkTokens=\x01",
48538
48574
  "historian unanchored promotion skipped: reason=discarded_last facts=\x01 user_observations=\x01 primers=\x01 events_publishable=\x01/\x01",
48539
48575
  "[magic-context] boot hooks phase settled after its deadline; Magic Context runtime installed and fail-closed cleared",
48576
+ "latest-turn thinking recovery: restore unavailable (missing-thinking-original); removing the turn's thinking instead",
48540
48577
  "prefix trim: boundary \x01; pass=defer; no in-pass trim applied (Hidden completion accepts text-only calibrated prompts)",
48541
48578
  "fail-closed blocking surface registered (\x01); primary turns will error until storage recovers or the build is upgraded",
48542
48579
  "mc-module: config warning: prompt_surface.tool_descriptions.\x01 is not a known ctx_* tool ID; the override was ignored.",
48580
+ "signed thinking hold: held=false reason=\x01 heavyStepsBack=\x01 heavyStepTokens=\x01 usage=\x01% cap=\x01% (sized reading, local count)",
48543
48581
  "TRANSIENT STORAGE FAILURE SQLITE_BUSY_OR_LOCKED: LKG unavailable (compaction_off); refusing unreduced \x01-message input",
48544
48582
  "[dreamer] curate safety refusal: session_id=\x01 memory_id=\x01 verdict=\x01 reason=\x01 original_chars=\x01 replacement_chars=\x01 refused=\x01\x020s,6s",
48545
48583
  "[dreamer] retrospective: child rejected \x01-token estimated prompt for size; retrying watermark=\x01 with usable input \x01 -> \x01\x022m",
@@ -48551,6 +48589,7 @@ var init_issue_log_templates_generated = __esm(() => {
48551
48589
  "compaction-off transition could not verify complete marker cleanup; durable cleanup retry will run on the next pass",
48552
48590
  "prefix trim: boundary \x01; pass=priced; no in-pass trim applied (Hidden child first step requires a registered marker)",
48553
48591
  "Magic Context (\x01) storage unavailable at \x01: \x01. fail_closed_blocking=false — degrading silently (hooks not registered).",
48592
+ "latest-turn thinking recovery: restore no longer possible (missing-original:\x01); removing the turn's thinking instead",
48554
48593
  "[migration] OpenCode harness labels repaired from \x01: \x01 session(s) restored to opencode2, \x01 session(s) set to opencode.\x020p",
48555
48594
  "prompt_surface.guidance_override_path (\x01) must contain exactly one \x01 section marker; found \x01. Using built-in guidance.\x020p",
48556
48595
  "[magic-context] compaction-marker consistency check SKIPPED retaining state path=\x01 source=\x01 mode=readonly wal=aware: \x01\x020p",
@@ -48567,8 +48606,10 @@ var init_issue_log_templates_generated = __esm(() => {
48567
48606
  "historian publish stage: stage=parse status=completed elapsed=\x01ms compartments=\x01 dropped_fact_blocks=\x01 dropped_facts=\x01",
48568
48607
  "[magic-context] WARNING: \x01 configured \x01, but OpenCode 2 does not know that model; provider gave no model suggestion\x021m",
48569
48608
  "[auto-search] session \x01: search still running \x01 ms after its deadline; disposing its worker (owner vector wait n/a)\x020s",
48609
+ "signed thinking hold: held=false reason=force_band heavyStepsBack=\x01 heavyStepTokens=\x01 usage=\x01% cap=\x01% (sized reading)",
48570
48610
  "heuristics WILL RUN — reason=m0_hard_fold (drain folded into executed m[0] bust, scheduler=\x01), context=\x01%, turn=n/a",
48571
48611
  "[auto-search] session \x01: search still running \x01 ms after its deadline; disposing its worker (owner vector wait \x01 ms)\x020s",
48612
+ "latest-turn thinking recovery: unbound because a newer turn was accepted (now first=\x01 last=\x01) (stage=\x01 first=\x01 last=\x01)",
48572
48613
  "[dreamer] verify safety refusal: memory_id=\x01 verdict=update reason=content-loss original_chars=\x01 replacement_chars=\x01",
48573
48614
  "channel2 ceiling nudge delivery failed; token-bound pending restore was busy so the stale claim will heal later: \x01",
48574
48615
  "channel2 ceiling nudge delivery failed; token-bound pending restore was busy so the stale claim will heal later:",
@@ -48577,6 +48618,7 @@ var init_issue_log_templates_generated = __esm(() => {
48577
48618
  "[shadow] skipped duplicate memory batch for \x01; the same content was submitted within the one-hour provider budget",
48578
48619
  "channel2 ceiling nudge sent but claim confirmation was not ours (state=\x01); leaving existing lease state unchanged",
48579
48620
  "ERROR: compaction marker disabled: incompatible host binding harness=pi arity=\x01 getEntry=\x01; leaving marker pending",
48621
+ "signed thinking hold: held=false reason=above_cap heavyStepsBack=\x01 heavyStepTokens=\x01 usage=\x01% cap=\x01% (sized reading)",
48580
48622
  "pending ops WILL APPLY — reason=pending_materialization origin=\x01, pendingOps=not loaded (deferred pass) context=\x01%\x020s",
48581
48623
  "[git-commits] sweep finished for \x01 in \x01ms: scanned=\x01 inserted=\x01 updated=\x01 evicted=\x01 embedded=\x01 drained=\x01 backlogDrained=\x01",
48582
48624
  "auto-search: decision outcome=\x01 reason=\x01 lanes=\x01 nearMisses=\x01 threshold=\x01 pool=\x01 rows=\x01 workerStarted=\x01 peek=\x01 elapsedMs=\x01\x020s",
@@ -48586,6 +48628,7 @@ var init_issue_log_templates_generated = __esm(() => {
48586
48628
  "[magic-context] registered tools: ctx_search, ctx_memory, ctx_note, ctx_expand, ctx_reduce (todowrite disabled)",
48587
48629
  "[magic-context] storage unavailable: native turn deadlines must be selected on the first open; restart the host",
48588
48630
  "compartment agent skipped: compartment lease held by another process (owner unavailable after acquisition race)",
48631
+ "latest-turn thinking recovery: restore no longer possible (no-turn-start); removing the turn's thinking instead",
48589
48632
  "[magic-context] WARNING: \x01 configured \x01, but Oh My Pi does not know that model; provider gave no model suggestion\x021m",
48590
48633
  "[magic-context] WARNING: \x01 configured \x01, but OpenCode does not know that model; provider gave no model suggestion\x021m",
48591
48634
  "[shadow] skipped duplicate chunk batch for \x01; the same content was submitted within the one-hour provider budget",
@@ -48609,10 +48652,14 @@ var init_issue_log_templates_generated = __esm(() => {
48609
48652
  "[magic-context] embedding endpoint blocked: embedding endpoint host \x01 is link-local / cloud metadata (blocked)",
48610
48653
  "DEGRADED PASS SQLITE_BUSY_OR_LOCKED: LKG unavailable (lkg_emergency_armed); refusing unreduced \x01-message input",
48611
48654
  "TRANSIENT STORAGE FAILURE SQLITE_BUSY_OR_LOCKED: LKG replay unavailable (\x01); refusing unreduced \x01-message input",
48655
+ "latest-turn thinking recovery: provider rejected the bound turn again (rejection \x01, first=\x01 last=\x01); \x01 -> refused",
48656
+ "latest-turn thinking recovery: provider rejected the bound turn again (rejection \x01, first=\x01 last=\x01); \x01 -> removed",
48612
48657
  "pending ops WILL APPLY — reason=pending_materialization origin=pending_materialization, pendingOps=\x01 context=\x01%",
48613
48658
  "auto-search: decision outcome=error lanes=\x01 nearMisses=\x01 threshold=\x01 pool=\x01 rows=\x01 workerStarted=\x01 peek=\x01 elapsedMs=\x01",
48659
+ "latest-turn thinking recovery: restore unavailable (missing-original:\x01); removing the turn's thinking instead",
48614
48660
  "prefix trim: boundary \x01; pass=priced; no in-pass trim applied (boundary \x01 appears \x01 times in the live messages)",
48615
48661
  "overflow detected on subagent via message.updated: reportedLimit=\x01 provenance=\x01 pattern=\x01 — recorded limit only",
48662
+ "latest-turn thinking recovery: provider rejected the bound turn again (rejection \x01, first=\x01 last=\x01); \x01 -> remove",
48616
48663
  "compartment trigger: skipped — no new raw history (usage=\x01% nextStartOrdinal=\x01 diagnostic-collection-failed: \x01)",
48617
48664
  "tag identity unresolved: serving with a newly allocated tag number (one cache change per identity) session=\x01 \x01\x020s",
48618
48665
  "[magic-context] registered todowrite overlay: DISABLED (todowrite.enabled=false or todowrite.overlay=false)",
@@ -48623,18 +48670,22 @@ var init_issue_log_templates_generated = __esm(() => {
48623
48670
  "compaction-marker: no user boundary found at or before endMessageId \x01 (ordinal \x01); preserving existing marker",
48624
48671
  "prefix trim: boundary \x01; pass=defer; no in-pass trim applied (boundary \x01 appears \x01 times in the live messages)",
48625
48672
  "over-window first pass reduced: the request is about \x01 tokens (history started at \x01), under the \x01-token window",
48673
+ "latest-turn thinking recovery: provider rejected the bound turn again (rejection \x01, first=\x01 last=\x01); \x01 -> armed",
48626
48674
  "historian prompt fit: sized to \x01 (chunkTokens=\x01 sessionReferences=\x01 memories=\x01/\x01 seeds=\x01/\x01; requestedChunkTokens=\x01)\x020m",
48627
48675
  "system prompt hash changed: \x01 → \x01 (len=\x01), triggering flush (idle-expired request); presetChanged=\x01 elements=[\x01]",
48628
48676
  "[mc-module][\x01] historian prompt fit: chunkTokens=\x01 requestedChunkTokens=\x01 sessionReferences=\x01 memories=\x01/\x01 seeds=\x01",
48677
+ "served check: content changed with the same shape first_index=\x01 seen_by=\x01 kind=replay permitted=unknown host=\x01",
48629
48678
  "[magic-context] instance disposed — stopped RPC server, dream timer, auto-update, Rust replay registration",
48630
48679
  "historian deferred: exact ordinals not ready (ordinal warm-up still running); a later pass starts it again",
48631
48680
  "prefix trim: boundary \x01; pass=priced; no in-pass trim applied (boundary absent from immutable source order)",
48632
48681
  "[shadow] skipped duplicate \x01 batch for \x01; the same content was submitted within the one-hour provider budget",
48633
48682
  "prefix trim: boundary \x01; pass=priced; source order not usable (\x01); placing the boundary by the live messages",
48683
+ "compaction-marker drain: pass has no rewrite permission; ordinal \x01 waits for a pass with rewrite permission",
48634
48684
  "[magic-context] embedding endpoint blocked: embedding endpoint host \x01 is a cloud metadata service (blocked)",
48635
48685
  "[magic-context] sqlite writer site=\x01 db=opencode acquire_ms=\x01 hold_ms=\x01 work_ms=\x01 end_ms=\x01 outcome=not_acquired",
48636
48686
  "compartment trigger: tail-size fire — ~\x01 TC-chunked tokens (hasMore=\x01, true-raw ~\x01) exceeds \x01 budget threshold",
48637
48687
  "rust compaction-marker: pending target write skipped on lock contention; next cache-busting pass retries: \x01",
48688
+ "served check: content changed with the same shape first_index=\x01 seen_by=\x01 kind=input permitted=unknown host=\x01",
48638
48689
  '⚠️ Magic Context: The "protected_tags" setting is deprecated and ignored. Use "protected_tokens" instead.',
48639
48690
  "outgoing fit: upper-estimate-pressure; reclaim held by signed prefix, deferred pass or used session latch",
48640
48691
  "prefix trim: boundary \x01; pass=defer; no in-pass trim applied (boundary absent from immutable source order)",
@@ -48647,10 +48698,13 @@ var init_issue_log_templates_generated = __esm(() => {
48647
48698
  "final representation: clearedParts=\x01 mergedReasoningParts=\x01 removedReasoningParts=\x01 settledDroppedReasoning=\x01",
48648
48699
  "mc-module: overflow recovery arm has no eligible history boundary; suppressing forced emergency pass for \x01",
48649
48700
  "note-nudge: suppressing — agent ran ctx_note(read) at \x01 and the read is still visible; no new notes since \x01",
48701
+ "served check: content changed with the same shape first_index=\x01 seen_by=\x01 kind=pass permitted=unknown host=\x01",
48702
+ "latest-turn thinking recovery: restore unavailable (no-turn-start); removing the turn's thinking instead",
48650
48703
  "ctx_reduce permission is denied for agent=\x01; session freezes without ctx_reduce tags, guidance, or nudges",
48651
48704
  "[magic-context] v2 store reader pool still held by \x01 hidden run(s) at dispose; it closes when they finish",
48652
48705
  "clone-inheritance: migrated compartments=\x01 tags=\x01 notes=\x01 facts=\x01 source=unknown dest=unknown reason=startup",
48653
48706
  "DEGRADED PASS SQLITE_BUSY_OR_LOCKED: LKG unavailable (compaction_off); refusing unreduced \x01-message input",
48707
+ "latest-turn thinking recovery: a request without the turn's removed thinking was accepted (first=\x01 last=\x01)",
48654
48708
  "transform: final-wire telemetry estimate=\x01 trusted=\x01 conversation=\x01 tools=\x01 system=\x01 toolDefinitions=\x01 tail=[\x01]",
48655
48709
  "auto-search: decision outcome=\x01 lanes=\x01 nearMisses=\x01 threshold=\x01 pool=\x01 rows=\x01 workerStarted=\x01 peek=\x01 elapsedMs=\x01\x020s",
48656
48710
  "auto-search: decision outcome=\x01 lanes=\x01 nearMisses=\x01 threshold=\x01 pool=\x01 rows=\x01 workerStarted=\x01 peek=\x01 elapsedMs=\x01",
@@ -48663,11 +48717,13 @@ var init_issue_log_templates_generated = __esm(() => {
48663
48717
  "v2 usage: ignored server-fallback reply inputTokens=\x01 (sum of two server runs); keeping previous reading",
48664
48718
  "caveman cleanup: switched to current rules (language-neutral word rules), rewrote \x01 compressed text tags",
48665
48719
  "[magic-context] sqlite writer site=\x01 db=opencode acquire_ms=\x01 hold_ms=\x01 work_ms=\x01 end_ms=\x01 outcome=committed",
48720
+ "signed thinking hold: held=false reason=\x01 heavyStepsBack=\x01 heavyStepTokens=\x01 usage=\x01% cap=\x01% (sized reading)",
48666
48721
  '[magic-context] partial recomp failed session=\x01 code=\x01 reason="chunk coverage ends at \x01 but chunk end is \x01"\x020s',
48667
48722
  "pending ops WILL APPLY — reason=ride=none (scheduler=\x01), pendingOps=not loaded (deferred pass) context=\x01%",
48668
48723
  "[magic-context] buildAllowOnlyPermission: allow-list UNDEFINED for \x01 — registering deny-all (defensive) \x01",
48669
48724
  "historian no-op: protectedTailStart=\x01 eligibleEnd=\x01 <= offset=\x01 — nothing to compact; boundaryDiagnostics=\x01",
48670
48725
  "historian unanchored promotion skipped: reason=\x01 facts=\x01 user_observations=\x01 primers=\x01 events_publishable=\x01/\x01",
48726
+ "latest-turn thinking recovery: rejection not bound, no pass in this process built the rejected request",
48671
48727
  'recomp partial code=\x01 reason="remaining messages \x01-\x01 were too few or all noise to form a historian chunk"',
48672
48728
  "[magic-context] buildAllowOnlyPermission: allow-list UNDEFINED for \x01 — registering deny-all (defensive)",
48673
48729
  "raw_fallback_over_context_limit estimated=\x01 trusted=\x01 proxy_bytes=\x01 proxy_tokens=\x01 limit=\x01 early_abort=true",
@@ -48701,8 +48757,8 @@ var init_issue_log_templates_generated = __esm(() => {
48701
48757
  "[dreamer] verify-broad: verified=\x01 updated=\x01 archived=\x01 skipped=\x01 refused=\x01 batches=\x01 remaining=\x01 complete=\x01",
48702
48758
  "mc-module: pending drops held session=\x01 reason=no_originating_cache_bust scheduler=\x01 historian_active=\x01",
48703
48759
  "OMP structural comparison skipped: \x01; stale prepared requests are not detected on this pass; session=\x01",
48760
+ "served check: content changed with the same shape first_index=\x01 seen_by=\x01 kind=replay permitted=\x01 host=\x01",
48704
48761
  "WARNING unwritten served-ledger tail session=\x01 file=\x01 ignored_zero_bytes=\x01 retained_bytes=\x01 total_bytes=\x01\x020s,1p",
48705
- "compaction-marker drain: candidate preparation deferred; preserving deferred history refresh signal",
48706
48762
  "historian deferred: exact ordinals not ready (chunk start unreadable); a later pass starts it again",
48707
48763
  "Pi note-nudge: latest user message has no resolved SessionEntry id; deferring delivery to next pass",
48708
48764
  "[dreamer] pruned schedule rows of \x01 idle identities (no memories, no recent sessions, no task input)",
@@ -48716,19 +48772,24 @@ var init_issue_log_templates_generated = __esm(() => {
48716
48772
  'historian no-op: stored compartments still invalid ("overlap before message \x01 (saw \x01-\x01)"); backing off',
48717
48773
  "[magic-context] WARNING: \x01 configured \x01, but OpenCode 2 does not know that model; provider suggests \x01…\x021m",
48718
48774
  "compaction-marker hygiene: removed fork-orphaned marker part=\x01 boundary=\x01 (outranked owned boundary \x01)\x021i,2i",
48775
+ "latest-turn thinking recovery: removed thinking from the bound turn (parts=\x01 messages=\x01 first=\x01 last=\x01)",
48719
48776
  "pending ops WILL APPLY — reason=ride=\x01 (scheduler=\x01), pendingOps=not loaded (deferred pass) context=\x01%",
48720
48777
  "[magic-context] partial recomp cleanup: clearing orphaned staging without range marker for session \x01\x020s",
48721
48778
  "Pi compaction-marker drain: persisted compactionId=\x01 firstKept=\x01 endMessageId=\x01 ordinal=\x01 tokensBefore=\x01\x022i",
48722
48779
  "projection-cache miss session=\x01 reason=missing current_epoch=\x01 retained_bytes=\x01 entries=\x01 total_budget=\x01",
48780
+ "served check: content changed with the same shape first_index=\x01 seen_by=\x01 kind=input permitted=\x01 host=\x01",
48723
48781
  "tool_sweep_lkg_mismatch session=\x01 condition=\x01 last_served_rows=\x01 legacy_divergence=\x01 scoped_divergence=\x01\x020s",
48724
48782
  "mc-module: WARN MC_DRIVE_FAULT=fingerprint_skew active — response deliberately corrupted for drive",
48725
48783
  "mc-module: WARN MC_DRIVE_FAULT=omit_ck_messages active — response deliberately corrupted for drive",
48726
48784
  "pi m[0] cache_invalid materialization contention exhausted; rendered fresh non-persisted m[0]/m[1]",
48727
48785
  "rust compaction-marker drain: pending target not covered by served response; retaining retry state",
48728
48786
  "historian skipped ordinals \x01-\x01: all \x01 raw rows excluded by chunk filters (no-content boundary marker)",
48787
+ "latest-turn thinking recovery: restore no longer possible (\x01); removing the turn's thinking instead",
48729
48788
  "neutralized \x01 dropped + \x01 system-injected messages + \x01 hidden-at-marker-seam (\x01 new, \x01 total persisted)",
48789
+ "latest-turn thinking recovery: unbound because the request now goes through \x01 (stage=\x01 first=\x01 last=\x01)\x020m",
48730
48790
  "[dreamer] map-memories: committed=\x01 mapped=\x01 independent=\x01 batches=\x01 remaining=\x01 complete=\x01 stop_reason=\x01",
48731
48791
  "[magic-context] WARNING: \x01 configured \x01, but OpenCode 2 does not know that model; provider suggests \x01\x021m",
48792
+ "served check: content changed with the same shape first_index=\x01 seen_by=\x01 kind=pass permitted=\x01 host=\x01",
48732
48793
  "tag identity decision tag-identity-repair-once could not be written; serving duplicates unmerged: \x01",
48733
48794
  "historian deferred: exact ordinals not ready (bounded read refused); a later pass starts it again",
48734
48795
  "[dreamer] pruned schedule rows of \x01 idle identity (no memories, no recent sessions, no task input)",
@@ -48764,6 +48825,8 @@ var init_issue_log_templates_generated = __esm(() => {
48764
48825
  "v2 refusal: interrupting the turn before the provider request arm=checkpoint-fit-estimate cause=\x01",
48765
48826
  "v2 refusal: interrupting the turn before the provider request arm=unsupported-session-api cause=\x01",
48766
48827
  "[magic-context] host stall profiler: bun:jsc is unavailable, profiler disabled for this process",
48828
+ "frozen replay release: the history head differs from the replay's; counting it as a head change",
48829
+ "restart: the history head differs from the saved last-good request's; stripping signed thinking",
48767
48830
  "[\x01] primary (\x01/\x01) failed validation/prompt: \x01; \x01 fallback(s) configured, subject to remaining budget\x021m,2m",
48768
48831
  "[dreamer] verify safety refusal: memory_id=\x01 verdict=update reason=directive-shaped-project-rule",
48769
48832
  "transform: model switch \x01 -> \x01 reset — percentage=\x01% tokens=\x01 — clearing stale model-specific state\x020s",
@@ -48774,6 +48837,7 @@ var init_issue_log_templates_generated = __esm(() => {
48774
48837
  "v2 refusal: interrupting the turn before the provider request arm=checkpoint-over-window cause=\x01",
48775
48838
  '[magic-context] Stripped deprecated "clear_reasoning_age" key during config location migration',
48776
48839
  "[magic-context] WARN: invalid workspace share_categories; sharing no foreign memory categories",
48840
+ "latest-turn thinking recovery: ended after a signed-thinking reset removed the turn's thinking",
48777
48841
  "message FTS async clear and reindex skipped (database busy; will retry on next reconciliation)",
48778
48842
  "v2 setup() called on a host without session.hook; v1 server lane owns this host, v2 lane inert",
48779
48843
  "opaque thinking fallback: steps=\x01 tokensPerStep=1000 (native usage unavailable; telemetry only)",
@@ -48832,6 +48896,7 @@ var init_issue_log_templates_generated = __esm(() => {
48832
48896
  "degraded pass over the context limit: estimate=\x01 trusted=\x01 limit=\x01 degradations=\x01; not sending it",
48833
48897
  "[mural] skipped for \x01: only \x01/\x01 active memories have current cues (requires \x01 cues or \x01% coverage)",
48834
48898
  "[dreamer] verify warning: dropping \x01 unknown verification entries outside the current batch (\x01)",
48899
+ "latest-turn thinking recovery: unbound because the request now goes to \x01 (stage=\x01 first=\x01 last=\x01)\x020m",
48835
48900
  "thinking binding recovery armed from message.updated (provider paths: failing=\x01 firstChanged=\x01)\x020p,1p",
48836
48901
  "[magic-context] config hook failed (commands/agents NOT registered; transform still active): \x01",
48837
48902
  "heuristics WILL RUN — reason=ride=\x01 subagent_rerun (pendingOps=\x01, scheduler=\x01), context=\x01%, turn=\x01",
@@ -48856,6 +48921,7 @@ var init_issue_log_templates_generated = __esm(() => {
48856
48921
  "models-dev-cache: API refresh returned no providers payload (will retry if attempts remain)",
48857
48922
  "subagent child detected (MAGIC_CONTEXT_PI_SUBAGENT=1); skipping full extension registration",
48858
48923
  "mc-module: historian for \x01 not fired: the transform request carried no historian_model_chain",
48924
+ "latest-turn thinking recovery: restore unavailable (\x01); removing the turn's thinking instead",
48859
48925
  "event message.updated: usage \x01 from \x01 arrived after newer message \x01; keeping the newer reading\x021i,2s",
48860
48926
  "heuristic cleanup: dropped \x01 tool tags, deduplicated \x01 tool calls, dropped \x01 system injections",
48861
48927
  "mc-module: duplicate_tool_use_id session=\x01 id=\x01 message_index=\x01 block_index=\x01 action=drop_later",
@@ -48878,6 +48944,7 @@ var init_issue_log_templates_generated = __esm(() => {
48878
48944
  "rust compaction-marker drain: retryable failure after module row \x01; pending target retained",
48879
48945
  "[magic-context] compaction-marker: deferred candidate preparation for \x01: \x01; marker unchanged\x020s",
48880
48946
  "DEGRADED PASS SQLITE_BUSY_OR_LOCKED: LKG unavailable (\x01); refusing unreduced \x01-message input",
48947
+ "latest-turn thinking recovery: armed for the provider's latest turn (first=\x01 last=\x01 model=\x01/\x01)\x023m",
48881
48948
  "transform: bumping percentage to 95% due to overflow recovery flag (was \x01%, detectedLimit=\x01)",
48882
48949
  "transform: skipping compartment start, no eligible history before protected tail (beyond \x01)",
48883
48950
  "[magic-context] WARNING: \x01 configured \x01, but Pi does not know that model; provider suggests \x01\x021m",
@@ -48893,6 +48960,7 @@ var init_issue_log_templates_generated = __esm(() => {
48893
48960
  "WARNING: \x01 compartments share endMessageId=\x01 — schema invariant violated; treating as stale\x021i",
48894
48961
  "transform: recovery chain stops: the last historian run published nothing (\x01 chained runs)",
48895
48962
  "injected generic guidance into system prompt (ctxReduce=\x01, subagent=\x01, subagentReduceMode=\x01)",
48963
+ "latest-turn thinking recovery: armed for the provider's latest turn (first=\x01 last=\x01 model=\x01)\x022m",
48896
48964
  `recomp partial code=\x01 reason="the history model's window cannot hold a historian prompt: \x01"`,
48897
48965
  "thinking-binding recovery armed from message_end (provider paths: failing=\x01 firstChanged=\x01)\x020p,1p",
48898
48966
  "[magic-context] legacy WAL checkpoint before copy failed (continuing with sidecar copy): \x01",
@@ -48901,6 +48969,7 @@ var init_issue_log_templates_generated = __esm(() => {
48901
48969
  "rehydrated \x01 Pi deferred compaction marker session(s); sessionIds=\x01; activeSessionIncluded=\x01\x020s,2s",
48902
48970
  "[magic-context] registered auto-search hint: DISABLED (memory.auto_search.enabled=false)",
48903
48971
  "[magic-context] registered dreamer: DISABLED (dreamer.disable=true or no dreamer config)",
48972
+ "latest-turn thinking recovery: refused locally (the thinking removal could not be saved)",
48904
48973
  "v2 refusal: interrupting the turn before the provider request arm=checkpoint-over-window",
48905
48974
  "mc-module: wrapup for \x01 refused: the session's transform carried no historian_model_chain",
48906
48975
  "pi ordinal alignment: \x01: \x01; historian and native compaction marker paused for this session",
@@ -48918,6 +48987,7 @@ var init_issue_log_templates_generated = __esm(() => {
48918
48987
  "[magic-context] registered historian trigger (model=\x01, fallbacks=\x01, executeThreshold=\x01% (\x01))\x020m",
48919
48988
  "[magic-context] partial recomp merged validation failed: gap before message \x01 (expected \x01)",
48920
48989
  "[magic-context] partial recomp merged validation failed: overlap before message \x01 (saw \x01-\x01)",
48990
+ "latest-turn thinking recovery: binding rejection handed to the binding recovery (stage=\x01)",
48921
48991
  "[magic-context] slow write transaction: site=storage_meta_wrapup_expiry_cleanup held=\x01ms \x01",
48922
48992
  "[magic-context] transform FAILED code=\x01 name=\x01: \x01. No last-good replay; refusing the turn. \x01",
48923
48993
  "ERROR [tail-hygiene-last-writer-check-failed]: structural production guard failed open: \x01",
@@ -48928,6 +48998,8 @@ var init_issue_log_templates_generated = __esm(() => {
48928
48998
  "[magic-context] protected_tags is deprecated and ignored; use protected_tokens instead.",
48929
48999
  "ERROR [tail-hygiene-last-writer-check-failed]: structural production guard failed open:",
48930
49000
  "historian: cleared stale compartmentInProgress flag on first context pass after restart",
49001
+ "served check: record dropped reason=native_compaction; the next request is not compared",
49002
+ "thinking binding recovery clear failed after the request was decided; serving the pass:",
48931
49003
  "v2 refusal: interrupting the turn before the provider request arm=transform-fail-closed",
48932
49004
  "[magic-context] transform FAILED code=\x01 name=\x01: \x01. No last-good replay; refusing the turn.",
48933
49005
  "rust compaction-marker drain: CAS lost after module row \x01; newer pending target retained",
@@ -48966,7 +49038,10 @@ var init_issue_log_templates_generated = __esm(() => {
48966
49038
  "[magic-context] host stall profiler: \x01ms main-thread stall, \x01 samples, top owner none → \x01\x022p",
48967
49039
  "historian publish stage: stage=post-publish-drops status=started elapsed=0.0ms range=\x01-\x01",
48968
49040
  "mc-request-byte-cap refused bytes=\x01 cap=\x01 method=\x01 kind=\x01 session=\x01 page_index=\x01 page_total=\x01",
49041
+ "latest-turn thinking recovery: refused locally (the recovery state could not be read)",
48969
49042
  "rust compaction-marker drain: candidate preparation deferred; pending target retained",
49043
+ "served check: record dropped reason=session_cleared; the next request is not compared",
49044
+ "served check: record dropped reason=session_deleted; the next request is not compared",
48970
49045
  "v2 refusal: interrupting the turn before the provider request arm=storage-notice-turn",
48971
49046
  "v2 refusal: interrupting the turn before the provider request arm=storage-unavailable",
48972
49047
  "[v22-backfill] completed with \x01 unresolved failure(s); run doctor --retry-v22-backfill",
@@ -48979,6 +49054,7 @@ var init_issue_log_templates_generated = __esm(() => {
48979
49054
  "[magic-context] tool-owner backfill failed (continuing with lazy adoption fallback): \x01",
48980
49055
  "historian publish stage: stage=post-publish-drops status=completed elapsed=\x01ms range=\x01-\x01",
48981
49056
  "raw_fallback_over_context_limit estimated=\x01 trusted=\x01 proxy_bytes=\x01 proxy_tokens=\x01 limit=\x01",
49057
+ "transform refused degraded pass site=host-instruction-retention-persistence-failure: \x01",
48982
49058
  "transform: emergency fail-closed abort failed; refusing to return a sendable prompt: \x01",
48983
49059
  "v2 refusal: interrupting the turn before the provider request arm=storage-busy cause=\x01",
48984
49060
  "WARN: [magic-context] persistent storage unavailable; disabling magic-context tools: \x01",
@@ -48987,6 +49063,7 @@ var init_issue_log_templates_generated = __esm(() => {
48987
49063
  "mc-module: WARN MC_DRIVE_FAULT=channel2_arm active — directive force-armed for drive",
48988
49064
  "merged reasoning strip: persistence failed; leaving newly detected assistants intact",
48989
49065
  "Pi auto-search: strict entry-id resolution failed; replayed persisted decisions only",
49066
+ "request tools release record failed after the request was decided; serving the pass:",
48990
49067
  "session_before_compact: cancelling — magic-context fail-closed (storage unavailable)",
48991
49068
  "transform refused degraded pass site=host-instruction-retention-persistence-failure:",
48992
49069
  "transform: emergency fail-closed abort failed; refusing to return a sendable prompt:",
@@ -48994,6 +49071,7 @@ var init_issue_log_templates_generated = __esm(() => {
48994
49071
  "memory embedding skipped for memory \x01: content changed before the embedding finished.",
48995
49072
  "stable-id scheme cutover: stored=\x01 < current=\x01 — forcing execute+materialize this pass",
48996
49073
  "Pi held identity rebuild: prior prefix unavailable (\x01); applying the declared rebuild",
49074
+ "thinking binding recovery: stripped bound reasoning from \x01 assistant(s) [\x01]; flag=kept",
48997
49075
  "compartment trigger: proactive fire at \x01% (floor=\x01% projected post-drop=none target=\x01%)",
48998
49076
  "context limit resolved: \x01 for \x01 (catalog \x01, overflow-detected \x01, proven accepted input \x01)\x021m",
48999
49077
  "pending ops WILL NOT APPLY — reason=\x01 pendingOps=not loaded (deferred pass) context=\x01%",
@@ -49008,6 +49086,7 @@ var init_issue_log_templates_generated = __esm(() => {
49008
49086
  "[magic-context] conflict-warning: could not find active session for Desktop warning",
49009
49087
  "[magic-context] event message.removed: no message removal info extracted from event",
49010
49088
  "[magic-context] plugin DISABLED via config (enabled: false) — skipping registration",
49089
+ "conversation token estimate failed after the request was decided; serving the pass:",
49011
49090
  "historian publish stage: stage=dangling-boundary-check status=started elapsed=0.0ms",
49012
49091
  "Pi publication mirror_failed reason=identity_mirror_failed; serving managed context",
49013
49092
  "rust thinking binding recovery: persistence failed; leaving the bound blocks intact",
@@ -49060,6 +49139,8 @@ var init_issue_log_templates_generated = __esm(() => {
49060
49139
  "[magic-context] openai-compatible embedding provider is missing endpoint or model",
49061
49140
  "channel2 ceiling nudge sent but token-confirm failed; lease state left unchanged:",
49062
49141
  "pending operations write admission busy; retaining remaining operations for retry",
49142
+ "served system hash record failed after the request was decided; serving the pass:",
49143
+ "transform decision record failed after the request was decided; serving the pass:",
49063
49144
  "transform refused degraded pass site=trailing-blank-decision-persistence-failure:",
49064
49145
  "v2 refusal: interrupting the turn before the provider request arm=compaction-fold",
49065
49146
  "m[0] drift watcher: mutation id changed \x01 → \x01; scheduling next-pass materialization\x021s",
@@ -49086,6 +49167,7 @@ var init_issue_log_templates_generated = __esm(() => {
49086
49167
  "historian publish stage: stage=validate status=completed elapsed=\x01ms compartments=\x01",
49087
49168
  "mc-pass-stage session=\x01 stage=historian_inline_wait event=end outcome=\x01 elapsed_ms=\x01\x020s",
49088
49169
  "transform: over-window first-pass check could not estimate the incoming history: \x01",
49170
+ "final wire usage capture failed after the request was decided; serving the pass:",
49089
49171
  "Pi publication commit_failed reason=envelope_unreadable; serving managed context",
49090
49172
  "Pi publication commit_failed reason=number_write_failed; serving managed context",
49091
49173
  "transform refused degraded pass site=merged-reasoning-strip-persistence-failure:",
@@ -49120,6 +49202,7 @@ var init_issue_log_templates_generated = __esm(() => {
49120
49202
  "[magic-context] openai-compatible embedding: endpoint recovered, circuit closed",
49121
49203
  "[magic-context] project embedding sweep already in progress, skipping this tick",
49122
49204
  "[magic-context] v2 host exposes no command domain; /ctx-* commands are TUI-only",
49205
+ "deferred last-good save failed after the request was decided; serving the pass:",
49123
49206
  "historian no-op: missing protected-tail boundary snapshot from trigger decision",
49124
49207
  "LKG ASYNC CAPTURE FAILED; forcing synchronous capture on the next applied pass:",
49125
49208
  "message FTS reconciliation stalled: raw message reader is not ready; will retry",
@@ -49127,7 +49210,9 @@ var init_issue_log_templates_generated = __esm(() => {
49127
49210
  "Pi publication commit_failed reason=pair_commit_failed; serving managed context",
49128
49211
  "placeholder strip: persistence failed; leaving newly discovered messages intact",
49129
49212
  "processed-image strip: persistence failed; leaving newly detected images intact",
49213
+ "reasoning budget status failed after the request was decided; serving the pass:",
49130
49214
  "rust trailing blank decision: persistence failed; serving only frozen decisions",
49215
+ "served check: record dropped reason=host_edit; the next request is not compared",
49131
49216
  "v2 host fold: note checkpoint without a recorded head; serving restored history",
49132
49217
  "WARN: [auto-update-checker] Discarded stale or mismatched pending update marker",
49133
49218
  "exact ordinal read unavailable (\x01: \x01); the historian start waits for a later pass",
@@ -49142,6 +49227,7 @@ var init_issue_log_templates_generated = __esm(() => {
49142
49227
  "[magic-context] slow write transaction: site=opencode_materialize_cache held=\x01ms",
49143
49228
  "[magic-context] slow write transaction: site=storage_meta_wrapup_update held=\x01ms",
49144
49229
  "[session-projects] backfilled \x01 of \x01 unmapped sessions (skipped \x01 dead dirs) in \x01ms",
49230
+ "latest-turn thinking recovery: restore applied to the bound turn (first=\x01 last=\x01)",
49145
49231
  "[magic-context] slow write transaction: site=compartment_state_replace held=\x01ms \x01",
49146
49232
  "[magic-context] slow write transaction: site=embedding_identity_record held=\x01ms \x01",
49147
49233
  "[magic-context] slow write transaction: site=message_index_incremental held=\x01ms \x01",
@@ -49150,6 +49236,7 @@ var init_issue_log_templates_generated = __esm(() => {
49150
49236
  "transform: preserving detected limit \x01 and overflow recovery for outgoing model \x01",
49151
49237
  "v2 context omitted a content part the host would reject: type=\x01 message=\x01 reason=\x01",
49152
49238
  "historian publish stage: stage=post-publish-drops status=started elapsed=0.0ms",
49239
+ "pass permission report failed after the request was decided; serving the pass:",
49153
49240
  "system-prompt-hash skipped (OpenCode internal agent: title/summary/compaction)",
49154
49241
  "thinking binding recovery: persistence failed; leaving the bound blocks intact",
49155
49242
  "v2 refusal: interrupting the turn before the provider request arm=storage-busy",
@@ -49179,6 +49266,7 @@ var init_issue_log_templates_generated = __esm(() => {
49179
49266
  "transform: \x01; finalEstimate=\x01 estimateTrusted=\x01 contextLimit=\x01 emergencyReclaimed=\x01\x023m",
49180
49267
  "transform: \x01; finalEstimate=\x01 estimateTrusted=\x01 contextLimit=\x01 emergencyReclaimed=\x01",
49181
49268
  "[magic-context] event message.updated: no assistant info extracted from event",
49269
+ "auto-embed scheduling failed after the request was decided; serving the pass:",
49182
49270
  "compartment injection cache in degraded mode (null boundary), forcing rebuild",
49183
49271
  "exact ordinal read unavailable (); the historian start waits for a later pass",
49184
49272
  "transform refused degraded pass site=host-instruction-retention-read-failure:",
@@ -49412,6 +49500,7 @@ var init_issue_log_templates_generated = __esm(() => {
49412
49500
  "[dreamer] \x01: skipped (map-memories: insufficient time to start a batch)",
49413
49501
  'Pi subagent agent "\x01" has no strict tool allow-list; forcing --no-tools',
49414
49502
  "HARD fold converted \x01 legacy dropped-tool skeleton(s) to real-or-absent",
49503
+ "served check: record dropped reason=\x01; the next request is not compared",
49415
49504
  "mc-module: project identity for \x01 resolved to \x01; memory features resumed",
49416
49505
  "transform: usage=\x01% (\x01 tokens, limit=\x01) decision=\x01 force=true busting=true",
49417
49506
  "producer window inconsistent for \x01: window=\x01 reserve=\x01; sending unguarded\x020m",
@@ -49442,6 +49531,7 @@ var init_issue_log_templates_generated = __esm(() => {
49442
49531
  "WARN: [magic-context] v2 setup disabled by conflicting context hooks: \x01",
49443
49532
  "[auto-update-checker] Version was pinned by you; skipping auto-update",
49444
49533
  "[magic-context] host stall profiler disabled: sample interval changed",
49534
+ "latest-turn thinking recovery: cleared a rejection that names no turn",
49445
49535
  "Pi publication skipped reason=capture_failed; serving managed context",
49446
49536
  "rust compaction-marker drain: CAS lost; newer pending target retained",
49447
49537
  "transform refused degraded pass site=compaction-marker-drain-failure:",
@@ -49455,6 +49545,7 @@ var init_issue_log_templates_generated = __esm(() => {
49455
49545
  "[magic-context] slow write transaction: site=migration-runner held=\x01ms",
49456
49546
  "historian publish stage: stage=embeddings status=completed elapsed=\x01ms",
49457
49547
  "registered historian trigger (model=\x01, fallbacks=\x01, executeThreshold=\x01%)\x020m",
49548
+ "latest-turn thinking recovery: unbound because \x01 (stage=\x01 first=\x01 last=\x01)",
49458
49549
  "models-dev-cache: regression recovered for \x01/\x01 via refresh (was=\x01, now=\x01)\x020m,1m",
49459
49550
  'recomp partial code=\x01 reason="chunk could not be represented safely: \x01"',
49460
49551
  "[auto-update-checker] Updated \x01: \x01 → @cortexkit/opencode-magic-context@\x01\x020p",
@@ -49573,6 +49664,7 @@ var init_issue_log_templates_generated = __esm(() => {
49573
49664
  "[magic-context] not binding a project identity for this directory",
49574
49665
  "cannot roll back notice: no server URL for session.message.delete",
49575
49666
  "channel2 terminal-run intent clear failed; leaving lease to heal:",
49667
+ "compaction-off render changed the head: stripping signed thinking",
49576
49668
  "historian publish stage: stage=parse status=started elapsed=0.0ms",
49577
49669
  "transform refused degraded pass site=m0-m1-injection-degradation:",
49578
49670
  "transform refused degraded pass site=overflow-state-read-failure:",
@@ -49648,6 +49740,7 @@ var init_issue_log_templates_generated = __esm(() => {
49648
49740
  "heuristic cleanup stage: stage=prepareNativeRemovals elapsed=\x01ms",
49649
49741
  "[git-commits] evicted \x01 oldest commits for project \x01 (cap=\x01, was=\x01)\x021p",
49650
49742
  "mc-module: storage lease wait cancelled during shutdown after \x01s",
49743
+ "prefix trim: boundary \x01; pass=priced; no in-pass trim applied (\x01)\x021s",
49651
49744
  "prefix trim: boundary \x01; pass=priced; no in-pass trim applied (\x01)",
49652
49745
  "v2 fork inheritance: fork of \x01 starts without inherited state (\x01)\x020s",
49653
49746
  "[dreamer] storage fatal; skipping schedule timer registration: \x01",
@@ -49689,6 +49782,7 @@ var init_issue_log_templates_generated = __esm(() => {
49689
49782
  "heuristic cleanup stage: stage=measureEmergencyTags elapsed=\x01ms",
49690
49783
  '[magic-context] partial recomp failed session=\x01 code=\x01 reason="\x01"\x020s',
49691
49784
  "injected m[0]/m[1] into Pi messages (\x01 + \x01 bytes, materialized=\x01)",
49785
+ "prefix trim: boundary \x01; pass=defer; no in-pass trim applied (\x01)\x021s",
49692
49786
  "prefix trim: boundary \x01; pass=defer; no in-pass trim applied (\x01)",
49693
49787
  'WARN: [auto-update-checker] Refusing to pin invalid version "\x01"',
49694
49788
  "[auto-search] frozen omission save still failed for session \x01: \x01\x020s",
@@ -49858,6 +49952,7 @@ var init_issue_log_templates_generated = __esm(() => {
49858
49952
  "transform: usage=\x01% (\x01 tokens, limit=\x01) decision=\x01 force=true",
49859
49953
  "registered historian trigger (model=\x01, executeThreshold=\x01%)\x020m",
49860
49954
  "[magic-context] v2 event handler failed (type=\x01, session=\x01)\x021s",
49955
+ "\x01 failed after the request was decided; serving the pass: \x01",
49861
49956
  "[dreamer] promote-primers: promoted=\x01 updated=\x01 candidates=\x01",
49862
49957
  "[magic-context] internal child orphan sweep failed for \x01: \x01",
49863
49958
  "[magic-context] partial recomp merged validation failed: \x01",
@@ -49876,6 +49971,7 @@ var init_issue_log_templates_generated = __esm(() => {
49876
49971
  "system prompt token estimate failed (using prior count): \x01",
49877
49972
  "transform tag persistence failed; not serving this pass: \x01",
49878
49973
  "transform: priced-pass sizing counts the widest request: \x01",
49974
+ "\x01 failed after the request was decided; serving the pass:",
49879
49975
  "[dreamer] retrospective: only overlap lines, nothing new",
49880
49976
  "[magic-context] cleanup: no active Desktop session found",
49881
49977
  "auto-search: CAS reported success with no staged outcome",
@@ -50014,6 +50110,7 @@ var init_issue_log_templates_generated = __esm(() => {
50014
50110
  "channel2 ceiling nudge delivery failed (will retry): \x01",
50015
50111
  "compartment agent: failed to dump historian response \x01",
50016
50112
  "compartment chunk embedding failed for compartment \x01: \x01",
50113
+ "latest-turn thinking recovery: removal write failed: \x01",
50017
50114
  "mc-module: classify attempt=\x01 model=\x01 session=\x01 outcome=\x01\x021m",
50018
50115
  "recovery projection: case=defer released=\x01 normalized=\x01",
50019
50116
  "store projection rebase failed (retrying next pass): \x01",
@@ -50035,6 +50132,7 @@ var init_issue_log_templates_generated = __esm(() => {
50035
50132
  "historian output discarded: reason=dangling_boundary",
50036
50133
  "historian trigger eval: /ctx-wrapup active, skipping",
50037
50134
  "historian two-pass: editor accepted, replacing draft",
50135
+ "latest-turn thinking recovery: removal write failed:",
50038
50136
  "rust transform unavailable; not serving raw messages",
50039
50137
  "store projection rebase failed (retrying next pass):",
50040
50138
  "unchanged-boundary LKG restoration failed; refusing:",
@@ -50144,6 +50242,7 @@ var init_issue_log_templates_generated = __esm(() => {
50144
50242
  "historian: native compaction queue lookup failed: \x01",
50145
50243
  "loaded v\x01 | harness=\x01 (via \x01) | db=\x01 | project=\x01 | dir=\x01",
50146
50244
  "rust input coverage: oc_input=\x01 marker_at=\x01 covered=\x01",
50245
+ "served check failed; the record is unknown again: \x01",
50147
50246
  "transform failed dropping stale ctx_reduce calls: \x01",
50148
50247
  "transform failed freezing merged reasoning strip: \x01",
50149
50248
  "transform: legacy fallback injection also failed: \x01",
@@ -50159,6 +50258,7 @@ var init_issue_log_templates_generated = __esm(() => {
50159
50258
  "compartment agent: tail prime failed (non-fatal):",
50160
50259
  "compartment phase: tail prime failed (non-fatal):",
50161
50260
  "mc-module: migration backup permission tightening",
50261
+ "served check failed; the record is unknown again:",
50162
50262
  "transform failed dropping stale ctx_reduce calls:",
50163
50263
  "transform failed freezing merged reasoning strip:",
50164
50264
  "transform: legacy fallback injection also failed:",
@@ -50171,6 +50271,7 @@ var init_issue_log_templates_generated = __esm(() => {
50171
50271
  "heuristic cleanup stage: stage=tagLoad elapsed=\x01ms",
50172
50272
  'historian failure: source=exception \x01 stackHead="\x01"',
50173
50273
  "historian no-op: stale protected-tail snapshot (\x01)",
50274
+ "latest-turn thinking recovery: refused locally (\x01)",
50174
50275
  "note-nudge: delivery not persisted for anchor=\x01 (\x01)\x020i",
50175
50276
  "note-nudge: delivery not persisted for anchor=\x01 (\x01)",
50176
50277
  "[auto-update-checker] tui config \x01 is shadowed by \x01\x020p,1p",
@@ -50190,6 +50291,7 @@ var init_issue_log_templates_generated = __esm(() => {
50190
50291
  "reasoning removal: committed set re-read failed: \x01",
50191
50292
  "rust refusal recovery synthetic delivery failed: \x01",
50192
50293
  "session directory lookup failed; using fallback: \x01",
50294
+ "thinking binding recovery: retried clear failed: \x01",
50193
50295
  "transform scheduler failed; defaulting to defer: \x01",
50194
50296
  "[auto-update-checker] Plugin not found in config",
50195
50297
  "[magic-context] registered dreamer (manual-only)",
@@ -50202,6 +50304,7 @@ var init_issue_log_templates_generated = __esm(() => {
50202
50304
  "reasoning removal: committed set re-read failed:",
50203
50305
  "rust refusal recovery synthetic delivery failed:",
50204
50306
  "session directory lookup failed; using fallback:",
50307
+ "thinking binding recovery: retried clear failed:",
50205
50308
  "transform scheduler failed; defaulting to defer:",
50206
50309
  "Pi publication \x01 reason=\x01; serving managed context",
50207
50310
  "[dreamer] primers: decayed \x01 expired candidate(s)",
@@ -50809,6 +50912,7 @@ var init_issue_log_templates_generated = __esm(() => {
50809
50912
  "claim for \x01 could not be sent: \x01",
50810
50913
  "ctx_reduce capability refusal \x01",
50811
50914
  "historian scheduling skipped: \x01",
50915
+ "latest_thinking_original_turn:\x01",
50812
50916
  "LKG durable hydration failed: \x01",
50813
50917
  "mc-module: store open failed: \x01",
50814
50918
  "notice rollback DELETE error: \x01",
@@ -50911,6 +51015,7 @@ var init_issue_log_templates_generated = __esm(() => {
50911
51015
  "ctx-status failed code=\x01 \x01",
50912
51016
  "ctx-wrapup failed code=\x01 \x01",
50913
51017
  "historian notify failed \x01",
51018
+ "the request now goes to \x01\x020m",
50914
51019
  "cachedBoundaryEarlyTrim",
50915
51020
  "default-pressure-parity",
50916
51021
  "equivalence-unavailable",
@@ -50955,6 +51060,7 @@ var init_issue_log_templates_generated = __esm(() => {
50955
51060
  "ctx-dream failed code=\x01",
50956
51061
  "ctx-flush failed code=\x01",
50957
51062
  "refusal notice failed \x01",
51063
+ "served check skipped: \x01",
50958
51064
  "tag_identity_revision:\x01\x020s",
50959
51065
  "## Historian recovery",
50960
51066
  "applyHeuristicCleanup",
@@ -50968,6 +51074,7 @@ var init_issue_log_templates_generated = __esm(() => {
50968
51074
  "pp.todoPermissionRead",
50969
51075
  "preemptive-compaction",
50970
51076
  "refusal notice failed",
51077
+ "served check skipped:",
50971
51078
  "stableIdSchemePersist",
50972
51079
  "stickyReplayDecisions",
50973
51080
  "stripClearedReasoning",
@@ -51195,7 +51302,7 @@ var init_issue_log_templates_generated = __esm(() => {
51195
51302
  }
51196
51303
  return { parts, slots };
51197
51304
  });
51198
- ISSUE_LOG_IDENTIFIERS = "abort,aborted,above_cap,accepted,acquire,adopted,agent,agent-drops-applied,aligned,already-current,already-present,already_ran_this_turn,ambiguous,ambiguous-rewrite,anchor-missing,anchors-disagree,anthropic-continue,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,date-cwd,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,fallback,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,injector,input_text,intact,invalid-pid,invalid_prompt,invalid_scheme,invocation,io,leaked-id,lease_active,legacy,length,limit,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-text-user,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,output_text,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,prepared-row,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,search-limit,seeded,server_tool_use,session-content,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,superpowers-bootstrap,superseded,synthetic-boundary-merged,synthetic-kept-entry,system,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-pair,tool-result,tool_call,tool_definitions,tool_provider,tool_result,tool_search_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,unreadable-branch,unregistered,unresolved,update,upgrade,upgrade_state,url,usage,user,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,web_search_tool_result,whole-session-smaller-than-tail,worker-busy,worker-error,worker-failed,wrapup,x64".split(",");
51305
+ ISSUE_LOG_IDENTIFIERS = "abort,aborted,above_cap,accepted,acquire,adopted,agent,agent-drops-applied,aligned,already-current,already-present,already_ran_this_turn,ambiguous,ambiguous-rewrite,anchor-missing,anchors-disagree,anthropic-continue,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,date-cwd,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,fallback,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,injector,input,input_text,intact,invalid-pid,invalid_prompt,invalid_scheme,invocation,io,latest_turn_thinking_removed,leaked-id,lease_active,legacy,length,limit,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_head_changed,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-text-user,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,output_text,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,prepared-row,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,replay,resolved,response,restore,result,retry,retryable-failure,rpc_error,run,scan,scheduler_defer,schema_fence,seam-temporal-strip,search-archive,search-failure,search-limit,seeded,server_tool_use,session-content,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,superpowers-bootstrap,superseded,synthetic-boundary-merged,synthetic-kept-entry,system,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-pair,tool-result,tool_call,tool_definitions,tool_provider,tool_result,tool_search_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,unreadable-branch,unregistered,unresolved,update,upgrade,upgrade_state,url,usage,user,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,web_search_tool_result,whole-session-smaller-than-tail,worker-busy,worker-error,worker-failed,wrapup,x64".split(",");
51199
51306
  });
51200
51307
 
51201
51308
  // src/lib/log-lines.ts
@@ -51880,6 +51987,7 @@ var init_issue_privacy = __esm(() => {
51880
51987
  "validation",
51881
51988
  "exception",
51882
51989
  "cli",
51990
+ "npm",
51883
51991
  "desktop",
51884
51992
  "darwin",
51885
51993
  "linux",
@@ -53882,7 +53990,7 @@ function readLegacyCachedVersion(root) {
53882
53990
  return;
53883
53991
  }
53884
53992
  }
53885
- function collectOpenCodePluginCacheReport(hostGeneration, opencodeConfig) {
53993
+ function collectOpenCodePluginCacheReport(hostGeneration, opencodeConfig, npmVersions = {}) {
53886
53994
  const installs = [];
53887
53995
  for (const root of getOpenCodePluginCacheRoots()) {
53888
53996
  if (!existsSync46(root))
@@ -53905,14 +54013,28 @@ function collectOpenCodePluginCacheReport(hostGeneration, opencodeConfig) {
53905
54013
  }
53906
54014
  let path;
53907
54015
  let cached;
54016
+ let distTag = "latest";
53908
54017
  if (hostGeneration === "v2") {
53909
- path = getOpenCodeV2PluginCacheSlot(undefined, readConfiguredOpenCodePluginSpec(opencodeConfig));
54018
+ const spec = readConfiguredOpenCodePluginSpec(opencodeConfig);
54019
+ path = getOpenCodeV2PluginCacheSlot(undefined, spec);
53910
54020
  cached = readOpenCodeV2CachedPluginVersion(path);
54021
+ if (isOpenCodePluginDistTag(spec))
54022
+ distTag = spec;
53911
54023
  } else {
53912
54024
  [path = ""] = getOpenCodePluginCacheRoots();
53913
54025
  cached = installs.find((install) => install.layout === "opencode1" && install.cached)?.cached;
53914
54026
  }
53915
- return { path, cached, latest: getSelfVersion(), installs };
54027
+ const newest = npmVersions[distTag];
54028
+ return newest ? { path, cached, latest: newest, latestSource: "npm", installs } : { path, cached, latest: getSelfVersion(), latestSource: "cli", installs };
54029
+ }
54030
+ function describeOutdatedPluginInstall(pluginCache) {
54031
+ const { cached, latest, latestSource } = pluginCache;
54032
+ if (latestSource !== "npm" || !cached || !latest)
54033
+ return null;
54034
+ const comparison = compareSemverPrecedence(cached, latest);
54035
+ if (comparison === null || comparison >= 0)
54036
+ return null;
54037
+ return `Plugin is outdated: installed ${cached}, newest ${latest}.`;
53916
54038
  }
53917
54039
  function getStorageResolution() {
53918
54040
  return getMagicContextStorageResolution();
@@ -54208,7 +54330,7 @@ async function collectHistorianRuns(storageDirPath) {
54208
54330
  function openCodeIssueLogHarnesses(hostGeneration) {
54209
54331
  return hostGeneration === "v2" ? ["opencode2", "opencode"] : ["opencode"];
54210
54332
  }
54211
- async function collectDiagnostics() {
54333
+ async function collectDiagnostics(options = {}) {
54212
54334
  const pluginVersion = getSelfVersion();
54213
54335
  const configPaths = detectConfigPaths();
54214
54336
  const opencodeConfig = readConfig3(configPaths.opencodeConfig);
@@ -54252,7 +54374,7 @@ async function collectDiagnostics() {
54252
54374
  ...magicContextConfig.error ? { parseError: magicContextConfig.error } : {},
54253
54375
  flags: sanitizeValue(magicContextConfig.value ?? {}) ?? {}
54254
54376
  },
54255
- pluginCache: collectOpenCodePluginCacheReport(hostGeneration, opencodeConfig.value),
54377
+ pluginCache: collectOpenCodePluginCacheReport(hostGeneration, opencodeConfig.value, options.npmVersions),
54256
54378
  storageDir: {
54257
54379
  path: storageDirPath,
54258
54380
  source: storageResolution.source,
@@ -54304,6 +54426,7 @@ function renderDiagnosticsMarkdown(report) {
54304
54426
  path: sanitizeString(report.pluginCache.path),
54305
54427
  cached: report.pluginCache.cached ?? null,
54306
54428
  latest: report.pluginCache.latest ?? null,
54429
+ latest_source: report.pluginCache.latestSource ?? "cli",
54307
54430
  installs: (report.pluginCache.installs ?? []).map((install) => ({
54308
54431
  ...install,
54309
54432
  path: sanitizeString(install.path),
@@ -54348,7 +54471,7 @@ function renderDiagnosticsMarkdown(report) {
54348
54471
  }));
54349
54472
  return [
54350
54473
  `- Timestamp: ${report.timestamp}`,
54351
- `- Plugin: v${report.pluginVersion}`,
54474
+ `- magic-context CLI: v${report.pluginVersion}`,
54352
54475
  `- OS: ${report.platform} ${report.arch}`,
54353
54476
  `- Node: ${report.nodeVersion}`,
54354
54477
  `- OpenCode installed: ${report.opencodeInstalled} [${report.opencodeInstallKind}]${report.opencodeVersion ? ` (${report.opencodeVersion})` : ""}`,
@@ -54433,7 +54556,10 @@ var init_diagnostics_opencode = __esm(async () => {
54433
54556
  init_opencode_plugin_registration();
54434
54557
  init_paths();
54435
54558
  init_redaction2();
54436
- await init_opencode();
54559
+ await __promiseAll([
54560
+ init_opencode(),
54561
+ init_doctor_opencode2_cache()
54562
+ ]);
54437
54563
  import_comment_json10 = __toESM(require_src3(), 1);
54438
54564
  });
54439
54565
  // ../plugin/src/features/magic-context/memory/embedding-model-match.ts
@@ -54935,6 +55061,7 @@ async function bundleIssueReport(report, description, title, sessionFilter = nul
54935
55061
  const sanitizedConfigPath = sanitizeDiagnosticText(report.configPaths.magicContextConfig);
54936
55062
  const sanitizedDescription = privacy.userText(description);
54937
55063
  const sanitizedTitle = privacy.userText(title).trim();
55064
+ const outdatedLine = describeOutdatedPluginInstall(report.pluginCache);
54938
55065
  const selectedSession = sessionFilter ? (report.recentSessions.available ? report.recentSessions.rows : []).find((session) => session.sessionId === privacy.session(sessionFilter)) : undefined;
54939
55066
  const sessionContext = selectedSession ? [
54940
55067
  "## Session context",
@@ -54951,7 +55078,8 @@ async function bundleIssueReport(report, description, title, sessionFilter = nul
54951
55078
  privacy.notice,
54952
55079
  "",
54953
55080
  "## Environment",
54954
- `- Plugin: v${report.pluginVersion}`,
55081
+ ...outdatedLine ? [`- ${outdatedLine}`] : [],
55082
+ `- magic-context CLI: v${report.pluginVersion}${report.pluginCache.cached ? ` (installed plugin: v${report.pluginCache.cached})` : ""}`,
54955
55083
  `- OS: ${report.platform} ${report.arch}`,
54956
55084
  `- Node: ${report.nodeVersion}`,
54957
55085
  `- OpenCode: ${report.opencodeVersion ?? "not installed"}`,
@@ -56113,10 +56241,60 @@ function openBrowser(url) {
56113
56241
  }
56114
56242
  } catch {}
56115
56243
  }
56244
+ async function checkPluginFreshnessForIssue(deps = {}) {
56245
+ const fetchLatest = deps.fetchNpmLatest ?? fetchNpmLatest;
56246
+ const paths = detectConfigPaths();
56247
+ if (paths.opencodeConfigFormat === "none")
56248
+ return { npmVersions: {} };
56249
+ let config;
56250
+ try {
56251
+ config = import_comment_json11.parse(readFileSync31(paths.opencodeConfig, "utf-8"));
56252
+ } catch {}
56253
+ const configDir = dirname27(paths.opencodeConfig);
56254
+ if (config && !isOpenCodePluginRegistered(config, configDir))
56255
+ return { npmVersions: {} };
56256
+ const npmVersions = {};
56257
+ const latest = await fetchLatest(OPENCODE_PLUGIN_NAME);
56258
+ if (latest)
56259
+ npmVersions.latest = latest;
56260
+ const distTag = configuredOpenCodeV2DistTag(config);
56261
+ if (distTag) {
56262
+ const tagged = await fetchLatest(OPENCODE_PLUGIN_NAME, distTag);
56263
+ if (tagged)
56264
+ npmVersions[distTag] = tagged;
56265
+ }
56266
+ const openCode2 = checkOpenCodeV2PluginCache({
56267
+ latestVersion: npmVersions[distTag ?? "latest"] ?? null,
56268
+ distTag,
56269
+ hostFiles: [],
56270
+ referencedSpecs: config ? readOpenCodePluginConfigUse(config, configDir).referencedSpecs.opencode2 : undefined
56271
+ });
56272
+ return { npmVersions, openCode2 };
56273
+ }
56274
+ async function warnOutdatedBeforeIssue(freshness, options) {
56275
+ if (freshness.openCode2?.action !== "stale")
56276
+ return true;
56277
+ reportOpenCodeV2PluginCache(freshness.openCode2, {
56278
+ pass: (message) => log3.success(message),
56279
+ warn: (message) => log3.warn(message),
56280
+ info: (message) => log3.info(message)
56281
+ }, { reportMissing: false, platform: options.platform });
56282
+ if (!options.interactive)
56283
+ return true;
56284
+ const proceed = await confirm2("Continue filing the issue? No stops here so you can update first.", false);
56285
+ if (!proceed) {
56286
+ outro2("Issue not filed. Update the plugin, then run `magic-context doctor --issue` again if the problem remains.");
56287
+ }
56288
+ return proceed;
56289
+ }
56116
56290
  async function runIssueFlow2(options = {}, deps = { collectDiagnostics }) {
56291
+ const platform = deps.platform ?? process.platform;
56292
+ const checkFreshness = deps.checkPluginFreshness ?? checkPluginFreshnessForIssue;
56117
56293
  if (options.reportPath) {
56294
+ const freshness = await checkFreshness();
56295
+ await warnOutdatedBeforeIssue(freshness, { platform, interactive: false });
56118
56296
  try {
56119
- const report = await deps.collectDiagnostics();
56297
+ const report = await deps.collectDiagnostics({ npmVersions: freshness.npmVersions });
56120
56298
  const bundled = await bundleIssueReport(report, "Generated non-interactively by `doctor --issue --report`.", "Magic Context diagnostic report", null, { outputPath: resolve19(process.cwd(), options.reportPath) });
56121
56299
  log3.info(bundled.fullPath ? `Report written to ${bundled.path}; full bundle at ${bundled.fullPath}` : `Report written to ${bundled.path}`);
56122
56300
  return 0;
@@ -56126,6 +56304,10 @@ async function runIssueFlow2(options = {}, deps = { collectDiagnostics }) {
56126
56304
  }
56127
56305
  }
56128
56306
  intro2("Magic Context Issue Report");
56307
+ const interactive = (deps.isInteractive ?? (() => process.stdin.isTTY === true))();
56308
+ const freshness = await checkFreshness();
56309
+ if (!await warnOutdatedBeforeIssue(freshness, { platform, interactive }))
56310
+ return 0;
56129
56311
  const title = await text2("Issue title", {
56130
56312
  placeholder: "Short summary of the problem",
56131
56313
  validate: (value) => value.trim() ? undefined : "Title is required"
@@ -56137,7 +56319,7 @@ async function runIssueFlow2(options = {}, deps = { collectDiagnostics }) {
56137
56319
  const s = spinner2();
56138
56320
  s.start("Collecting diagnostics");
56139
56321
  try {
56140
- const report = await deps.collectDiagnostics();
56322
+ const report = await deps.collectDiagnostics({ npmVersions: freshness.npmVersions });
56141
56323
  s.stop("Diagnostics collected");
56142
56324
  let sessionFilter = null;
56143
56325
  if (report.recentSessions.available && report.recentSessions.rows.length > 1) {