Skip to content

context: compaction — semantic recovery affordance after fold/stub #242

Closed

Description

@santoshkumarradha

compaction: semantic recovery affordance after fold/stub

Parent: none — independent of #228 family (context organization, not task families)

Problem

After a compaction pass, folded assistant reasoning is replaced by a marker line and the stubbed tool results point at the store/journal. The model is never told it can query that journal. So the only recovery path is re-exploration via tools (re-grep, re-read) — wasteful, and lossy when the folded context held reasoning, not file content.

The transcript does still hold: user messages (never folded), the verbatim tail, and the state card. But the model has no affordance for "the folded context is grep-able at ".

Acceptance

  • The fold marker or the system prompt's session-facts section tells the model where the full record lives and that grep/read on it works (the session journal path is already journaled; the store thread for chatlog sessions too).
  • Cheapest correct form: extend the fold marker text (foldLocked's marker) to name the journal path, or add one line to system.md's session-facts ("folded context: grep the session journal at ").
  • Verification: a compaction pass fired; the resulting marker names a path; grep on that path returns folded content.
Where it lives

internal/session/loop.go — foldLocked marker composition; internal/session/sessionfile.go — appendCompaction. Keep it to the marker text change; do not add a new tool.


Drafted with CodeAF · reviewed and owned by the author

Activity

  1. added 5 commits that reference this issue on Sep 1, 2026
    542fcb2
    9cc114a
    66040d7
    0905811
    f3bdda0
  2. added a commit that references this issue on Sep 1, 2026
    ef36c24
  3. added
    bug
    area:session
    on Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area:sessionbug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions