openclaw - ✅(Solved) Fix [Bug] BOOT.md fires per-agent on shared workspaces — duplicate startup announcements on gateway restart [2 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#74072Fetched 2026-04-30 06:28:57
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
cross-referenced ×3closed ×1commented ×1

Fix Action

Fix / Workaround

Local patch in place since 2026-04-15 — gateway restarts now produce one BOOT.md announcement per shared-workspace cluster instead of N.

PR fix notes

PR #74116: fix(boot-md): deduplicate BOOT.md runs by workspace path

Description (problem / solution / changelog)

Fix #74072\n\nWhen multiple agents share the same workspace directory, runBootChecklist was firing BOOT.md once per agent, producing N duplicate announcements on gateway restart.\n\nNow deduplicates by workspaceDir using a Set before creating tasks, so BOOT.md fires at most once per unique workspace.

Changed files

  • src/hooks/bundled/boot-md/handler.ts (modified, +16/-5)

PR #74194: fix(hooks): deduplicate boot-md startup tasks by workspaceDir

Description (problem / solution / changelog)

Summary

Fixes #74072

  • runBootChecklist previously created one StartupTask per agent ID, causing duplicate runBootOnce calls when multiple agents share the same workspaceDir
  • Added a seenWorkspaces Set to deduplicate tasks by resolved workspace directory — only the first agent per workspace triggers a boot run
  • Adds a new test verifying two agents mapping to the same workspace produce only one runBootOnce call

Changes

  • src/hooks/bundled/boot-md/handler.ts: Filter agent list through seenWorkspaces: Set<string> before mapping to StartupTask[]
  • src/hooks/bundled/boot-md/handler.test.ts: New test case "deduplicates agents sharing the same workspaceDir"

Changed files

  • src/hooks/bundled/boot-md/handler.test.ts (modified, +14/-0)
  • src/hooks/bundled/boot-md/handler.ts (modified, +16/-6)
RAW_BUFFERClick to expand / collapse

Version: OpenClaw 2026.4.26 (long-standing — reproduced from 2026.4.x)

File: dist/bundled/boot-md/handler.jsrunBootChecklist

Symptom

When multiple agents share the same workspace directory (e.g. a primary orchestrator agent + several specialist agents all rooted at ~/Jarvis-V2), BOOT.md fires once per agent on gateway startup. Each fire posts the same workspace-startup announcement to Discord, producing N copies of the same message every restart.

Cause

runBootChecklist is invoked per-agent without tracking which workspaces have already been processed in this gateway lifecycle, so identical workspaces re-run the checklist N times.

Suggested fix

Add a processedWorkspaces Set keyed by workspace path; if the workspace is already in the set, skip the rest of the boot checklist. Reset the set on gateway restart (already handled by module-load).

Local patch in place since 2026-04-15 — gateway restarts now produce one BOOT.md announcement per shared-workspace cluster instead of N.

Low priority but cheap fix — could ship as a one-liner Set check.

extent analysis

TL;DR

Implement a processedWorkspaces Set to track and skip already processed workspaces, ensuring the boot checklist runs only once per shared workspace.

Guidance

  • Identify the runBootChecklist function in handler.js and add a check for the workspace path in the processedWorkspaces Set before executing the boot checklist.
  • Create the processedWorkspaces Set and reset it on gateway restart, as already handled by module-load.
  • Verify the fix by restarting the gateway with multiple agents sharing the same workspace directory and checking for a single BOOT.md announcement per shared workspace.
  • Consider shipping this fix as a one-liner Set check due to its low priority and simplicity.

Example

const processedWorkspaces = new Set();

function runBootChecklist(workspacePath) {
  if (processedWorkspaces.has(workspacePath)) {
    return; // Skip if workspace is already processed
  }
  processedWorkspaces.add(workspacePath);
  // Execute boot checklist
}

Notes

This fix assumes that the workspace path is a unique identifier for each workspace. If this is not the case, an alternative identifier may be needed.

Recommendation

Apply the workaround by implementing the processedWorkspaces Set check, as it is a simple and effective solution to prevent duplicate BOOT.md announcements.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING