Skip to content

fix: run BOOT.md for each configured agent at startup#20569

Merged
gumadeiras merged 5 commits intoopenclaw:mainfrom
mcaxtr:fix/13000-boot-md-per-agent
Feb 19, 2026
Merged

fix: run BOOT.md for each configured agent at startup#20569
gumadeiras merged 5 commits intoopenclaw:mainfrom
mcaxtr:fix/13000-boot-md-per-agent

Conversation

@mcaxtr
Copy link
Contributor

@mcaxtr mcaxtr commented Feb 19, 2026

Summary

Fixes #13000

  • The boot-md hook now iterates over all configured agents (via listAgentIds) instead of running BOOT.md only for the default agent's workspace.
  • runBootOnce() accepts an optional agentId parameter and resolves the per-agent session key when provided.
  • Each agent's workspace directory is resolved via resolveAgentWorkspaceDir, so each agent loads its own BOOT.md independently.

Test plan

  • New unit test in boot.test.ts verifies per-agent session key resolution (resolveAgentMainSessionKey)
  • New test file handler.test.ts verifies the handler iterates over all agents and passes correct workspaceDir + agentId to runBootOnce
  • Handler correctly skips non-gateway and non-startup events
  • Handler gracefully handles missing cfg in context
  • Single-agent (default) configuration still works as before

Greptile Summary

Updated the boot-md hook handler to run BOOT.md for each configured agent at gateway startup instead of only for the default agent. The handler now iterates through all agent IDs via listAgentIds() and resolves each agent's workspace directory independently using resolveAgentWorkspaceDir(). The runBootOnce() function was extended to accept an optional agentId parameter that determines the correct per-agent session key via resolveAgentMainSessionKey().

  • Handler now uses listAgentIds() and resolveAgentWorkspaceDir() to iterate over all agents
  • runBootOnce() accepts optional agentId parameter for per-agent session key resolution
  • Per-agent session key resolution logic properly integrated with existing session management
  • Tests verify both multi-agent and single-agent (default) configurations work correctly
  • Handler correctly skips execution when cfg is missing from context

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The implementation is well-tested with comprehensive unit tests covering both the new per-agent session key resolution and the handler's iteration logic. The changes are focused and backward-compatible (single-agent configurations continue to work). The handler correctly validates required context and gracefully handles missing configuration.
  • No files require special attention

Last reviewed commit: ecaff9c

@openclaw-barnacle openclaw-barnacle bot added gateway Gateway runtime size: S experienced-contributor Contributor with 10+ merged PRs labels Feb 19, 2026
@mcaxtr
Copy link
Contributor Author

mcaxtr commented Feb 19, 2026

Note: the linked issue #13000 was closed by @sebslight as a duplicate of #11717, but these are distinct bugs:

The fix in this PR addresses the per-agent boot execution, which is not covered by #11717.

@mcaxtr mcaxtr force-pushed the fix/13000-boot-md-per-agent branch from ecaff9c to 4067ebe Compare February 19, 2026 03:23
@gumadeiras gumadeiras self-assigned this Feb 19, 2026
@gumadeiras gumadeiras force-pushed the fix/13000-boot-md-per-agent branch from 4067ebe to 2c463d5 Compare February 19, 2026 05:45
@gumadeiras gumadeiras merged commit 48e6b4f into openclaw:main Feb 19, 2026
12 checks passed
@gumadeiras
Copy link
Member

gumadeiras commented Feb 19, 2026

Merged via squash.

Valeu @mcaxtr!

anschmieg pushed a commit to anschmieg/openclaw that referenced this pull request Feb 19, 2026
Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 9098a4c
Co-authored-by: mcaxtr <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
yneth-ray-openclaw pushed a commit to yneth-ray-openclaw/openclaw that referenced this pull request Feb 19, 2026
Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 9098a4c
Co-authored-by: mcaxtr <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
vignesh07 pushed a commit to pahdo/openclaw that referenced this pull request Feb 20, 2026
Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 9098a4c
Co-authored-by: mcaxtr <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
HenryChenV pushed a commit to HenryChenV/openclaw that referenced this pull request Feb 20, 2026
Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: 9098a4c
Co-authored-by: mcaxtr <[email protected]>
Co-authored-by: gumadeiras <[email protected]>
Reviewed-by: @gumadeiras
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

experienced-contributor Contributor with 10+ merged PRs gateway Gateway runtime size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: boot-md only executes default agent BOOT.md; should execute per-agent BOOT.md on gateway startup

2 participants

Comments