Skip to content

docs(tools): split the Sub-agents page into an index plus seven child pages - #142999

Merged
vincentkoc merged 1 commit into
mainfrom
docs-audit/split-tools-subagents
Sep 9, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
docs-audit/split-tools-subagents

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 9, 2026 •

Copy link
Copy Markdown
Member

What

docs/tools/subagents.md was 54,144 characters (7,142 words, 37 headings) mixing tool reference, how-to, and explanation. It is now an orientation index plus seven child pages under docs/tools/subagents/.

Content-preserving: no rewriting, no reordering. Every H2 block moved verbatim, in original order, at its original heading level.

Closes ledger finding r3-0797 (rubric 3, blocking/split).

Page Bytes Original lines
docs/tools/subagents.md (index) 11,500 11-40 (intro) + 825-831 (Related) + anchor stubs
docs/tools/subagents/slash-command.md 10,043 42-151
docs/tools/subagents/tool-reference.md 19,394 152-401
docs/tools/subagents/thread-bound-sessions.md 6,075 402-500
docs/tools/subagents/nesting.md 5,136 501-590
docs/tools/subagents/announce.md 4,865 591-657
docs/tools/subagents/tool-policy.md 2,422 658-723
docs/tools/subagents/operations.md 6,360 724-824

Shape matches docs/tools/code-mode/ + docs/tools/code-mode.md, which is on main (verified with test -d, not from an open PR).

Anchors

Per-anchor redirects are impossible here: redirectSource() in scripts/lib/docs-redirects.mjs throws on any source containing [?#]. So every pre-split id is preserved as an authored <a id="…" /> stub on the index, under Where each section moved.

Ids were enumerated with the repo's own parseDocsDocument (scripts/lib/docs-markdown.mjs), not a slug approximation — that matters, because the three punctuated headings (## Tool: \sessions_spawn` and friends) each mint **two** ids (tool%3A-sessions_spawnandtool-sessions_spawn), and Accordion, Step, and ParamFieldtitles mint ids of their own (26param-*`, 5 step ids, 4 accordion ids).

pre-split ids: 75
parent ids   : 76
MISSING on parent: 0
parent collisions: []
child announce.md ids: 4 collisions: []
child nesting.md ids: 8 collisions: []
child operations.md ids: 4 collisions: []
child slash-command.md ids: 7 collisions: []
child thread-bound-sessions.md ids: 17 collisions: []
child tool-policy.md ids: 2 collisions: []
child tool-reference.md ids: 32 collisions: []
unresolved stub targets: 0

74 ids are stubbed; related is not, because the index still publishes ## Related itself and a stub would raise a duplicate authored/canonical id. The parent's 76th id is the new where-each-section-moved.

The six anchors that other pages actually deep-link (#slash-command, #tool-parameters, #thread-bound-sessions, #tool-sessions_yield, #liveness-and-recovery, #stopping, from concepts/session-tool.md, concepts/session.md, concepts/subagent-yield-handoff.md, releases/2026.9.2.md, tools/swarm.md, web/control-ui/chat.md) all resolve unchanged. A passing link audit is not evidence of this — the assertion above is.

Losslessness, proven

With the three declared link edits below reverted, the seven children concatenate to a byte-identical copy of the original body:

reverted-concat sha256: 488540a1673fffe23cafd6c62b3774333bf2b151e1ca9b470ade64537ba392f7
origin/main L42-824   : 488540a1673fffe23cafd6c62b3774333bf2b151e1ca9b470ade64537ba392f7
BYTE-IDENTICAL        : True

The index keeps the original intro (L11-40) and ## Related (L825-831) verbatim (asserted by substring match).

  • Fenced code blocks: 6 before, 6 after, matched one-for-one on info string + body sha256.
  • Table rows: 24 before, 33 after (+9 = the index's new page table, header and delimiter included).
  • Words: 7,142 before, 7,689 after (grew only).
  • Heading levels unchanged, so no id was re-slugged; every child opens at H2, which markdownlint MD001 accepts (same as the code-mode children).

The entire prose diff

Three cross-child references, each declared. Nothing else in the moved text changed.

  1. slash-command.md — was See [Thread supporting channels](#thread-supporting-channels) below. The target moved to a sibling page, so the relative anchor no longer resolved and "below" was no longer true. Now links to /tools/subagents/thread-bound-sessions#thread-supporting-channels, and "below" is dropped.
  2. tool-reference.md — was …direct thread replies use the completion paths above. Those paths are now on slash-command.md. Now …use the [completion paths](/tools/subagents/slash-command#spawn-behavior).
  3. nesting.md — See [Stopping](/tools/subagents#stopping) retargeted to /tools/subagents/operations#stopping (it resolved either way through the index stub; this removes the hop).

Plus two frontmatter lines on the index, since the page is now an index (the same change docs/tools/code-mode.md made): summary becomes "Index of the OpenClaw sub-agent documentation, one page per reader job", and a fourth read_when entry, "You are looking for the sub-agent page that matches your task", is appended. title and sidebarTitle are unchanged, and the three original read_when entries are kept verbatim. Child frontmatter is new by definition. No other line of prose differs anywhere.

python3 .audit/check-orphan-refs.py over the index and all seven children returns one candidate, tool-reference.md:35 "one of the profiles above", whose target (coding/messaging/minimal/full) is three lines up on the same page. A wider manual scan (above|below|earlier|preceding|following section) adds only nesting.md:70 and tool-policy.md:29 ("below depth 5", comparative, not a cross-reference) and thread-bound-sessions.md:59 (target on the same page).

Test pins

python3 .audit/docs-test-pins.py docs/tools/subagents.md reports "15 test(s) pin this page". Classified by reading each:

  • 12 qa/scenarios/**/*.yaml — list docs/tools/subagents.md in a docs: reference array. Path reference only, no content assertion. The parent file still exists, so all still resolve.
  • test/e2e/qa-lab/runtime/subagent-lineage-inspection.ts:990 — docsRefs: [… "docs/tools/subagents.md" …]. Same: a path, not an assertion on content.
  • taxonomy.yaml (L1580, L1752, L1930, L7835) — docs/tools/subagents.md in coverage lists. Not a test. No #anchor on any of the four, so nothing to re-resolve.
  • CHANGELOG.md — matches only the word "subagents" in release notes. Not a test, not a pin.

Independent git grep -n on origin/main with no path filter, for /tools/subagents, tools/subagents and the bare subagents.md, found the same set plus documentation links and src/agents/tools/subagents-tool.ts (unrelated source file). No contract test reads this file and asserts literal strings, so the sdk-subpaths.md refusal precedent does not apply.

Ownership

.github/CODEOWNERS has no catch-all rule and no /docs/tools/ rule. Simulating last-match-wins over the actual paths: docs/tools/subagents.md and every new child are unowned, as are their docs/tools/ siblings — so this is not an ownership gap, just how the file is written. Controls asserted first: docs/gateway/sandboxing.md → @openclaw/openclaw-secops (L55), docs/security/x.md → @openclaw/openclaw-secops (L52), docs/reference/RELEASING.md → @openclaw/openclaw-release-managers (L68). The page has an ## Authentication section, but subject does not imply ownership and no rule matches it.

.github/labeler.yml uses file-exact globs and does not match docs/tools/subagents*, before or after. No new directory needs labelling; nothing changed there.

Validators

Run on the staged tree, after git add, after the rebase onto 2cb7337e207. Every step of the CI Docs job (pnpm check:docs) enumerated and run:

format:docs:check          exit=0   (scripts/format-docs.mts --check, 1017 files clean)
lint:docs                  exit=0   (markdownlint-cli2 --config config/markdownlint-cli2.jsonc, 1016 files, 0 issues)
lint:templates             exit=0   (markdownlint-cli2 --config config/markdownlint-templates.jsonc)
docs:check-mdx             exit=0   (1030 files)
docs:check-i18n-glossary   exit=0
docs:check-links           exit=0   (checked_internal_links=10447, broken_links=0)
docs:check-config-examples exit=0

Beyond the CI job:

node scripts/docs-link-audit.mjs --anchors     exit=1, broken_links=42
npx vitest run --config test/vitest/vitest.tooling.config.ts src/scripts/docs-link-audit.test.ts src/docs/
                                               exit=1, 1 failed | 24 passed
npx vitest run --config test/vitest/vitest.full-core-unit-src.config.ts src/docs/
                                               exit=0, 8 files, 16 tests passed
python3 .audit/ste-lint.py --summary           70 hard before -> 69 hard after (did not increase)

Both failures are pre-existing, reproduced in a detached worktree at the base sha 2cb7337e207 with no changes applied:

  • --anchors reports the same 42 broken links at base and on the branch — diff of the two lists is empty. None mention subagents. 39 are /clawhub/* routes (the CI job checks out openclaw/clawhub into OPENCLAW_DOCS_SYNC_CLAWHUB_REPO; that source is not present locally) and 3 are the known maturity/#windows-app-node.
  • The vitest failure is docs-link-audit > preserves Mint component targets for raw component apostrophes (expected ['ass-guide','param-ass-guide'] to deeply equal ['as-s-guide','param-as-s-guide']), a unit assertion on the slugifier, identical at base.

docs/.i18n/glossary.zh-CN.json gained 8 entries (seven child titles plus the Swarm collectors link label the checker flagged). Resolved once against a concurrent split with python3 .audit/resolve-glossary.py; verified set-wise as a true superset of both conflict sides with 0 duplicate source values (838 + 822 -> 846 union).

Deliberately not fixed here

  • r3-0790 (runTimeoutSeconds): this page says the override "Applies to native, ACP, and visible sessions", while docs/tools/acp-agents/sessions.md:104-107 says ACP sessions_spawn rejects runTimeoutSeconds/timeoutSeconds. That needs a runtime check, not a documentation edit, and this PR is content-preserving. Both statements moved verbatim: the defaults bullet is now docs/tools/subagents/tool-reference.md:46 and the <ParamField> is docs/tools/subagents/tool-reference.md:115-117.
  • Section placement. ### Allowlist, ### Discovery and ### Auto-archive sit under ## Thread-bound sessions in the original although they are not thread-specific. Preserved as-is; re-homing them is a structure change for a later PR.
  • r3-0798, r3-0799, r3-0800, r3-0801, r3-2366, r3-2367, r3-2368, r3-2369 all propose rewrites, not moves, and stay open for the phase-3/4 PRs on this directory. Their line numbers now need re-targeting to the child pages.

@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: XS maintainer Maintainer-authored PR labels Sep 9, 2026
… pages

docs/tools/subagents.md was 54,144 characters mixing reference, how-to, and
explanation. Move each H2 block verbatim into docs/tools/subagents/ and keep
the parent as an orientation index.

Every pre-split anchor id (75 of them, including component ids minted by
Accordion, Step, and ParamField titles) is preserved as an authored stub on
the index, because redirect sources cannot carry a fragment.

Closes r3-0797.
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Rebased onto current main after #142958, #142961, #142963, #142980 and #142986 landed — head dd67f3eadef. Mechanical rebase: no page content changed. The only conflict was docs/.i18n/glossary.zh-CN.json, resolved as an order-preserving union read from the merge stages (838 base, 864 from main, 846 from the branch, 872 merged, 8 appended, 0 lost, 0 duplicate sources). docs.json auto-merged.

Re-validated at the new head: docs-link-audit broken_links=0, MDX check passes across 1,077 files.

@vincentkoc
vincentkoc force-pushed the docs-audit/split-tools-subagents branch from aa71692 to dd67f3e Compare September 9, 2026 09:24
@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 9, 2026
@clawsweeper

clawsweeper Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 9, 2026, 5:33 AM ET / 09:33 UTC.

ClawSweeper review

What this changes

Splits the Sub-agents documentation into an index and seven topic pages, retaining old section anchors and adding navigation and translation glossary entries.

Merge readiness

✅ Ready for maintainer review

Keep open: this is a useful, distinct documentation improvement that current main has not incorporated. The reviewed split preserves the original content and link destinations, with no blocking introduced defect found.

Priority: P3
Reviewed head: dd67f3eadef3b59e98eca62ccf93d8ee85b47af8

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused documentation split with clear preservation evidence and no identified blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: Real behavior proof is not required because this PR only changes files under docs/.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Real behavior proof is not required because this PR only changes files under docs/.
Evidence reviewed 8 items Pinned PR remains open: The live REST response confirms the PR is open and unmerged at the supplied head. The captured context identifies MEMBER authorship and the protected maintainer label.
Independent content-preservation check: Read all seven children and the index. An independent in-memory reconstruction against the pinned base found exactly the three declared cross-page reference edits; the original introduction and Related section remain intact. Glossary comparison confirmed eight appended entries, no changed prior entries, and no duplicate source keys.
Backward-compatible documentation routes: The index retains authored anchors linking to the moved sections. Existing inbound links from session concepts, Swarm, and Control UI documentation still target anchors present on the index. The shared parser recognizes authored IDs and component aliases; redirectSource rejects fragment-bearing redirect sources, supporting the chosen stub approach.
Findings None None.
Security None None.

How this fits together

The Sub-agents documentation explains how operators and agents delegate work, inspect child runs, and handle completion or recovery. The documentation index and navigation direct readers to the relevant operating guidance.

flowchart LR
  A[Documentation navigation] --> C[Sub-agents index]
  B[Existing section bookmarks] --> C
  C --> D[Seven topic pages]
  D --> E[Commands and operating guidance]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Docs +193. Total +193 across 10 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 10 976 783 +193
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 10 976 783 +193

Review metrics

None.

Technical review

Best possible solution:

Keep the task-oriented documentation split with stable legacy anchors and one canonical home for each moved section.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this is a documentation reorganization, and the original dense page and introduced split are directly inspectable.

Is this the best way to solve the issue?

Yes: moving contiguous sections while preserving anchors follows the existing documentation pattern and avoids duplicating operating guidance.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 96006252820e.

Labels

Label changes:

  • add P3: This improves documentation navigation while preserving existing operating guidance and runtime behavior.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Real behavior proof is not required because this PR only changes files under docs/.

Label justifications:

  • P3: This improves documentation navigation while preserving existing operating guidance and runtime behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Real behavior proof is not required because this PR only changes files under docs/.

Evidence

What I checked:

  • Pinned PR remains open: The live REST response confirms the PR is open and unmerged at the supplied head. The captured context identifies MEMBER authorship and the protected maintainer label. (dd67f3eadef3)
  • Independent content-preservation check: Read all seven children and the index. An independent in-memory reconstruction against the pinned base found exactly the three declared cross-page reference edits; the original introduction and Related section remain intact. Glossary comparison confirmed eight appended entries, no changed prior entries, and no duplicate source keys. Public docs: docs/tools/subagents.md. (docs/tools/subagents.md:42, dd67f3eadef3)
  • Backward-compatible documentation routes: The index retains authored anchors linking to the moved sections. Existing inbound links from session concepts, Swarm, and Control UI documentation still target anchors present on the index. The shared parser recognizes authored IDs and component aliases; redirectSource rejects fragment-bearing redirect sources, supporting the chosen stub approach. Public docs: docs/tools/subagents.md. (docs/tools/subagents.md:55, dd67f3eadef3)
  • Current-main and release necessity check: The fetched main revision retains the original single-page documentation and has no subagents child directory. The latest supplied release, v2026.9.3, likewise contains the parent page without these children. No supplied merged PR implements this specific split. Public docs: docs/tools/subagents.md. (docs/tools/subagents.md:42, 96006252820e)
  • Related work supports the existing pattern: The merged ACP documentation split at docs(tools): split the ACP agents page by reader job #142958 establishes adjacent documentation work by the same contributor, rather than a replacement for this PR. The other supplied merged splits concern policy, plugins, Telegram, and Microsoft Teams. Public docs: docs/tools/acp-agents.md. (docs/tools/acp-agents.md, 0b52342cec3e)
  • Validation and scope: git diff --check passed for the pinned introduced delta, and independent JSON parsing succeeded. The captured body supplies preservation and documentation-validation results; the subsequent contributor comment reports clean link and MDX checks after the rebase. Repository validators and browser rendering were not executed during this read-only review. Public docs: docs/docs.json. (docs/docs.json:1980, dd67f3eadef3)

Likely related people:

  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@vincentkoc
vincentkoc merged commit 309ae03 into main Sep 9, 2026
19 checks passed
@vincentkoc
vincentkoc deleted the docs-audit/split-tools-subagents branch September 9, 2026 09:41
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 10, 2026
… pages (openclaw#142999)

docs/tools/subagents.md was 54,144 characters mixing reference, how-to, and
explanation. Move each H2 block verbatim into docs/tools/subagents/ and keep
the parent as an orientation index.

Every pre-split anchor id (75 of them, including component ids minted by
Accordion, Step, and ParamField titles) is preserved as an authored stub on
the index, because redirect sources cannot carry a fragment.

Closes r3-0797.

Co-authored-by: Vincent Koc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant