openclaw - 💡(How to fix) Fix Telegram DM session keeps using stale workspace/bootstrap context after files were updated and gateway restarted [1 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#55506Fetched 2026-04-08 01:38:44
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants
RAW_BUFFERClick to expand / collapse

Version

  • OpenClaw 2026.3.24

Environment

  • Windows
  • Telegram DM channel
  • Web Control UI also connected

What happened

A Telegram DM session kept acting like first-run bootstrap was unfinished, even after workspace files were updated to complete onboarding.

The bot:

  • remembered the user name intermittently
  • kept asking what to call the assistant / repeating onboarding questions
  • behaved as if stale bootstrap/project context was still being injected

Expected behavior

After updating workspace files and restarting the gateway, fresh Telegram runs should use current workspace context:

  • IDENTITY.md
  • USER.md
  • MEMORY.md
  • updated AGENTS.md
  • current BOOTSTRAP.md state, or no bootstrap if removed

The bot should not continue acting like onboarding is unfinished.

Repro steps

  1. Start with a fresh OpenClaw workspace using the bootstrap flow.
  2. Complete onboarding in one channel.
  3. Save identity/user info into workspace files.
  4. Remove BOOTSTRAP.md.
  5. Update AGENTS.md so startup also reads IDENTITY.md.
  6. Restart the gateway.
  7. DM the Telegram bot again.
  8. Observe Telegram still asking onboarding questions / not grounding in updated workspace identity.

Important observations

  • On disk, BOOTSTRAP.md was confirmed deleted.
  • But the Telegram session’s systemPromptReport.injectedWorkspaceFiles still showed BOOTSTRAP.md as present.
  • Restarting the gateway did not fix it.
  • Recreating BOOTSTRAP.md as a harmless "bootstrap complete" marker still did not fully resolve Telegram behavior.

Suspected cause

One of:

  • stale project-context cache
  • stale injected workspace file snapshot reused across channel sessions
  • Telegram DM session not rebuilding prompt context from live workspace files after restart
  • mismatch between actual workspace state and systemPromptReport / injected context

Impact

Channel sessions, especially Telegram DMs, can behave inconsistently and ignore current workspace identity/bootstrap state, making onboarding/memory feel broken even when workspace files are correct.

extent analysis

Fix Plan

To resolve the issue of stale bootstrap context being injected into Telegram DM sessions, we need to ensure that the workspace files are properly updated and reflected in the systemPromptReport.

Here are the steps to fix the issue:

  • Clear the cache: Implement a cache clearing mechanism when the gateway restarts or when the BOOTSTRAP.md file is removed. This can be done by adding a cache invalidation step in the gateway restart process.
  • Update the systemPromptReport: Modify the systemPromptReport to rebuild the prompt context from the live workspace files after restart. This can be achieved by adding a step to reload the workspace files when the gateway restarts.
  • Remove stale injected workspace file snapshot: Ensure that the injected workspace file snapshot is not reused across channel sessions. This can be done by generating a new snapshot for each session.

Example code snippet to clear the cache and update the systemPromptReport:

import os

def clear_cache():
    # Clear the cache directory
    cache_dir = 'path/to/cache'
    for file in os.listdir(cache_dir):
        os.remove(os.path.join(cache_dir, file))

def update_system_prompt_report(workspace_files):
    # Rebuild the prompt context from the live workspace files
    system_prompt_report = {}
    for file in workspace_files:
        with open(file, 'r') as f:
            system_prompt_report[file] = f.read()
    return system_prompt_report

def restart_gateway():
    # Clear the cache
    clear_cache()
    # Reload the workspace files
    workspace_files = ['IDENTITY.md', 'USER.md', 'MEMORY.md', 'AGENTS.md']
    # Update the systemPromptReport
    system_prompt_report = update_system_prompt_report(workspace_files)
    # Restart the gateway
    # ...

Verification

To verify that the fix worked, follow these steps:

  • Restart the gateway
  • DM the Telegram bot again
  • Check if the bot is using the current workspace context and not asking onboarding questions
  • Verify that the systemPromptReport.injectedWorkspaceFiles no longer shows BOOTSTRAP.md as present

Extra Tips

  • Ensure that the cache clearing mechanism is properly implemented to avoid any data loss.
  • Consider implementing a periodic cache clearing mechanism to prevent stale data from accumulating.
  • Review the systemPromptReport implementation to ensure that it is correctly rebuilding the prompt context from the live workspace files.

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

After updating workspace files and restarting the gateway, fresh Telegram runs should use current workspace context:

  • IDENTITY.md
  • USER.md
  • MEMORY.md
  • updated AGENTS.md
  • current BOOTSTRAP.md state, or no bootstrap if removed

The bot should not continue acting like onboarding is unfinished.

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 - 💡(How to fix) Fix Telegram DM session keeps using stale workspace/bootstrap context after files were updated and gateway restarted [1 participants]