Skip to content

feat: add global visibility scope workflow for OpenClaw learnings#4

Open
ZaneChen76 wants to merge 1 commit into
peterskoett:masterfrom
ZaneChen76:feat/global-scope-visibility
Open

feat: add global visibility scope workflow for OpenClaw learnings#4
ZaneChen76 wants to merge 1 commit into
peterskoett:masterfrom
ZaneChen76:feat/global-scope-visibility

Conversation

@ZaneChen76

Copy link
Copy Markdown

Summary

This PR improves self-improving-agent so cross-agent/global persistence is an explicit first-class workflow in OpenClaw.

What changed

  • Added Visibility Scope (OpenClaw) section with 3 scopes:
    • session
    • agent (default)
    • global
  • Added explicit trigger phrases for global persistence requests (English + Chinese).
  • Added Quick Reference entry for cross-agent persistence requests.
  • Added canonical reference file: references/global-learnings.md with a reusable global-entry template (GLRN-*).

Why

Previously, learnings were usually written in the current agent workspace (.learnings/*), which is often agent-local.
This caused confusion when users expected "all agents/sessions" visibility.

This PR keeps current behavior, but documents a clear and actionable path when users request global visibility.

Backward compatibility

  • No breaking changes.
  • Existing local .learnings/* workflow remains unchanged.

Notes

If accepted, I can follow up with a small automation helper script that performs multi-agent pointer sync when scope: global is selected.

@pskoett

pskoett commented Mar 9, 2026

Copy link
Copy Markdown
Collaborator

I will have a look at this seems like a good idea

@miskaone

Copy link
Copy Markdown

Code review

Found 5 issues:

  1. Global learnings path is inside the skill install directory -- data loss on upgrade. The workflow instructs writing to ~/.openclaw/skills/self-improving-agent/references/global-learnings.md (line 96), which gets overwritten on clawdhub install self-improving-agent. Any persisted global learnings will be silently destroyed. The path should be under ~/.openclaw/workspace/ or another stable location outside the versioned skill package.

1. Write canonical entry to a shared file (example: `~/.openclaw/skills/self-improving-agent/references/global-learnings.md`).
2. Add/refresh a short pointer block in each agent's `AGENTS.md` (or equivalent workspace prompt file) that references the canonical global entry.

  1. Direct conflict with PR fix: add anti-loop guardrails to prevent infinite tool call loops #5. PR fix: add anti-loop guardrails to prevent infinite tool call loops #5 deletes the entire Quick Reference table and all OpenClaw-specific content that this PR extends. PR fix: add anti-loop guardrails to prevent infinite tool call loops #5 also adds anti-loop guardrails (max 3 tool calls, no chaining) that this PR's multi-step global broadcast workflow (write shared file, update N agent files, announce) would violate. These two PRs cannot both merge without one undoing the other.

  2. GLRN ID prefix not added to the ID Generation section. The new global-learnings.md template uses GLRN-YYYYMMDD-XXX (line 8), but SKILL.md's ID Generation section (line 252) only defines LRN, ERR, and FEAT. Agents following the documented ID scheme have no guidance for the new type.

```markdown
## [GLRN-YYYYMMDD-XXX] title

## ID Generation
Format: `TYPE-YYYYMMDD-XXX`
- TYPE: `LRN` (learning), `ERR` (error), `FEAT` (feature)
- YYYYMMDD: Current date
- XXX: Sequential number or random 3 chars (e.g., `001`, `A7B`)

  1. Unbounded AGENTS.md write scope with no enumeration or idempotency. Step 2 (line 97) says "Add/refresh a short pointer block in each agent's AGENTS.md" but provides no mechanism to discover which agents exist, no deduplication check, and no dry-run option. Repeated invocations will keep appending pointer blocks.

1. Write canonical entry to a shared file (example: `~/.openclaw/skills/self-improving-agent/references/global-learnings.md`).
2. Add/refresh a short pointer block in each agent's `AGENTS.md` (or equivalent workspace prompt file) that references the canonical global entry.
3. Announce completion and affected agents.

  1. Status vocabulary mismatch. The new template uses active | superseded (line 13 of global-learnings.md) while all existing templates use pending | resolved | in_progress | wont_fix. Existing grep-based review commands (grep "Status**: pending") will silently miss global entries.

**Priority**: low | medium | high | critical
**Status**: active | superseded

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

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.

3 participants