fix: add self-knowledge docs rule to system prompt#90882
Conversation
|
Codex review: passed. Reviewed June 18, 2026, 11:37 PM ET / 03:37 UTC. Summary PR surface: Source 0, Tests +27, Docs +6. Total +33 across 4 files. Reproducibility: yes. from source for the prompt gap: current main and v2026.6.8 have only broad docs-first wording, while the linked issue provides a concrete daily-note self-knowledge failure example. I did not run a fresh current-main live model conversation in this read-only review. Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Next step before merge
Security Review detailsBest possible solution: Land this generated prompt, test, and docs change if maintainers accept the small prompt-budget steering, then let the linked issue close after merge. Do we have a high-confidence way to reproduce the issue? Yes from source for the prompt gap: current main and v2026.6.8 have only broad docs-first wording, while the linked issue provides a concrete daily-note self-knowledge failure example. I did not run a fresh current-main live model conversation in this read-only review. Is this the best way to solve the issue? Yes. Updating the shared generated Documentation prompt with matching tests and docs is the right layer; the earlier AGENTS-only approach was superseded because it did not change the runtime prompt source. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ae6e1fa4d2d5. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source 0, Tests +27, Docs +6. Total +33 across 4 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
/clownfish automerge |
|
Clownfish is on the reef for this PR. 🐠 I tagged A maintainer can call |
|
/clownfish automerge |
|
Clownfish is on the reef for this PR. 🐠 I tagged A maintainer can call |
|
🦞✅ Source: What merged:
Automerge notes:
The automerge loop is complete. Automerge progress:
|
Summary: - This PR replaces the generated Documentation prompt wording with self-knowledge docs-authority guidance and updates prompt tests plus the system-prompt docs. - PR surface: Source 0, Tests +27, Docs +6. Total +33 across 4 files. - Reproducibility: yes. from source for the prompt gap: current main and v2026.6.8 have only broad docs-first ... ledge failure example. I did not run a fresh current-main live model conversation in this read-only review. Automerge notes: - PR branch already contained follow-up commit before automerge: fix: strengthen self-knowledge docs prompt - PR branch already contained follow-up commit before automerge: test: narrow cli prompt tool assertion - PR branch already contained follow-up commit before automerge: fix: condense self-knowledge docs prompt - PR branch already contained follow-up commit before automerge: fix: clarify self-knowledge docs authority - PR branch already contained follow-up commit before automerge: Merge branch 'main' into sutrah/self-knowledge-docs-prompt Validation: - ClawSweeper review passed for head 88a7db5. - Required merge gates passed before the squash merge. Prepared head SHA: 88a7db5 Review: openclaw#90882 (comment) Co-authored-by: Sutra Hsing <sutrahsing@163.com> Co-authored-by: sutra <sutrahsing@163.com>
Summary: - This PR replaces the generated Documentation prompt wording with self-knowledge docs-authority guidance and updates prompt tests plus the system-prompt docs. - PR surface: Source 0, Tests +27, Docs +6. Total +33 across 4 files. - Reproducibility: yes. from source for the prompt gap: current main and v2026.6.8 have only broad docs-first ... ledge failure example. I did not run a fresh current-main live model conversation in this read-only review. Automerge notes: - PR branch already contained follow-up commit before automerge: fix: strengthen self-knowledge docs prompt - PR branch already contained follow-up commit before automerge: test: narrow cli prompt tool assertion - PR branch already contained follow-up commit before automerge: fix: condense self-knowledge docs prompt - PR branch already contained follow-up commit before automerge: fix: clarify self-knowledge docs authority - PR branch already contained follow-up commit before automerge: Merge branch 'main' into sutrah/self-knowledge-docs-prompt Validation: - ClawSweeper review passed for head 88a7db5. - Required merge gates passed before the squash merge. Prepared head SHA: 88a7db5 Review: openclaw#90882 (comment) Co-authored-by: Sutra Hsing <sutrahsing@163.com> Co-authored-by: sutra <sutrahsing@163.com>
Summary
AGENTS.md, project/workspace/profile/memory context, andmemory_searchare instruction context or user memory, not OpenClaw design/implementation knowledge.src/agents/system-prompt.test.ts.docs/concepts/system-prompt.mdso the docs match the generated prompt behavior.Fixes #90713.
Addresses the review direction from #90719.
Verification
pnpm docs:listpnpm test src/agents/system-prompt.test.tspnpm test src/agents/system-prompt.test.ts src/agents/cli-runner/prepare.test.ts src/agents/cli-runner/helpers.system-prompt.test.tspnpm exec oxfmt --check --threads=1 src/agents/system-prompt.ts src/agents/system-prompt.test.ts src/agents/cli-runner/prepare.test.tsnode scripts/format-docs.mjs --check docs/concepts/system-prompt.mdgit diff --checkpnpm buildzai/glm-5.1Prompt size
Using OpenClaw's normal-text precheck estimate,
ceil(chars / 4):Compared with the earlier verbose version, the final wording saves about 442 chars / 111 tokens. Compared with main, the net addition is about 329 chars / 83 tokens. Compared with the prior strong concise version, this final wording adds about 77 chars / 20 tokens to cover the review nuance that docs/source should be consulted before understanding OpenClaw behavior during task execution, not just before answering a direct question.
Real behavior proof
Behavior addressed: A question like "How does the daily note work for you?" can look like a user-memory question, but it is also an OpenClaw runtime behavior question. The agent should consult OpenClaw docs/source before treating
AGENTS.md, workspace notes, profile/memory context, or memory tools as the source of OpenClaw design/implementation knowledge.Real environment tested: Local OpenClaw checkout on macOS, branch
sutrah/self-knowledge-docs-prompt, commitb47c45621b, embeddedopenclaw agent --local, isolated temp state/workspace under/private/tmp/openclaw-proof-90882to avoid mutating the user's live~/.openclaw.Exact steps or command run after this patch:
OPENCLAW_STATE_DIR=/private/tmp/openclaw-proof-90882/state \ OPENCLAW_CONFIG_PATH=/private/tmp/openclaw-proof-90882/state/openclaw.json \ pnpm openclaw agent --local --agent main \ --session-key self-knowledge-docs-understanding-proof-90882b \ --model zai/glm-5.1 \ --message "How does the daily note work for you?" \ --json --timeout 300Evidence after fix:
provider=zai,model=glm-5.1, session097c3d9f-3d77-4cf6-a921-2c15f2f1d1f5.Let me check the docs to understand how daily notes work in OpenClaw.ls /private/tmp/openclaw-proof-90882/workspace/memory/, which returnedno memory dir.docs/concepts/memory.mdbefore producing the final answer.execandread, 0 failures.Observed result after fix: The
zai/glm-5.1live run searched/read OpenClaw docs before answering the daily-note question, verified the isolated workspace's currentmemory/state, and answered as an OpenClaw runtime behavior explanation. It did not answer first from workspaceAGENTS.mdcontext or external note/memory tooling.What was not tested: This did not restart the user's production Gateway or mutate their real OpenClaw state; the live proof used the embedded local agent with isolated copied config/auth state.