Skip to content

[pi] pi plugin still has an issue with compaction #81

@smilovanov-5am

Description

@smilovanov-5am

What happened?

Description

Token usage continues to grow after the default threshold, despite the historian agent being triggered, judging by the logs.

Environment

  • Pi plugin: v0.21.1
  • Pi: 0.75.1
  • OS: linux x64
  • Node: v22.22.0

Diagnostics

  • Timestamp: 2026-05-18T11:58:27.447Z
  • Pi plugin: v0.21.1
  • OS: linux x64
  • Node: v22.22.0
  • Pi installed: true (0.75.1)
  • Magic Context package registered: true
  • User config parse error: none
  • Project config parse error: none
  • Known Pi extension conflicts: none

Pi settings

{
  "path": "<HOME>/.pi/agent/settings.json",
  "exists": true,
  "hasMagicContextPackage": true,
  "packages": [
    "npm:@cortexkit/pi-magic-context",
    "npm:@tomooshi/condensed-milk-pi"
  ]
}

Config paths

{
  "agentDir": "<HOME>/.pi/agent",
  "userConfig": "<HOME>/.pi/agent/magic-context.jsonc",
  "projectConfig": "<HOME>/dev/lokeo/lokeo.monoproject/.pi/magic-context.jsonc"
}

User magic-context.jsonc flags

{
  "$schema": "https://raw.githubusercontent.com/cortexkit/magic-context/master/assets/magic-context.schema.json",
  "historian": {
    "model": "omni-openai/cx/gpt-5.4-mini:medium"
  },
  "dreamer": {
    "enabled": true,
    "model": "omni-openai/cx/gpt-5.4-mini:medium"
  },
  "sidekick": {
    "enabled": false
  },
  "embedding": {
    "provider": "openai-compatible",
    "endpoint": "https://api.openai.com/v1",
    "model": "text-embedding-3-small",
    "api_key": "<REDACTED>"
  },
  "cache_ttl": "1h",
  "nudge_interval_tokens": "<REDACTED>"
}

Project magic-context.jsonc flags

{}

Loaded config paths

  • /.pi/agent/magic-context.jsonc

Config load warnings

None.

Shared storage

{
  "path": "<HOME>/.local/share/cortexkit/magic-context",
  "exists": true,
  "context_db_size": "26.8 MB"
}

Pi extension conflicts

No known conflicting Pi extensions are currently registered. Other Pi packages are informational only.

{
  "knownConflicts": [],
  "otherPiExtensions": [
    "npm:@tomooshi/condensed-milk-pi"
  ]
}

Log file

  • Path: /tmp/pi/magic-context/magic-context.log
  • Exists: true
  • Size: 11754 KB

Log (last 400 lines, sanitized)

[2026-05-18T11:54:24.537Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=findSessionId elapsed=0.0ms messages=451
[2026-05-18T11:54:24.537Z] [magic-context][pi][019e357e-344a-7b09-8475-02e0d4d5e685] collectMessageEntryIds length mismatch: expected=451 got=162 (compactionIndex=1261 firstKeptEntryId=4872a8b6 totalBranchEntries=1266) — best-effort mapping returned; boundary trim may not match exactly
[2026-05-18T11:54:24.537Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=findLastUserMessageId elapsed=0.1ms
[2026-05-18T11:54:24.538Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=getOrCreateSessionMeta elapsed=0.0ms
[2026-05-18T11:54:24.538Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=schedulerAndUsage elapsed=0.0ms
[2026-05-18T11:54:24.538Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=modelChangeDetection elapsed=0.1ms
[2026-05-18T11:54:24.538Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] [boundary-exec] base=execute bypass=none midTurn=false effective=execute sideEffect=none
[2026-05-18T11:54:24.538Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform: usage=66.5% (180978 tokens, limit=272000) decision=execute
[2026-05-18T11:54:24.538Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=emergencyRecoveryBlock elapsed=0.1ms
[2026-05-18T11:54:24.538Z] [magic-context][pi][019e357e-344a-7b09-8475-02e0d4d5e685] collectMessageEntryIds length mismatch: expected=451 got=162 (compactionIndex=1261 firstKeptEntryId=4872a8b6 totalBranchEntries=1266) — best-effort mapping returned; boundary trim may not match exactly
[2026-05-18T11:54:24.541Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=tagMessages elapsed=2.7ms
[2026-05-18T11:54:24.541Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] pending ops WILL APPLY — reason=deferred_publication, pendingOps=34, context=66.5%
[2026-05-18T11:54:24.543Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=applyPendingOperations elapsed=2.0ms
[2026-05-18T11:54:24.544Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=getTagsByNumbers elapsed=0.5ms targets=271 fetched=271
[2026-05-18T11:54:24.544Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=applyFlushedStatuses elapsed=0.1ms
[2026-05-18T11:54:24.544Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=batchFinalize:flushed elapsed=0.1ms
[2026-05-18T11:54:24.544Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] reasoning replay: cleared=61 inline=0
[2026-05-18T11:54:24.544Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=replayReasoningClearing elapsed=0.4ms
[2026-05-18T11:54:24.544Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=stripClearedReasoning elapsed=0.4ms strippedParts=61
[2026-05-18T11:54:24.546Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=getActiveTagsBySession elapsed=0.5ms count=279
[2026-05-18T11:54:24.546Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] heuristics WILL RUN — reason=scheduler_execute (pendingOps=34, scheduler=execute), context=66.5%, turn=n/a
[2026-05-18T11:54:24.547Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] heuristic cleanup: dropped 92 tool tags, stale ctx_reduce=2, deduplicated 0 tool calls, dropped 0 system injections
[2026-05-18T11:54:24.547Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=applyHeuristicCleanup elapsed=1.5ms droppedTools=92 deduplicatedTools=0 droppedInjections=0 compressedTextTags=0
[2026-05-18T11:54:24.548Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] reasoning cleanup: cleared=78 inlineStripped=0 watermark=838→959
[2026-05-18T11:54:24.548Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=clearOldReasoning elapsed=0.5ms
[2026-05-18T11:54:24.548Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=watermarkCleanup elapsed=0.5ms
[2026-05-18T11:54:24.550Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] compartment injection entering degraded mode: boundary e0e47dc8 not in visible messages
[2026-05-18T11:54:24.550Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] injected 23 compartments + 2 facts + 73 memories into message[0] (skipped 0/451 visible messages)
[2026-05-18T11:54:24.550Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=prepareCompartmentInjection elapsed=2.1ms
[2026-05-18T11:54:24.550Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=compartmentPhase elapsed=2.2ms
[2026-05-18T11:54:24.550Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=batchFinalize:heuristics elapsed=0.0ms
[2026-05-18T11:54:24.621Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] historian trigger eval: usage=66.5% (180978 tokens) [from session_meta], checking trigger...
[2026-05-18T11:54:24.623Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] historian trigger eval: shouldFire=false (no trigger condition met)
[2026-05-18T11:54:24.625Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] compressor: history block ~3658 tokens within budget 26520, skipping
[2026-05-18T11:54:24.626Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] nudge: none fired at 66.7% (band=critical lastBand=critical lastNudge=179462 current=181295 interval=2500 projected=66.6)
[2026-05-18T11:54:24.626Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=applyContextNudge elapsed=0.9ms
[2026-05-18T11:54:24.626Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] note-nudge: triggerPending but no notes found, skipping
[2026-05-18T11:54:24.627Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=postTransformPhase elapsed=2.0ms
[2026-05-18T11:54:24.627Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform completed in 90.1ms (451 messages, 271 targets, watermark: 959)
[2026-05-18T11:54:34.994Z] [dreamer] timer tick (interval) — projects=1
[2026-05-18T11:54:34.996Z] [dreamer] timer tick (interval) <HOME>/dev/lokeo/lokeo.monoproject — checking schedule window "02:00-06:00"
[2026-05-18T11:54:35.915Z] [magic-context][global] models-dev-cache: file-layer loaded 4542 model metadata entries (modelsJsonPath=<HOME>/.cache/opencode/models.json, found=true)
[2026-05-18T11:54:36.385Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=findSessionId elapsed=0.0ms messages=453
[2026-05-18T11:54:36.385Z] [magic-context][pi][019e357e-344a-7b09-8475-02e0d4d5e685] collectMessageEntryIds length mismatch: expected=453 got=165 (compactionIndex=1261 firstKeptEntryId=4872a8b6 totalBranchEntries=1269) — best-effort mapping returned; boundary trim may not match exactly
[2026-05-18T11:54:36.385Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=findLastUserMessageId elapsed=0.1ms
[2026-05-18T11:54:36.386Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=getOrCreateSessionMeta elapsed=0.0ms
[2026-05-18T11:54:36.386Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=schedulerAndUsage elapsed=0.0ms
[2026-05-18T11:54:36.386Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=modelChangeDetection elapsed=0.1ms
[2026-05-18T11:54:36.386Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] [boundary-exec] base=execute bypass=none midTurn=true effective=defer sideEffect=set-flag
[2026-05-18T11:54:36.386Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform: usage=84.2% (228888 tokens, limit=272000) decision=defer
[2026-05-18T11:54:36.386Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=emergencyRecoveryBlock elapsed=0.2ms
[2026-05-18T11:54:36.386Z] [magic-context][pi][019e357e-344a-7b09-8475-02e0d4d5e685] collectMessageEntryIds length mismatch: expected=453 got=165 (compactionIndex=1261 firstKeptEntryId=4872a8b6 totalBranchEntries=1269) — best-effort mapping returned; boundary trim may not match exactly
[2026-05-18T11:54:36.391Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=tagMessages elapsed=4.3ms
[2026-05-18T11:54:36.391Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] pending ops WILL NOT APPLY — reason=scheduler_defer pendingOps=1 context=84.2%
[2026-05-18T11:54:36.392Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=getTagsByNumbers elapsed=0.5ms targets=272 fetched=272
[2026-05-18T11:54:36.392Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=applyFlushedStatuses elapsed=0.2ms
[2026-05-18T11:54:36.392Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=batchFinalize:flushed elapsed=0.2ms
[2026-05-18T11:54:36.392Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] reasoning replay: cleared=139 inline=0
[2026-05-18T11:54:36.392Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=replayReasoningClearing elapsed=0.3ms
[2026-05-18T11:54:36.392Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=stripClearedReasoning elapsed=0.3ms strippedParts=139
[2026-05-18T11:54:36.393Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=getActiveTagsBySession elapsed=0.2ms count=188
[2026-05-18T11:54:36.393Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] heuristics WILL NOT RUN — reason=scheduler_defer
[2026-05-18T11:54:36.393Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] compartment injection cache in degraded mode (null boundary), forcing rebuild
[2026-05-18T11:54:36.393Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] compartment injection entering degraded mode: boundary e0e47dc8 not in visible messages
[2026-05-18T11:54:36.393Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] injected 23 compartments + 2 facts + 73 memories into message[0] (skipped 0/453 visible messages)
[2026-05-18T11:54:36.393Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=prepareCompartmentInjection elapsed=0.3ms
[2026-05-18T11:54:36.393Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=compartmentPhase elapsed=0.3ms
[2026-05-18T11:54:36.393Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=batchFinalize:heuristics elapsed=0.0ms
[2026-05-18T11:54:36.467Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] historian trigger eval: usage=84.2% (228888 tokens) [from session_meta], checking trigger...
[2026-05-18T11:54:36.471Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] compartment trigger: force-firing at 84.2% (projected post-drop 84.1%)
[2026-05-18T11:54:36.471Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] historian trigger fired (reason=force_80) usage=84.2% — spawning subagent
[2026-05-18T11:54:36.473Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] historian: invoking subagent (model=omni-openai/cx/gpt-5.4-mini:medium, chunk=947-958, 12 msgs, ~1262 tokens)
[2026-05-18T11:54:36.479Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] historian[first] spawned pid=1410520 argv=14 args
[2026-05-18T11:54:36.481Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] nudge fired: rolling_critical at 84.2% (interval 49426/2500 tokens)
[2026-05-18T11:54:36.482Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=applyContextNudge elapsed=1.7ms
[2026-05-18T11:54:36.482Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=postTransformPhase elapsed=2.0ms
[2026-05-18T11:54:36.482Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform completed in 97.3ms (454 messages, 272 targets, watermark: 959)
[2026-05-18T11:54:38.333Z] [pi-subagent] registered tools: ctx_search, ctx_memory, ctx_note, ctx_expand (memory=true, embedding=true, git_commits=false, dreamer_actions=false)
[2026-05-18T11:54:46.960Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=findSessionId elapsed=0.0ms messages=455
[2026-05-18T11:54:46.961Z] [magic-context][pi][019e357e-344a-7b09-8475-02e0d4d5e685] collectMessageEntryIds length mismatch: expected=455 got=167 (compactionIndex=1261 firstKeptEntryId=4872a8b6 totalBranchEntries=1271) — best-effort mapping returned; boundary trim may not match exactly
[2026-05-18T11:54:46.961Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=findLastUserMessageId elapsed=0.1ms
[2026-05-18T11:54:46.962Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=getOrCreateSessionMeta elapsed=0.0ms
[2026-05-18T11:54:46.962Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=schedulerAndUsage elapsed=0.0ms
[2026-05-18T11:54:46.962Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=modelChangeDetection elapsed=0.1ms
[2026-05-18T11:54:46.962Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] [boundary-exec] base=execute bypass=none midTurn=true effective=defer sideEffect=set-flag
[2026-05-18T11:54:46.962Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform: usage=84.2% (229149 tokens, limit=272000) decision=defer
[2026-05-18T11:54:46.962Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=emergencyRecoveryBlock elapsed=0.1ms
[2026-05-18T11:54:46.962Z] [magic-context][pi][019e357e-344a-7b09-8475-02e0d4d5e685] collectMessageEntryIds length mismatch: expected=455 got=167 (compactionIndex=1261 firstKeptEntryId=4872a8b6 totalBranchEntries=1271) — best-effort mapping returned; boundary trim may not match exactly
[2026-05-18T11:54:46.967Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=tagMessages elapsed=4.6ms
[2026-05-18T11:54:46.967Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] pending ops WILL NOT APPLY — reason=scheduler_defer pendingOps=3 context=84.2%
[2026-05-18T11:54:46.968Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=getTagsByNumbers elapsed=0.8ms targets=273 fetched=273
[2026-05-18T11:54:46.968Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=applyFlushedStatuses elapsed=0.2ms
[2026-05-18T11:54:46.968Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=batchFinalize:flushed elapsed=0.2ms
[2026-05-18T11:54:46.969Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] reasoning replay: cleared=139 inline=0
[2026-05-18T11:54:46.969Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=replayReasoningClearing elapsed=0.5ms
[2026-05-18T11:54:46.969Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=stripClearedReasoning elapsed=0.5ms strippedParts=139
[2026-05-18T11:54:46.970Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=getActiveTagsBySession elapsed=0.4ms count=189
[2026-05-18T11:54:46.970Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] heuristics WILL NOT RUN — reason=scheduler_defer
[2026-05-18T11:54:46.970Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] compartment injection cache in degraded mode (null boundary), forcing rebuild
[2026-05-18T11:54:46.970Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] compartment injection entering degraded mode: boundary e0e47dc8 not in visible messages
[2026-05-18T11:54:46.970Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] injected 23 compartments + 2 facts + 73 memories into message[0] (skipped 0/455 visible messages)
[2026-05-18T11:54:46.970Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=prepareCompartmentInjection elapsed=0.3ms
[2026-05-18T11:54:46.970Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=compartmentPhase elapsed=0.3ms
[2026-05-18T11:54:46.970Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=batchFinalize:heuristics elapsed=0.0ms
[2026-05-18T11:54:47.045Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] historian trigger eval: in-flight, skipping
[2026-05-18T11:54:47.046Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] nudge: suppressed at 84.2% because ctx_reduce ran recently (90ms ago)
[2026-05-18T11:54:47.046Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=applyContextNudge elapsed=0.7ms
[2026-05-18T11:54:47.046Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=postTransformPhase elapsed=1.0ms
[2026-05-18T11:54:47.046Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform completed in 85.9ms (455 messages, 273 targets, watermark: 959)
[2026-05-18T11:54:47.714Z] [dreamer] timer tick (interval) — projects=1
[2026-05-18T11:54:47.715Z] [dreamer] timer tick (interval) <HOME>/dev/projects/notion-clone — checking schedule window "02:00-06:00"
[2026-05-18T11:54:55.969Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] historian[first] terminal @19496ms stopReason=stop textLen=1232 hasToolCall=false
[2026-05-18T11:54:55.969Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] historian[first] terminal @19496ms stopReason=stop textLen=1232 hasToolCall=false
[2026-05-18T11:54:55.986Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] historian[first] child_exit @19513ms code=0 signal=null
[2026-05-18T11:54:55.988Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] historian: appended native compaction firstKept=1b68a26d tokensBefore=1262
[2026-05-18T11:54:55.988Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] note-nudge: trigger fired (historian_complete), triggerPending=true
[2026-05-18T11:54:55.992Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] compartment agent: queued 0 drops for messages 0-958
[2026-05-18T11:54:55.992Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] historian: published 1 compartment(s), 0 fact(s) covering messages 947-958
[2026-05-18T11:55:00.536Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=findSessionId elapsed=0.0ms messages=460
[2026-05-18T11:55:00.536Z] [magic-context][pi][019e357e-344a-7b09-8475-02e0d4d5e685] collectMessageEntryIds length mismatch: expected=460 got=152 (compactionIndex=1271 firstKeptEntryId=1b68a26d totalBranchEntries=1275) — best-effort mapping returned; boundary trim may not match exactly
[2026-05-18T11:55:00.536Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=findLastUserMessageId elapsed=0.1ms
[2026-05-18T11:55:00.537Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=getOrCreateSessionMeta elapsed=0.0ms
[2026-05-18T11:55:00.537Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=schedulerAndUsage elapsed=0.0ms
[2026-05-18T11:55:00.537Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=modelChangeDetection elapsed=0.1ms
[2026-05-18T11:55:00.537Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] [boundary-exec] base=execute bypass=force-materialize midTurn=true effective=execute sideEffect=none
[2026-05-18T11:55:00.537Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform: usage=85.2% (231748 tokens, limit=272000) decision=execute force=true
[2026-05-18T11:55:00.537Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=emergencyRecoveryBlock elapsed=0.0ms
[2026-05-18T11:55:00.537Z] [magic-context][pi][019e357e-344a-7b09-8475-02e0d4d5e685] collectMessageEntryIds length mismatch: expected=460 got=152 (compactionIndex=1271 firstKeptEntryId=1b68a26d totalBranchEntries=1275) — best-effort mapping returned; boundary trim may not match exactly
[2026-05-18T11:55:00.541Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=tagMessages elapsed=3.1ms
[2026-05-18T11:55:00.541Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] pending ops WILL APPLY — reason=deferred_publication, pendingOps=3, context=85.2%
[2026-05-18T11:55:00.544Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=applyPendingOperations elapsed=3.5ms
[2026-05-18T11:55:00.545Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=getTagsByNumbers elapsed=0.6ms targets=277 fetched=277
[2026-05-18T11:55:00.545Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=applyFlushedStatuses elapsed=0.1ms
[2026-05-18T11:55:00.545Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=batchFinalize:flushed elapsed=0.1ms
[2026-05-18T11:55:00.545Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] reasoning replay: cleared=139 inline=0
[2026-05-18T11:55:00.545Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=replayReasoningClearing elapsed=0.2ms
[2026-05-18T11:55:00.545Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=stripClearedReasoning elapsed=0.3ms strippedParts=139
[2026-05-18T11:55:00.546Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=getActiveTagsBySession elapsed=0.3ms count=191
[2026-05-18T11:55:00.546Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] heuristics WILL RUN — reason=force_materialization, context=85.2%, turn=n/a
[2026-05-18T11:55:00.548Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] heuristic cleanup: dropped 63 tool tags, stale ctx_reduce=0, deduplicated 0 tool calls, dropped 0 system injections
[2026-05-18T11:55:00.548Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=applyHeuristicCleanup elapsed=1.3ms droppedTools=63 deduplicatedTools=0 droppedInjections=0 compressedTextTags=0
[2026-05-18T11:55:00.548Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] reasoning cleanup: cleared=2 inlineStripped=0 watermark=959→964
[2026-05-18T11:55:00.548Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=clearOldReasoning elapsed=0.5ms
[2026-05-18T11:55:00.548Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=watermarkCleanup elapsed=0.5ms
[2026-05-18T11:55:00.550Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] compartment injection entering degraded mode: boundary 3094260b not in visible messages
[2026-05-18T11:55:00.550Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] injected 24 compartments + 0 facts + 73 memories into message[0] (skipped 0/460 visible messages)
[2026-05-18T11:55:00.550Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=prepareCompartmentInjection elapsed=1.6ms
[2026-05-18T11:55:00.550Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=compartmentPhase elapsed=1.6ms
[2026-05-18T11:55:00.550Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=batchFinalize:heuristics elapsed=0.0ms
[2026-05-18T11:55:00.625Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] historian trigger eval: usage=85.2% (231748 tokens) [from session_meta], checking trigger...
[2026-05-18T11:55:00.626Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] historian trigger eval: shouldFire=false (no trigger condition met)
[2026-05-18T11:55:00.627Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] compressor: history block ~3863 tokens within budget 26520, skipping
[2026-05-18T11:55:00.628Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] nudge: suppressed at 85.2% because ctx_reduce ran recently (13672ms ago)
[2026-05-18T11:55:00.628Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=applyContextNudge elapsed=0.4ms
[2026-05-18T11:55:00.628Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] note-nudge: deferring — current user message pi:449:1779105264521 is same as trigger-time message
[2026-05-18T11:55:00.628Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform stage: stage=postTransformPhase elapsed=1.1ms
[2026-05-18T11:55:00.628Z] [magic-context][019e357e-344a-7b09-8475-02e0d4d5e685] transform completed in 92.4ms (460 messages, 277 targets, watermark: 964)
[2026-05-18T11:55:13.584Z] agent_end: returning synchronously (background work continues)
[2026-05-18T11:56:54.867Z] [dreamer] timer tick (interval) — projects=1
[2026-05-18T11:56:54.868Z] [dreamer] timer tick (interval) <HOME>/dev/lokeo/lokeo.code/lokeo.code.prototype — checking schedule window "02:00-06:00"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions