-
-
Notifications
You must be signed in to change notification settings - Fork 69.1k
[Bug]: Compaction summarization does not preserve exact identifiers #19207
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't workingstaleMarked as stale due to inactivityMarked as stale due to inactivity
Description
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
- Start a long OpenClaw session that includes exact identifiers (UUIDs, IPs, SHAs, container hashes, API paths with embedded IDs, connection strings, etc.).
- Continue until auto-compaction runs (or trigger
/compact). - Ask the model to recall exact identifiers that appeared in the compacted portion.
- 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
- Related issues (separate but relevant feature requests for custom rules): [Feature]: Support compaction.customInstructions for auto-compaction #10479, Feature request: Customizable compaction prompts and post-compaction instructions #19148, [Feature]: Configurable compaction summary prompt #16092.
- Proposed fix direction: broaden default preservation text to explicitly include “exact identifiers, UUIDs, IP addresses, URLs, commit SHAs, connection strings, and all precise values.” This is a minimal, low-risk prompt-only change.
compaction.customInstructions(tracked in [Feature]: Support compaction.customInstructions for auto-compaction #10479) can complement this by letting users add domain-specific preservation constraints.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingstaleMarked as stale due to inactivityMarked as stale due to inactivity
Type
Fields
Give feedbackNo fields configured for issues without a type.