openclaw - 💡(How to fix) Fix Token efficiency: subagents do not need full SOUL/bootstrap files [1 pull requests]

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…

Fix Action

Fixed

Code Example

{
  agents: {
    defaults: {
      subagentBootstrapFiles: ["SUBAGENTS.md"],
    },
    list: [
      {
        id: "codex",
        runtime: { type: "acp", acp: { agent: "codex" } },
        subagentBootstrapFiles: ["AGENTS.md"],
      },
    ],
  },
}
RAW_BUFFERClick to expand / collapse

Problem

Spawned sub-agents currently receive the built-in sub-agent bootstrap set, including profile/persona files such as SOUL.md, IDENTITY.md, and USER.md. That is useful as a default, but not every delegated worker needs the same identity, user, customer, or runbook context as the main agent.

For token efficiency and least-privilege context, users should be able to choose exactly which workspace bootstrap files sub-agent sessions receive. Codex-style sub-agent targets may only need AGENTS.md; other worker targets may prefer a dedicated SUBAGENTS.md.

Proposal

Add an opt-in, core configuration surface:

{
  agents: {
    defaults: {
      subagentBootstrapFiles: ["SUBAGENTS.md"],
    },
    list: [
      {
        id: "codex",
        runtime: { type: "acp", acp: { agent: "codex" } },
        subagentBootstrapFiles: ["AGENTS.md"],
      },
    ],
  },
}

Semantics:

  • Omitted config preserves the current built-in sub-agent bootstrap behavior.
  • [] means no workspace bootstrap files for sub-agent sessions.
  • Per-agent agents.list[].subagentBootstrapFiles overrides agents.defaults.subagentBootstrapFiles.
  • The setting applies only to sub-agent session keys; cron bootstrap filtering remains unchanged.
  • SUBAGENTS.md is recognized for explicit loading but is not auto-created and is not part of default full-context loading.
  • For opted-in configs, the configured selection is exact and final after bootstrap hooks, so excluded files such as SOUL.md or USER.md are not accidentally reintroduced.

Acceptance Criteria

  • Default sub-agent behavior remains unchanged when the new config is omitted.
  • agents.defaults.subagentBootstrapFiles: ["SUBAGENTS.md"] injects only SUBAGENTS.md for sub-agents and preserves a missing-file marker when the file is absent.
  • agents.list[].subagentBootstrapFiles can override defaults, for example a Codex ACP target receiving only AGENTS.md.
  • Empty arrays are accepted and produce no sub-agent bootstrap files.
  • Invalid names, paths, or casing are rejected by config validation.
  • Embedded Pi preload resolution passes the session agent id so per-agent sub-agent bootstrap config is honored before lazy routing.

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

openclaw - 💡(How to fix) Fix Token efficiency: subagents do not need full SOUL/bootstrap files [1 pull requests]