Skip to content

fix: default selfImprovement.enabled to true when config block omitted#391

Merged
rwmjhb merged 2 commits intomasterfrom
fix/self-improvement-default-enabled
Mar 29, 2026
Merged

fix: default selfImprovement.enabled to true when config block omitted#391
rwmjhb merged 2 commits intomasterfrom
fix/self-improvement-default-enabled

Conversation

@AliceLJY
Copy link
Copy Markdown
Collaborator

Summary

  • When selfImprovement config block is entirely omitted from plugin config, enabled defaults to false, which prevents all three self_improvement_* tools from registering
  • This is inconsistent: when the block IS provided but enabled is not explicitly set, it correctly defaults to true via the !== false check
  • Fix: change the else-branch default from enabled: false to enabled: true so the behavior is consistent regardless of whether the config block is present

Details

In index.ts around line 3830, the config parsing for selfImprovement has two branches:

  1. When selfImprovement is an object: enabled defaults to true (via !== false)
  2. When selfImprovement is omitted: enabled was hardcoded to false (the bug)

Verified by testing on a live OpenClaw instance: adding selfImprovement: { enabled: true } to the config makes all 3 self-improvement tools appear, confirming the tools work — they just weren't registering due to the default.

Fixes #375

🤖 Generated with Claude Code

#375)

When the selfImprovement config block is entirely omitted from plugin
config, enabled defaults to false, preventing self_improvement_* tools
from registering. This is inconsistent with the behavior when the block
IS provided but enabled is not set, which correctly defaults to true
via the !== false check.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rwmjhb
Copy link
Copy Markdown
Collaborator

rwmjhb commented Mar 28, 2026

这个修复方向是对的,我这边没有看到阻塞合并的问题。它确实命中了 #375 的核心原因:selfImprovement 整块省略时,enabled 被落成了 false,导致 self_improvement_* 工具不注册;把这里改成 true 之后,这条路径就和 issue 里的复现对上了。

我只想补一个非阻塞备注:selfImprovement 这组默认值现在仍然有一点不一致。当前 PR 修了 enabled,但在“整块 block 省略”时, beforeResetNote / skipSubagentBootstrap / ensureLearningFiles 仍然会落成 false;而如果传 selfImprovement: {},这三项又都会是 true。如果你想把这组语义彻底拉齐,后续可以顺手把这三个 sibling flag 也一起对齐到同一路径行为。

…mitted

When the selfImprovement config block is entirely omitted, beforeResetNote,
skipSubagentBootstrap, and ensureLearningFiles now default to true — matching
the behavior when an empty selfImprovement object is provided.

Addresses review feedback on #391.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@AliceLJY
Copy link
Copy Markdown
Collaborator Author

Good catch — just pushed a follow-up commit (dea7079) that aligns the three sibling flags (beforeResetNote, skipSubagentBootstrap, ensureLearningFiles) to also default to true when the selfImprovement block is omitted. Now both paths produce identical defaults.

@rwmjhb rwmjhb merged commit 26abb04 into master Mar 29, 2026
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

self_improvement_* tools not registered when enableManagementTools is true (beta.10)

2 participants