Skip to content

"classify-memories" task uses my system prompt #232

Description

@tenshiak

Short description

"classify-memories" task is not using its own system prompt in pi

What happened?

Image

Harness is pi. I monitored system prompts while the dreamer was running and noticed that:

"You are a memory mapper for the magic-context system." as system prompt + "## Map these memories to their backing files" as first user message works - good
"You are a memory verifier for the magic-context system. " + "## Verify these memories against the code" - also good
"You are a memory-pool curator for the magic-context system" + "## Task: Curate Project Memory Pool" - good

and at the end
"my prompt" + ## Task: Classify Project Memories"

That means the classify-memories task didn't use its prompt, but used my own. What's worse, it's not the default prompt it should have access to; it comes from an extension and only when specifically enabled (it's not on by default). To rule out my extension somehow altering the dreamer's prompt, I ran pi only with magic-context with pi -ne --extension "npm:@cortexkit/pi-magic-context@0.32.3" and then /ctx-dream classify-memories, but it still used that prompt that comes from this very specific extension, and only when explicitly enabled. That means magic-context stored this prompt somewhere and is using it.

You are a coding assistant operating inside pi, a coding agent harness. You help users by reading files and looking up missing information on the internet. You are in read-only **Ask** mode: do not modify local files, repositories, or external systems.

That is not a standard pi system prompt; it comes from this:

Image

It is my subagent system.

Diagnostics

## Environment
- Pi plugin: v0.32.3
- Pi: 0.80.10
- OS: linux x64
- Node: v24.18.0

## Diagnostics
- Timestamp: 2026-07-19T05:22:22.349Z
- Pi plugin: v0.32.3
- OS: linux x64
- Node: v24.18.0
- Pi installed: true (0.80.10)
- 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/aft-pi@0.47.1",
    "npm:@cortexkit/pi-magic-context@0.32.3"
  ]
}


### Config paths

{
  "agentDir": "<HOME>/.pi/agent",
  "userConfig": "<HOME>/.config/cortexkit/magic-context.jsonc",
  "projectConfig": "/home/<USER:545ea5384610>/Praca/.pi/.cortexkit/magic-context.jsonc"
}


### User magic-context.jsonc flags

{
  "$schema": "https://raw.githubusercontent.com/cortexkit/magic-context/master/assets/magic-context.schema.json",
  "cache_ttl": {
    "default": "10m"
  },
  "execute_threshold_percentage": {
    "default": 65,
    "minimax/minimax-m3": 60,
    "openai-codex/gpt-5.5": 75,
    "openai-codex/gpt-5.6-sol": 65,
    "openai-codex/gpt-5.6-terra": 65,
    "openai-codex/gpt-5.6-luna": 65
  },
  "language": "en",
  "auto_update": false,
  "memory": {
    "git_commit_indexing": {
      "enabled": true
    }
  },
  "historian": {
    "model": "omniroute/quick_free",
    "fallback_models": [
      "minimax/minimax-m3"
    ]
  },
  "dreamer": {
    "model": "omniroute/quick_free",
    "fallback_models": [
      "minimax/minimax-m3"
    ],
    "tasks": {
      "map-memories": {
        "schedule": "0 16 * * *"
      },
      "verify": {
        "schedule": "0 17 * * *"
      },
      "verify-broad": {
        "schedule": "0 18 * * 0"
      },
      "curate": {
        "schedule": "0 18 * * 0"
      },
      "classify-memories": {
        "schedule": "0 20 * * *"
      },
      "retrospective": {
        "schedule": "0 19 * * *"
      },
      "maintain-docs": {
        "schedule": ""
      },
      "promote-primers": {
        "schedule": "0 17 * * *",
        "promotion_threshold": 2
      },
      "refresh-primers": {
        "schedule": "0 17 * * *"
      },
      "evaluate-smart-notes": {
        "schedule": "0 17 * * *"
      },
      "review-user-memories": {
        "schedule": "0 17 * * *",
        "promotion_threshold": 3
      }
    }
  },
  "sidekick": {
    "enabled": true,
    "model": "omniroute/quick_free",
    "fallback_models": [
      "minimax/minimax-m3"
    ],
    "timeout_ms": 30000
  }
}


### Project magic-context.jsonc flags

{}


### Loaded config paths
- <HOME>/.config/cortexkit/magic-context.jsonc

### Config load warnings
_None._

### Shared storage

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


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

{
  "knownConflicts": [],
  "otherPiExtensions": [
    "npm:@cortexkit/aft-pi@0.47.1"
  ]
}


### Log file
- Path: /tmp/pi/magic-context/magic-context.log
- Exists: true
- Size: 5 KB

## Recent errors (last 20, sanitized)

[2026-07-19T05:21:56.270Z] [dreamer] classify chunk failed: Error message="classify manifest missing id 65" {"stackHead":"Error: classify manifest missing id 65 | at assertManifestCoversExactly (<HOME>/.pi/agent/tmp/extensions/npm/f35b2129/<USER:545ea5384610>_modules/@cortexkit/pi-magic-context/dist/index.js:198863:1061) | at applyClassifications (<HOME>/.pi/agent/tmp/extensions/npm/f35b2129/<USER:545ea5384610>_modules/@cortexkit/pi-magic-context/dist/index.js:198912:5103) | at classifyOneChunk (<HOME>/.pi/agent/tmp/extensions/npm/f35b2129/<USER:545ea5384610>_modules/@cortexkit/pi-magic-context/dist/index.js:198912:4321)"}

Plugin version

No response

OpenCode version

No response

Platform

No response

Client

Pi

Log output (optional)

## Log (last 400 lines, sanitized)

[2026-07-19T05:20:14.982Z] [migrations] migration lock check attempt 1/6
[2026-07-19T05:20:15.000Z] [magic-context][pi] rehydrated 6 Pi deferred compaction marker session(s)
[2026-07-19T05:20:15.000Z] [magic-context][pi] loaded v0.32.3 | harness=pi | db=<HOME>/.local/share/cortexkit/magic-context/context.db | project=git:dfe1725c3993d78dea18147fcfe472cf815a457d | dir=/home/<USER:545ea5384610>/Praca/.pi
[2026-07-19T05:20:15.010Z] [magic-context][pi] config loaded from: <HOME>/.config/cortexkit/magic-context.jsonc
[2026-07-19T05:20:15.022Z] [magic-context][pi] registered embedding config for project git:dfe1725c3993d78dea18147fcfe472cf815a457d
[2026-07-19T05:20:15.022Z] [magic-context][pi] registered tools: ctx_search, ctx_memory, ctx_note, ctx_expand, todowrite, ctx_reduce; registered /todos
[2026-07-19T05:20:15.023Z] [magic-context][pi] registered todowrite overlay
[2026-07-19T05:20:15.023Z] [magic-context][pi] registered context handler (tagging + drops + nudges)
[2026-07-19T05:20:15.023Z] [magic-context][pi] registered historian trigger (model=omniroute/quick_free, executeThreshold=65% (minimax/minimax-m3=60%, openai-codex/gpt-5.5=75%, openai-codex/gpt-5.6-sol=65%, openai-codex/gpt-5.6-terra=65%, openai-codex/gpt-5.6-luna=65%))
[2026-07-19T05:20:15.023Z] [magic-context][pi] registered auto-search hint (threshold=0.6, minChars=20)
[2026-07-19T05:20:15.023Z] [magic-context][pi] registered /ctx-aug (sidekick model=omniroute/quick_free)
[2026-07-19T05:20:15.023Z] [magic-context][pi] registered model-invisible ctx-status entry renderer
[2026-07-19T05:20:15.023Z] [magic-context][pi] registered /ctx-status
[2026-07-19T05:20:15.023Z] [magic-context][pi] registered magic-context status line
[2026-07-19T05:20:15.023Z] [magic-context][pi] registered /ctx-flush
[2026-07-19T05:20:15.024Z] [magic-context][pi] registered /ctx-recomp
[2026-07-19T05:20:15.024Z] [magic-context][pi] registered /ctx-wrapup
[2026-07-19T05:20:15.024Z] [magic-context][pi] registered /ctx-session-upgrade
[2026-07-19T05:20:15.024Z] [magic-context][pi] registered /ctx-dream
[2026-07-19T05:20:15.024Z] [magic-context][pi] registered /ctx-embed
[2026-07-19T05:20:15.025Z] [dreamer] registered project git:dfe1725c3993d78dea18147fcfe472cf815a457d (dreaming=true embeddings=false commits=true; total=1)
[2026-07-19T05:20:15.025Z] [dreamer] started independent schedule timer (every 15m)
[2026-07-19T05:20:15.025Z] [magic-context][pi] registered dreamer (map-memories 0 16 * * *, verify 0 17 * * *, verify-broad 0 18 * * 0, curate 0 18 * * 0, classify-memories 0 20 * * *, retrospective 0 19 * * *, evaluate-smart-notes 0 17 * * *, review-user-memories 0 17 * * *, promote-primers 0 17 * * *, refresh-primers 0 17 * * *)
[2026-07-19T05:20:15.025Z] [magic-context][pi] registered before_agent_start system prompt injector
[2026-07-19T05:21:44.756Z] [magic-context][pi-status] /ctx-dream: ## /ctx-dream

Running dream task "classify-memories" for git:dfe1725c3993d78dea18147fcfe472cf815a457d…
Project directory: /home/<USER:545ea5384610>/Praca/.pi
[2026-07-19T05:21:46.376Z] [magic-context][pi] subagent child detected (MAGIC_CONTEXT_PI_SUBAGENT=1); skipping full extension registration
[2026-07-19T05:21:56.270Z] [dreamer] classify chunk failed: Error message="classify manifest missing id 65" {"stackHead":"Error: classify manifest missing id 65 | at assertManifestCoversExactly (<HOME>/.pi/agent/tmp/extensions/npm/f35b2129/<USER:545ea5384610>_modules/@cortexkit/pi-magic-context/dist/index.js:198863:1061) | at applyClassifications (<HOME>/.pi/agent/tmp/extensions/npm/f35b2129/<USER:545ea5384610>_modules/@cortexkit/pi-magic-context/dist/index.js:198912:5103) | at classifyOneChunk (<HOME>/.pi/agent/tmp/extensions/npm/f35b2129/<USER:545ea5384610>_modules/@cortexkit/pi-magic-context/dist/index.js:198912:4321)"}
[2026-07-19T05:21:56.270Z] [dreamer] classify: stage=2 classified=0 changed=0 chunks=1
[2026-07-19T05:21:56.277Z] [dreamer] classify-memories: stage=2 classified=0 changed=0 chunks=1
[2026-07-19T05:21:56.283Z] [magic-context][pi-status] /ctx-dream: ## /ctx-dream

Ran: classify-memories
[2026-07-19T05:22:14.935Z] [dreamer] timer tick (startup) — projects=1
[2026-07-19T05:22:15.588Z] [git-commits] sweep starting for git:dfe1725c3993d78dea18147fcfe472cf815a457d (sinceDays=365 maxCommits=2000)
[2026-07-19T05:22:15.611Z] [git-commits] read 1 commits for git:dfe1725c3993d78dea18147fcfe472cf815a457d (sinceMs=1784403960000 latestIndexed=1784404020000)
[2026-07-19T05:22:15.613Z] [git-commits] indexed git:dfe1725c3993d78dea18147fcfe472cf815a457d: scanned=1 inserted=0 updated=0 evicted=0 embedded=0
[2026-07-19T05:22:15.623Z] [git-commits] sweep finished for git:dfe1725c3993d78dea18147fcfe472cf815a457d in 35ms: scanned=1 inserted=0 updated=0 evicted=0 embedded=0 drained=0 backlogDrained=0
[2026-07-19T05:22:15.630Z] [dreamer] OpenCode DB not found at <HOME>/.local/share/opencode/opencode.db — skipping OpenCode history scan

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions