Skip to content

[Bug]: Compaction summarization does not preserve exact identifiers #19207

@benmillerat

Description

@benmillerat

Summary

Default compaction summarization prompts preserve only file paths, function names, and error messages, causing other exact identifiers to be truncated or dropped.

Steps to reproduce

  1. Start a long OpenClaw session that includes exact identifiers (UUIDs, IPs, SHAs, container hashes, API paths with embedded IDs, connection strings, etc.).
  2. Continue until auto-compaction runs (or trigger /compact).
  3. Ask the model to recall exact identifiers that appeared in the compacted portion.
  4. Observe that identifiers outside the preservation list are truncated, abbreviated, or missing — the model may hallucinate plausible but incorrect replacements.

Expected behavior

Compaction summaries should preserve all exact identifiers verbatim, not only file paths, function names, and error messages.

Actual behavior

Identifiers not explicitly named in the current preservation rule are truncated or omitted during summarization. After compaction, the model lacks a trustworthy source for those values and may hallucinate replacements, leading to wrong API calls, auth failures, and misconfigurations.

OpenClaw version

2026.2.15

Operating system

macOS 15.7.3 (24G419)

Install method

npm global

Logs, screenshots, and evidence

- Prompt sources (in @mariozechner/pi-coding-agent):
-- SUMMARIZATION_PROMPT and UPDATE_SUMMARIZATION_PROMPT in dist/core/compaction/compaction.js
-- SUMMARIZATION_SYSTEM_PROMPT in dist/core/compaction/utils.js
- Current prompt instruction explicitly says: “Preserve exact file paths, function names, and error messages.”
- This scope excludes other exact identifiers (UUIDs, IP/host/port values, SHAs, hashes, endpoint IDs, DB IDs, tokens/headers, pod names, build/version IDs, serial/MAC values, connection strings, URL-embedded IDs, and other precise identifiers).
- Real incident: an Outline collection UUID was compacted to prefix c7a1ae81; later the model hallucinated the missing UUID segments, causing a 403 Forbidden API response. The correct UUID had to be fetched again from Outline.

Impact and severity

  • Affected users/systems/channels: Any long-running OpenClaw workflow handling exact identifiers (infra, API development, database work, DevOps, and general technical sessions).
  • Severity (annoying, blocks workflow, data risk, etc.): Data risk due to silent identifier corruption that drives incorrect operations.
  • Frequency (always/intermittent/edge case): Always for compactions involving identifiers outside the narrow preservation list.
  • Consequence (missed messages, failed onboarding, extra cost, etc.): Failed API/auth operations, wrong configurations, repeated refetching/revalidation, debugging overhead, and reduced trust in compacted context.

Examples of identifiers at risk include:

  • UUIDs
  • IP addresses, hostnames, and ports
  • Git commit SHAs
  • Docker container IDs and image hashes
  • API endpoint paths containing IDs
  • Database row IDs
  • Session tokens
  • Kubernetes pod names
  • Version numbers and build IDs
  • Serial numbers and MAC addresses
  • Any other precise identifier that is not a file path, function name, or error message

Additional information

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleMarked as stale due to inactivity

    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