openclaw - 💡(How to fix) Fix [Feature]: User-configurable "always-apply rules" mechanism in system prompt

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…

Provide a per-user config option that guarantees specified rules are always injected into the system prompt as mandatory directives, regardless of the skill-matching logic.

Root Cause

When the skill-matching logic evaluates a user message and finds no clear skill match (e.g., a conversational request like "复盘一下刚才的任务"), the system prompt instructs: "If none clearly apply: do not read any SKILL.md." This overrides the user's behavioral rules in SOUL.md — the rules exist in context but are not actively executed because there's no mandatory execution mechanism.

Fix Action

Fix / Workaround

Related bug report: https://github.com/openclaw/openclaw/issues/86350 (config.patch SIGUSR1 overwrite issue)

Code Example

{
  "alwaysApply": {
    "rules": [
      "每次收到消息 → 必须先读取 daily-agent SKILL.md",
      "判定长任务 → 第一条工具调用必须是 sessions_spawn"
    ]
  }
}

---

## Always-Apply Rules (user-configured, mandatory)
- 每次收到消息 → 必须先读取 daily-agent SKILL.md
- 判定长任务 → 第一条工具调用必须是 sessions_spawn

## Tooling
... (existing system prompt content)

## Skills (mandatory)
Before replying: scan <available_skills>...

---

规则1:每次收到消息 → 先加载 daily-agent 技能,由它决定怎么做。
规则2:长任务 → 子代理后台执行,完成后通知结果。
RAW_BUFFERClick to expand / collapse

Summary

Provide a per-user config option that guarantees specified rules are always injected into the system prompt as mandatory directives, regardless of the skill-matching logic.

Problem to solve

Users define critical behavioral rules in workspace files (SOUL.md, AGENTS.md) such as "always read daily-agent SKILL.md before processing any message" or "always spawn sub-agent for tasks requiring 10+ tool calls". These rules are injected as Project Context but NOT enforced by the system prompt.

When the skill-matching logic evaluates a user message and finds no clear skill match (e.g., a conversational request like "复盘一下刚才的任务"), the system prompt instructs: "If none clearly apply: do not read any SKILL.md." This overrides the user's behavioral rules in SOUL.md — the rules exist in context but are not actively executed because there's no mandatory execution mechanism.

Current behavior: SOUL.md rules are passive context that may or may not be followed depending on the system prompt's other directives. Users have no way to guarantee that their defined rules take precedence over the skill-matching logic.

Proposed solution

Add a new config option that provides a guaranteed injection point for mandatory rules:

Config proposal:

{
  "alwaysApply": {
    "rules": [
      "每次收到消息 → 必须先读取 daily-agent SKILL.md",
      "判定长任务 → 第一条工具调用必须是 sessions_spawn"
    ]
  }
}

How it works:

  1. Rules in this section are injected into the system prompt as mandatory directives, separate from the skill-matching logic
  2. They appear in a dedicated "Always-Apply Rules" section that takes precedence over skill-matching instructions
  3. The injection happens at every turn, regardless of whether any skill matched
  4. Users can manage rules via config, with per-session override capability

Example system prompt structure after this change:

## Always-Apply Rules (user-configured, mandatory)
- 每次收到消息 → 必须先读取 daily-agent SKILL.md
- 判定长任务 → 第一条工具调用必须是 sessions_spawn

## Tooling
... (existing system prompt content)

## Skills (mandatory)
Before replying: scan <available_skills>...

UI/UX: Users can also define these rules interactively through conversation, e.g., "Always remember to check daily-agent" → the system automatically adds it to alwaysApply.rules after confirmation.

Alternatives considered

1. Rely on SOUL.md / AGENTS.md alone

  • Current approach. Rules exist as Project Context.
  • Problem: Passive context that competes with system prompt directives. When skill-matching says "none clearly apply → do not read any SKILL.md", the rules in SOUL.md are ignored.
  • Verdict: Insufficient. Context injection ≠ mandatory execution.

2. Use skill descriptions to force matching

  • Write skill descriptions that always match (e.g., daily-agent says "始终处于活跃状态").
  • Problem: The skill-matching logic is opaque and may still skip. Users can't control the matching algorithm.
  • Verdict: Unreliable, depends on internal matching behavior.

3. Memory files (MEMORY.md) as rule storage

  • Store rules in long-term memory.
  • Problem: Same as SOUL.md — passive context, no guaranteed execution mechanism.
  • Verdict: Same problem.

Impact

Affected: All users who define behavioral rules for their agents (SOUL.md, AGENTS.md, custom rules) Severity: High — blocks workflow reliability. Users cannot guarantee their critical rules are followed, undermining trust in the agent. Frequency: Always — every time the skill-matching logic doesn't find a clear match, which is common for conversational/administrative requests Consequence: Agents skip critical behavioral directives (e.g., reading daily-agent before processing tasks, spawning sub-agents for long tasks), leading to blocked conversations, wasted time, and frustration. In our case: 50+ browser operations in main session blocking conversation for 10 minutes, user had to repeatedly remind the agent of rules that were already documented.

Evidence/examples

Concrete case (2026-05-25):

User's SOUL.md defines:

规则1:每次收到消息 → 先加载 daily-agent 技能,由它决定怎么做。
规则2:长任务 → 子代理后台执行,完成后通知结果。

User message: "复盘一下刚才的任务,之前多次强调过,长程任务要后台执行,你为何没有遵守"

Skill-matching evaluation: "none clearly apply" → system prompt says "do not read any SKILL.md"

Result: Agent did NOT read daily-agent SKILL.md, did NOT acknowledge the rule violation, proceeded to execute the task directly. User had to explicitly ask: "daily-agent,和你讲过,每次任务首先调用这个技能,你实际执行了没有"

The agent's own analysis confirmed: "系统 prompt 的 skill-matching 优先级 > SOUL.md 的 daily-agent 规则" — the rules in SOUL.md are passive context that get overridden by system prompt directives.

Additional information

OpenClaw version: 2026.3.13 (d587705) Platform: Windows 10 Pro (10.0.19044, x64) Channel: MX (messaging plugin)

This feature would fundamentally improve the reliability of user-defined agent behavior by providing a guaranteed execution path that bypasses the skill-matching logic. It's not about changing how skills work — it's about giving users a way to ensure their critical behavioral directives are always enforced.

Related bug report: https://github.com/openclaw/openclaw/issues/86350 (config.patch SIGUSR1 overwrite issue)

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