openclaw - ✅(Solved) Fix [Bug]: Model hallucinates fabricated data on session reset [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#75070Fetched 2026-05-01 05:38:28
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
2
Author
Timeline (top)
commented ×1cross-referenced ×1labeled ×1

On session reset, the model receives an empty or bootstrap prompt but
instead of generating a simple welcome message, it fabricates
realistic-looking data (calendar events, JSON structures) and presents
it as if the user provided it. This can trigger wrong actions based on
entirely invented information.

Root Cause

On session reset, the model receives an empty or bootstrap prompt but
instead of generating a simple welcome message, it fabricates
realistic-looking data (calendar events, JSON structures) and presents
it as if the user provided it. This can trigger wrong actions based on
entirely invented information.

Fix Action

Fix / Workaround

Workaround Applied

PR fix notes

PR #75127: fix: guard session reset prompts against fabricated data

Description (problem / solution / changelog)

Summary

  • Problem: Bare /new and /reset startup prompts did not explicitly prevent models from presenting invented data as user-provided context.
  • Why it matters: On session reset, a model can fabricate realistic calendar/email/JSON-style data and act on it before verification.
  • What changed: Added a shared reset-startup guardrail that tells the model not to invent user data and to verify real data with tools before acting.
  • What did NOT change (scope boundary): No runtime behavior, tool permissions, model routing, bootstrap flow, or config defaults changed.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • Closes #75070
  • Related #
  • This PR fixes a bug or regression

Root Cause (if applicable)

  • Root cause: The bare session reset prompt guided startup/greeting behavior but did not explicitly forbid fabricating contextual data during the first reset response.
  • Missing detection / guardrail: Existing prompt tests checked startup and bootstrap wording, but not the anti-fabrication instruction.
  • Contributing context (if known): The issue report showed reset responses could present invented calendar/API-style data as real.

Regression Test Plan (if applicable)

  • Coverage level that should have caught this:
    • Unit test
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient
  • Target test or file: src/auto-reply/reply/session-reset-prompt.test.ts
  • Scenario the test should lock in: Bare reset prompts, bootstrap-pending reset prompts, and limited-bootstrap reset prompts all include the anti-fabrication guardrail.
  • Why this is the smallest reliable guardrail: The bug is in reset prompt construction, so direct prompt assertions catch regressions without model/provider variability.
  • Existing test that already covers this (if any): Existing reset prompt tests covered startup/bootstrap wording; this PR extends them.
  • If no new test is added, why not: N/A

User-visible / Behavior Changes

Bare /new and /reset startup prompts now explicitly instruct the model not to invent user data and to verify real data with tools before acting.

Diagram (if applicable)

Before:
[/new or /reset] -> [startup prompt] -> [model may fill gaps with fabricated data]

After:
[/new or /reset] -> [startup prompt + anti-fabrication guardrail] -> [model must not present invented data as real]

Security Impact (required)

  • New permissions/capabilities? (No)
  • Secrets/tokens handling changed? (No)
  • New/changed network calls? (No)
  • Command/tool execution surface changed? (No)
  • Data access scope changed? (No)
  • If any Yes, explain risk + mitigation: N/A

Repro + Verification

Environment

  • OS: macOS
  • Runtime/container: Node 22 / pnpm
  • Model/provider: N/A, prompt-construction unit coverage
  • Integration/channel (if any): Session reset prompt path
  • Relevant config (redacted): N/A

Steps

  1. Trigger a bare /new or /reset session startup.
  2. Inspect the generated reset startup prompt.
  3. Verify the prompt includes the anti-fabrication guardrail.

Expected

  • Reset startup prompt tells the model not to invent user data and to verify real data with tools before acting.

Actual

  • Previous prompt did not explicitly include that guardrail.

Evidence

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Human Verification (required)

  • Verified scenarios:
    • Normal bare reset prompt includes the anti-fabrication guardrail.
    • Bootstrap-pending reset prompt includes the guardrail.
    • Limited-bootstrap reset prompt includes the guardrail.
  • Edge cases checked:
    • Current-time prompt behavior remains covered by existing tests.
    • Bootstrap wording remains distinct from normal greeting wording.
  • What you did not verify:
    • Live model behavior across providers.
    • Full repo lint, because lint:core currently fails on unrelated existing files.

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

Compatibility / Migration

  • Backward compatible? (Yes)
  • Config/env changes? (No)
  • Migration needed? (No)
  • If yes, exact upgrade steps: N/A

Risks and Mitigations

  • Risk: Prompt wording could become too broad and discourage legitimate startup reads.
    • Mitigation: The guardrail only forbids inventing or presenting unverified data as real; it still allows tool verification before acting.

Changed files

  • src/auto-reply/reply/session-reset-prompt.test.ts (modified, +4/-0)
  • src/auto-reply/reply/session-reset-prompt.ts (modified, +16/-2)

Code Example



---

## 🚨 Session Reset Guardrail  
  
On session reset, you receive an instruction to generate a welcome message.  
**Do NOT fabricate data, events, or user messages.**  
  
- If the user message is empty or appears to be a bootstrap instruction →  
generate a short, friendly greeting only  
- Do NOT invent calendar events, emails, JSON data, or any other content  
and present it as if the user provided it  
- Do NOT hallucinate context to fill gaps — if you have nothing to say,  
say nothing (HEARTBEAT_OK)  
- If you're unsure whether data is real, verify it with tools before  
acting on it
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

On session reset, the model receives an empty or bootstrap prompt but
instead of generating a simple welcome message, it fabricates
realistic-looking data (calendar events, JSON structures) and presents
it as if the user provided it. This can trigger wrong actions based on
entirely invented information.

Steps to reproduce

  1. Use OpenClaw with a model that has workspace context referencing
    calendars, emails, or structured data (e.g., MEMORY.md mentions "
    Household management calendar", TOOLS.md has a calendar ID)
  2. Reset a session (e.g., after a debug session)
  3. Observe the model's first response

Expected behavior

The model should generate a short, friendly greeting (e.g., "Hello!
How can I help?") or do nothing (HEARTBEAT_OK) when the user message
is empty or a bootstrap instruction.

Actual behavior

The model can fabricate a complete JSON blob containing fake data and
presents it as user-provided input.

OpenClaw version

2026.4.26

Operating system

Ubuntu 24.04

Install method

No response

Model

xiaomi/mimo-v2.5

Provider / routing chain

openclaw>xiaomi (token plan endpoint)>openclaw

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

  1. The agent acted on the fabricated data — it flagged a "<important meeting> TODAY" and offered to set reminders for it
  2. The data looks authoritative — it's formatted as a proper
    Google Calendar API response
  3. No verification was performed — the agent presented invented
    data as real without checking the actual calendar
  4. Triggered wrong actions — if the user hadn't pushed back, the
    model would have created reminders for fake events

Additional information

Workaround Applied

We added a Session Reset Guardrail section to AGENTS.md:

## 🚨 Session Reset Guardrail  
  
On session reset, you receive an instruction to generate a welcome message.  
**Do NOT fabricate data, events, or user messages.**  
  
- If the user message is empty or appears to be a bootstrap instruction →  
generate a short, friendly greeting only  
- Do NOT invent calendar events, emails, JSON data, or any other content  
and present it as if the user provided it  
- Do NOT hallucinate context to fill gaps — if you have nothing to say,  
say nothing (HEARTBEAT_OK)  
- If you're unsure whether data is real, verify it with tools before  
acting on it

extent analysis

TL;DR

The model should be updated to handle session resets by generating a simple welcome message instead of fabricating realistic-looking data.

Guidance

  • Review the model's logic for handling session resets and empty or bootstrap prompts to ensure it does not generate fake data.
  • Implement a check to verify the authenticity of data before presenting it as user-provided input.
  • Update the model to follow the guidelines outlined in the Session Reset Guardrail section of AGENTS.md.
  • Test the model with various session reset scenarios to ensure it behaves as expected and does not fabricate data.

Example

No code snippet is provided as the issue does not contain sufficient technical details to create a specific example.

Notes

The provided workaround, adding a Session Reset Guardrail section to AGENTS.md, may not be sufficient to fully resolve the issue, as it relies on the model being updated to follow these guidelines.

Recommendation

Apply workaround: Update the model to follow the guidelines outlined in the Session Reset Guardrail section of AGENTS.md, as this provides a clear set of rules for handling session resets and empty or bootstrap prompts.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

The model should generate a short, friendly greeting (e.g., "Hello!
How can I help?") or do nothing (HEARTBEAT_OK) when the user message
is empty or a bootstrap instruction.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix [Bug]: Model hallucinates fabricated data on session reset [1 pull requests, 1 comments, 2 participants]