Skip to content

docs(channels): split the Microsoft Teams page by reader job - #142986

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

vincentkoc merged 1 commit into
mainfrom
docs-audit/split-msteams

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What changed

docs/channels/msteams.md was 56,760 characters, 1,125 lines, 31 H2 + 31 H3 headings, mixing tutorial, how-to, reference, explanation and troubleshooting on one page. It is now an index plus eight children under docs/channels/msteams/, matching the shape of docs/channels/slack/ and docs/channels/discord/ (both on main; verified with test -d, not from an open PR).

Page Bytes Sections
channels/msteams (index) 14,313 intro, page map, anchor map, related
channels/msteams/setup 8,436 Bundled plugin, Quick setup, Goals, Manual setup, Local development, Testing the bot
channels/msteams/access-control 6,125 Config writes, Access control (DMs + groups), Team and Channel IDs, Private channels
channels/msteams/authentication 4,746 Federated authentication (certificate plus managed identity)
channels/msteams/manifest-and-permissions 7,436 RSC permissions, Example manifest, Capabilities: RSC vs Graph, Graph-enabled media + history
channels/msteams/configuration 8,084 Environment variables, History context, Configuration
channels/msteams/messaging 9,596 Routing and sessions, Reply style, Attachments and images, Sending files in group chats
channels/msteams/cards-and-actions 6,881 Member info action, Native approval cards, Polls, Presentation cards, Target formats, Proactive messaging
channels/msteams/troubleshooting 8,878 Known limitations, Troubleshooting, References, Related

Losslessness, proven

Every child, with its frontmatter and one-line lede removed and the declared edits below reversed, reassembles in original section order into a byte-identical copy of the original page body:

original body sha256: ffa99dd878b6047a6035a1d11dcb269859c88d48730e64673f1878dd5577b449  (56,411 bytes)
rebuilt  body sha256: ffa99dd878b6047a6035a1d11dcb269859c88d48730e64673f1878dd5577b449  (56,411 bytes)
fences: 32 original, 32 new, one-for-one on info string + body sha256
table rows: 70 original, 70 new
words: 6,587 -> 7,999 (grew only; the anchor map and the ledes)

No heading text, heading level, code fence, table row or sentence was rewritten or reordered within a section. One contiguous block moved between children: the collapsed Manual setup (without the Teams CLI) <details> block, which sat under ## Access control (DMs + groups) in the original, now lives on the setup page. That is the IA defect the split exists to fix; the block's bytes are unchanged.

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 on the index instead.

Ids were enumerated with the repository's own parseDocsDocument (scripts/lib/docs-markdown.mjs), not a slug approximation, which matters because punctuated headings here emit both a percent-encoded id and a cleaned alias (access-control-(dms-%2B-groups) and access-control-dms-+-groups, and 21 more pairs).

  • 85 pre-split ids, 0 collisions.
  • 84 are carried as authored <a id="…" /> stubs under Where each section moved, each linking to the page that now holds the content.
  • 1 (#related) is not stubbed because the index publishes that heading itself; stubbing it would raise a duplicate authored/canonical id.
  • Asserted after the split: all 85 original ids resolve on the new index, collisions is empty on the index and on every one of the eight children, and each id is owned by exactly one child.

Prose diff

The link audit cannot see a directional cross-reference, so .audit/check-orphan-refs.py was run over all nine pages. It reported 7 candidates; 5 point at targets that are still on the same page. The 2 genuinely orphaned ones are the entire prose diff:

  1. setup.md — "referencing the bot, including the RSC permissions below" — the RSC permissions section is now on manifest-and-permissions. Now links there.
  2. troubleshooting.md — "semantic presentation sends (see below)" — approvals, polls and presentation cards are now on cards-and-actions. Now links there.

Six same-page ](#…) links whose targets landed on a different child were retargeted (no text change): 2 to messaging#sending-files-in-group-chats, 1 to authentication#federated-authentication-certificate-plus-managed-identity, 1 to manifest-and-permissions#current-teams-rsc-permissions-manifest, 1 to messaging#reply-style-threads-vs-posts, and the page's absolute self-link to manifest-and-permissions#channel%2Fgroup-file-recovery-graphmediafallback.

Pins and inbound references

.audit/docs-test-pins.py reported 8 hits; an independent git grep -n "channels/msteams" origin/main with no path filter reported 34. Every one classified:

  • Updated: docs/docs.json navigation (index + 8 children, mirroring the Slack and Discord groups); .github/labeler.yml (added docs/channels/msteams/** to the channel: msteams label, matching what the Slack and Discord splits did); docs/.i18n/glossary.zh-CN.json (10 new source terms for the new titles and two link labels the checker now sees).
  • No change needed, route still resolves: 6 taxonomy.yaml docs: entries (all plain paths, no #anchor; maturity:check passes, and the Slack split left its equivalents alone), docs/maturity/taxonomy.md (6), docs/channels/index.md, docs/concepts/progress-drafts.md, docs/gateway/configuration.md, docs/gateway/config-channels/workplace-chat.md (2), docs/plugins/* (3), docs/releases/2026.8.1/messaging.md, docs/docs.json redirect destination, extensions/msteams/** docsPath (3), scripts/lib/official-external-channel-catalog.json, src/gateway/server.agent.gateway-server-agent-b.test.ts, scripts/docs-i18n/taxonomy_source_test.go, qa/scenarios/channels/msteams-thread-message-tool-final-dedupe.yaml (docsRefs), docs/.i18n/zh-Hans-navigation.json (bare zh-CN/channels/msteams; the Slack split added no children there either, and no docs/zh-CN/channels/slack/ mirror exists).
  • Not a docs reference: extensions/policy/src/doctor/register.models-and-mcp.test-utils.ts (oc://openclaw.config/channels/msteams/... is a config path).

Only one anchored inbound link existed tree-wide (git grep -n "msteams#" origin/main) and it was the page's own self-link, retargeted above. No contract test reads this file and asserts literal strings, so there is no reason to refuse the split.

CODEOWNERS

Simulated last-match-wins over .github/CODEOWNERS for every touched path. No rule matches docs/channels/msteams*, docs/docs.json, docs/.i18n/**, or .github/labeler.yml. Controls: /docs/gateway/security/ and /.github/CODEOWNERS do match their own paths, so the simulation is working. No maintainer team owns this change.

Validators

Every step of check:docs (package.json), run on the staged tree after the rebase onto 0b52342:

node --import ./scripts/tsx.mjs scripts/format-docs.mts --check     exit 0   (1018 files clean)
npx markdownlint-cli2 --config config/markdownlint-cli2.jsonc       exit 0   (1017 files, 0 issues)
npx markdownlint-cli2 --config config/markdownlint-templates.jsonc  exit 0
node scripts/check-docs-mdx.mjs docs README.md                      exit 0   (1031 files)
node --import ./scripts/tsx.mjs scripts/check-docs-i18n-glossary.mts exit 0
node scripts/docs-link-audit.mjs                                    exit 0   (10,476 links, 0 broken)
node scripts/check-docs-config-examples.mjs                         exit 0

Also run:

node scripts/docs-link-audit.mjs --anchors    42 errors, byte-identical to the same run at 0b52342 (all /clawhub and maturity routes; none msteams)
node --import ./scripts/tsx.mjs scripts/qa/render-maturity-docs.ts --check    exit 0  (validateTaxonomyDocsReferences passes)
npx vitest run --config test/vitest/vitest.tooling.config.ts test/scripts/docs-source-anchors.test.ts    2 passed
npx vitest run --config test/vitest/vitest.tooling.config.ts src/scripts/docs-link-audit.test.ts src/docs/    24 passed, 1 failed

That one vitest failure is preserves Mint component targets for raw component apostrophes…, a slug-normalization case unrelated to this change. Reproduced identically in a detached worktree at 0b52342, so it is pre-existing.

.audit/ste-lint.py over all nine pages: 53 hard violations against 54 on the original single page. Hard violations did not increase.

Ledger findings

Closed by this PR:

  • blocking / split — the page mixed five content types across 31 H2 sections. Now one index and eight children, each a single reader job.
  • major / ia — 62 headings, and the manual-setup H3 steps sat under the Access control H2. Largest child now has 13 headings; the manual-setup block moved to the setup page.
  • major / ux (partial) — "manual setup hidden under Access control" is fixed. The rest of that finding asks to reorder the funnel and move ## Goals to the top; that is a reordering this content-preserving split deliberately does not do.

Deferred, with reasons — each needs a prose rewrite, which this PR excludes by design so the byte-identical proof above stays checkable:

  • minor / ux — the opening line is a capability status line, not a statement of purpose.
  • minor / accuracy — "today", "yet", "until … ships" with no version scope (6 sites).
  • minor / ux — tunnel commands, teams app doctor, and the env-var list each appear more than once.
  • minor / ux — config-writes and history-limit rules are restated on both the Teams and Telegram pages with drift.
  • major / ux — Quick setup never tells the reader to start the gateway. This one is a content addition, not a move.

Not auto-merged, per instruction.

`docs/channels/msteams.md` was 56,760 characters with 31 H2 and 31 H3
headings, mixing tutorial, how-to, reference, explanation, and
troubleshooting content on one page.

Split it into an index plus eight child pages under
`docs/channels/msteams/`. The move is content-preserving: the children,
with their ledes removed, reassemble byte-for-byte into the original
page body (sha256 ffa99dd878b6047a6035a1d11dcb269859c88d48730e64673f1878dd5577b449).

All 85 pre-split anchor ids still resolve on the index, 84 as authored
`<a id="..." />` stubs and `#related` because the index publishes that
heading itself.
@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 channel: msteams Channel integration: msteams size: XS maintainer Maintainer-authored PR labels Sep 9, 2026
@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:00 AM ET / 09:00 UTC.

ClawSweeper review

What this changes

Reorganizes Microsoft Teams documentation into an overview and eight task-focused pages, preserving old section links and updating navigation, translations, and labeling.

Merge readiness

✅ Ready for maintainer review

This remains useful documentation work absent from the pinned current main. No introduced correctness or security defect was found; the member-authored PR also carries the protected maintainer label.

Priority: P3
Reviewed head: 3687b488c1b51e4246fe04998e6f8a8205c32603

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused documentation split with detailed preservation evidence and no identified blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored documentation and label-glob change has no runtime proof gate; the supplied preservation and documentation-validator results cover its stated scope.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored documentation and label-glob change has no runtime proof gate; the supplied preservation and documentation-validator results cover its stated scope.
Evidence reviewed 8 items Complete documentation inspection: Read the overview and all eight child pages. Existing commands, permission warnings, configuration descriptions, and troubleshooting content remain present; cross-page references now point to their owning guides.
Legacy section compatibility: The overview contains 84 explicit anchor stubs plus its retained Related heading. The publishing parser reserves authored IDs and preserves distinct heading aliases, supporting this compatibility approach.
Navigation and automation scope: The introduced ancillary changes add the eight guides to navigation, supply glossary terms, and extend the existing Teams label glob. They introduce no executable workflow, dependency, permission, or runtime configuration change.
Findings None None.
Security None None.

How this fits together

The Teams documentation guides operators through connecting the plugin, configuring access, and troubleshooting messages. The documentation navigation and existing section links now direct readers to focused guides.

flowchart TD
  A[Documentation navigation] --> B[Teams overview]
  C[Existing section links] --> D[Preserved anchor map]
  B --> E[Task-focused guides]
  D --> E
  E --> F[Setup and configuration guidance]
  E --> G[Messaging and troubleshooting guidance]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Docs +275, Config +1. Total +276 across 12 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 11 1390 1115 +275
Config 1 1 0 +1
Generated 0 0 0 0
Other 0 0 0 0
Total 12 1391 1115 +276

Review metrics

Metric Value Why it matters
Legacy section navigation 84 explicit anchor stubs plus the retained Related heading Existing section links retain a route to the moved content.

Technical review

Best possible solution:

Keep the focused guides and legacy anchor map as the canonical Teams documentation, with broader prose improvements handled separately.

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

Not applicable: this PR reorganizes existing documentation rather than fixing a runtime defect.

Is this the best way to solve the issue?

Yes. Focused pages follow the existing Slack and Discord pattern, while explicit anchor mappings preserve access from older links.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 113e8cf6b934.

Labels

Label changes:

  • add P3: This is documentation organization and navigation work without a runtime behavior change.
  • 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: This MEMBER-authored documentation and label-glob change has no runtime proof gate; the supplied preservation and documentation-validator results cover its stated scope.

Label justifications:

  • P3: This is documentation organization and navigation work without a runtime behavior change.
  • 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: This MEMBER-authored documentation and label-glob change has no runtime proof gate; the supplied preservation and documentation-validator results cover its stated scope.

Evidence

What I checked:

  • Complete documentation inspection: Read the overview and all eight child pages. Existing commands, permission warnings, configuration descriptions, and troubleshooting content remain present; cross-page references now point to their owning guides. Public docs: docs/channels/msteams.md. (docs/channels/msteams.md:22, 3687b488c1b5)
  • Legacy section compatibility: The overview contains 84 explicit anchor stubs plus its retained Related heading. The publishing parser reserves authored IDs and preserves distinct heading aliases, supporting this compatibility approach. (scripts/lib/docs-markdown.mjs:576, 3687b488c1b5)
  • Navigation and automation scope: The introduced ancillary changes add the eight guides to navigation, supply glossary terms, and extend the existing Teams label glob. They introduce no executable workflow, dependency, permission, or runtime configuration change. (.github/labeler.yml:164, 3687b488c1b5)
  • Current-main necessity: The Teams page and navigation are unchanged between the pinned merge base and fetched main; the proposed split therefore remains distinct work. Public docs: docs/channels/msteams.md. (docs/channels/msteams.md, 113e8cf6b934)
  • Latest-release check: The supplied latest-release commit has no docs/channels/msteams child directory; this documentation split is not present there. Public docs: docs/channels/msteams.md. (docs/channels/msteams.md, 1391f7cd2d40)
  • Validation and discussion: The complete supplied PR body reports preservation checks and passing documentation validators, with an anchor baseline and one unrelated test failure reproduced at the base. Independently, git diff --check passed. No repository scripts or tests were executed during this read-only review. (3687b488c1b5)

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 70ce06a into main Sep 9, 2026
127 checks passed
@vincentkoc
vincentkoc deleted the docs-audit/split-msteams branch September 9, 2026 09:20
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 10, 2026
…w#142986)

`docs/channels/msteams.md` was 56,760 characters with 31 H2 and 31 H3
headings, mixing tutorial, how-to, reference, explanation, and
troubleshooting content on one page.

Split it into an index plus eight child pages under
`docs/channels/msteams/`. The move is content-preserving: the children,
with their ledes removed, reassemble byte-for-byte into the original
page body (sha256 ffa99dd878b6047a6035a1d11dcb269859c88d48730e64673f1878dd5577b449).

All 85 pre-split anchor ids still resolve on the index, 84 as authored
`<a id="..." />` stubs and `#related` because the index publishes that
heading itself.
obviyus added a commit that referenced this pull request Sep 12, 2026
## What Problem This Solves

Telegram users could not request persistent delegation through the model-visible sessions_spawn tool. With conversation bindings enabled, its schema omitted thread and limited mode to run, despite the documented support for binding the current conversation.

Related: #42986. Reworks the discovery fix in #145543 with credit to @nimarosa and @JackpotHan. The dispatch also referenced #142986, which concerns a separate documentation change and is not closed here.

## Why This Change Was Made

Explicit spawn discovery now reads the channel's declared placement and current-conversation binding support through one shared owner. Tool registration and runtime prompt capabilities consume that result. The existing child-only automatic placement check remains in the ACP command path, so /acp spawn keeps its existing default and explicit binding controls.

The tool description now explains that binding can use the current conversation or a new thread. There are no config keys, persistence changes, migrations, or protocol changes.

## User Impact

When Telegram binding and spawn policy permit it, the model sees thread and both run and session modes. Persistent spawns can use the current conversation, and subsequent messages reach the bound child. Disabled spawn policy still hides those options. Discord keeps its existing binding options.

## Evidence

Baseline: dda6470.
Runtime proof commit: b5c5988. The following commit only refreshes generated tool/prompt fixtures and their expected override list; production code and runtime proof inputs are unchanged.

- Real Gateway HTTP ingress: POST /v1/chat/completions with the documented x-openclaw-message-channel: telegram header. Complete outbound provider requests were captured with Telegram loaded. Baseline: thread absent, mode.enum=["run"]. Candidate: boolean thread, mode.enum=["run","session"].
- A Discord request retained its existing thread and run/session options. After reloading disabled spawn policy, a new Telegram request again exposed only run and omitted thread.
- Real Telegram Test Server user flow: a local deterministic provider requested sessions_spawn(thread=true, mode=session). The tool returned accepted; the child replied in the conversation. A second user message 12 seconds later reached the persistent child with its earlier task and reply context and received a visible reply. Four complete provider requests and the Telegram event timeline were retained. This proves routing and execution with controlled provider output, not autonomous model decision quality.
- A source-blind validator independently repeated the real Telegram flow and passed every contract clause. Its runner reported a process-stop error after recording; process/port checks and supported lease recovery completed cleanup.
- An earlier live setup attempt timed out resolving the bot username before sending any message. Its empty provider capture and failure were retained. Numeric chat selection resolved setup; the successful run confirmed resource cleanup.
- Registered-tool regression failed on the baseline for the missing session mode. Final registration/schema suites passed 144 tests; unchanged ACP helper tests passed 3 tests, and Telegram ACP command siblings passed 2 tests. Formatting, scoped lint, line-limit and assertion checks passed. Full type checks remain with CI.

## Consumers

- conversation-resolution.ts owns explicit spawn capability discovery. sessions-spawn-tool.ts and runtime-capabilities.ts are its only consumers.
- src/agents/agent-tools.ts:867 calls createOpenClawTools; src/agents/openclaw-tools.ts:574 registers createSessionsSpawnTool and passes the channel/config context.
- src/gateway/worker-environments/worker-session-tool-executor.ts:437-457 is an unchanged visible worktree-spawn caller. It passes neither channel nor config, so it does not exercise the newly exposed Telegram schema.
- runtime-prompt.ts, cli-runner/prepare.ts, and embedded-agent-runner/prepared-compaction-runtime.ts consume runtime capabilities. The terminal reader src/agents/system-prompt.ts:1034 reads threadbound-acp-spawn, lines 1433-1441 select the existing ACP guidance, and line 1600 renders capabilities. Tool descriptions and context descriptions derive from the schema owner's availability decision.
- The execution and follow-up owners remain unchanged: src/agents/spawn-plan.ts:168-214 rechecks policy and adapter support; src/agents/subagents/spawn/subagent-spawn.ts:230-257 awaits binding; src/agents/subagents/spawn/subagent-spawn-thread-binding.ts:58-105 awaits the binding service and records delivery origin. extensions/telegram/src/conversation-route.ts:164-176 applies the stored route, and extensions/telegram/src/bot-message-context.ts:248-258 consumes it for the later user turn. The fourth live provider request shows the same child task, prior reply, and follow-up at this terminal consumer.
- Personally inspected the exact sibling source read-only: openai/codex revision 53ff712a48379ce8df605e292afd6046ca88ae9b (git rev-parse HEAD; clean checkout at the supplied revision). At that revision, codex-rs/app-server-protocol/src/protocol/v2/thread.rs:138-144 accepts dynamicTools; codex-rs/protocol/src/dynamic_tools.rs:10-26 defines the function descriptor with camelCase inputSchema. codex-rs/core/src/tools/spec_plan.rs:1374-1399 registers dynamic handlers; codex-rs/core/src/tools/handlers/dynamic.rs:50-91 converts and exposes their function specs. codex-rs/tools/src/dynamic_tool.rs:5-14 parses input_schema through codex-rs/tools/src/json_schema.rs:25-53. codex-rs/tools/src/json_schema/types.rs:17-24,37-56 supports boolean, enum, properties, and required. codex-rs/tools/src/responses_api.rs:82-87,157-164 maps the parsed schema into function parameters with strict=false. This supports the existing optional thread boolean and mode enum contract; no sibling code or runtime test was changed. The source inspection is separate from the retained 17 passing snapshot tests.
- The provider request is the final schema consumer; HTTP and Telegram captures inspect that boundary. There is no second schema or client-side workaround.
- Generated prompt/tool fixtures consume the registered schema. Regeneration adds the Telegram fields, removes the now-identical Discord tool override, and updates prompt size/hash metadata. The snapshot test retains complete effective catalog comparisons.
- Gateway tools.catalog / tools.effective, Control UI agent tooling and chat tool views, and native composer capability views consume tool metadata; they do not own an alternative spawn schema.
- commands-acp/shared.ts remains on supportsAutomaticThreadBindingSpawn; its policy helper and tests are unchanged. No public symbols or options are removed.
- docs/tools/subagents/thread-bound-sessions.md already promises this behavior. ACP binding documentation retains the explicit current-conversation binding contract.

The lexical census sees 29 property names removed from the Discord override file. These are fixture-local deduplication, not removed API fields. Every field remains in the complete Telegram base schema. The two code consumers for all 29 fields are scripts/generate-prompt-snapshots.ts:293 (materializes the inherited complete schema) and test/scripts/prompt-snapshots.test.ts:112 (compares the complete effective catalog). The fixture producer test/helpers/agents/happy-path-prompt-snapshots.ts:645 and fixture README retain their existing paths. Other matches for generic names such as name, model, and content do not consume this fixture.

census: generic agentId reviewed — 2 callers listed
census: generic attachAs reviewed — 2 callers listed
census: generic attachments reviewed — 2 callers listed
census: generic cleanup reviewed — 2 callers listed
census: generic content reviewed — 2 callers listed
census: generic context reviewed — 2 callers listed
census: generic cwd reviewed — 2 callers listed
census: generic encoding reviewed — 2 callers listed
census: generic expectsCompletionMessage reviewed — 2 callers listed
census: generic fastMode reviewed — 2 callers listed
census: generic group reviewed — 2 callers listed
census: generic label reviewed — 2 callers listed
census: generic lightContext reviewed — 2 callers listed
census: generic mimeType reviewed — 2 callers listed
census: generic mode reviewed — 2 callers listed
census: generic model reviewed — 2 callers listed
census: generic mountPath reviewed — 2 callers listed
census: generic name reviewed — 2 callers listed
census: generic runTimeoutSeconds reviewed — 2 callers listed
census: generic runtime reviewed — 2 callers listed
census: generic sandbox reviewed — 2 callers listed
census: generic task reviewed — 2 callers listed
census: generic taskName reviewed — 2 callers listed
census: generic thinking reviewed — 2 callers listed
census: generic thread reviewed — 2 callers listed
census: generic visible reviewed — 2 callers listed
census: generic worktree reviewed — 2 callers listed
census: generic worktreeBaseRef reviewed — 2 callers listed
census: generic worktreeName reviewed — 2 callers listed

## Invalidation

Tool construction derives availability from the active loaded channel registry and current config. No cache is added. Existing run-scoped tool and prompt lifetimes remain stable; new runs after config reload or restart rebuild their schema. The HTTP disabled-policy reload and the registration policy table verify this transition. The existing MCP config/grant/context cache lifecycle is unchanged.

## Contention

None held. The change adds no locks, queues, transactions, network work, or persistence side effects.

## Tests

openclaw-tools.thread-binding.test.ts calls the registered createOpenClawTools entry point and checks current placement with support, current placement without support, disabled spawn policy, and child placement. It checks runtime capability parity in the same cases. The baseline fails only the supported-current-placement case.

The rewritten test is test/scripts/prompt-snapshots.test.ts:83-114, reconstructs complete Codex tool catalogs from readable full-tool overrides. Its registered path is createHappyPathPromptSnapshotFiles -> scenario construction at test/helpers/agents/happy-path-prompt-snapshots.ts:454 -> createOpenClawCodingTools -> createOpenClawTools at src/agents/agent-tools.ts:867 -> createSessionsSpawnTool at src/agents/openclaw-tools.ts:574. Normalization and descriptor generation occur at test/helpers/agents/happy-path-prompt-snapshots.ts:491-510. The complete materialized-versus-generated catalog assertion remains at test/scripts/prompt-snapshots.test.ts:112-113.

Validation used the targeted registration and sessions-spawn-tool suites, ACP shared helpers, and the two Telegram ACP spawn command cases. No tests were deleted. The existing snapshot test now expects no Discord override because its complete spawn schema matches Telegram; its full reconstructed catalog assertion remains. Five generated fixture files were refreshed with the owned generator, and prompt:snapshots:check passes. All 17 prompt snapshot tests pass. No test-only production seam or side effect was introduced. This is a core discovery repair; plugin packages, updater behavior, and stored state are unchanged.

Co-authored-by: JackpotHan <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 13, 2026
## What Problem This Solves

Telegram users could not request persistent delegation through the model-visible sessions_spawn tool. With conversation bindings enabled, its schema omitted thread and limited mode to run, despite the documented support for binding the current conversation.

Related: openclaw#42986. Reworks the discovery fix in openclaw#145543 with credit to @nimarosa and @JackpotHan. The dispatch also referenced openclaw#142986, which concerns a separate documentation change and is not closed here.

## Why This Change Was Made

Explicit spawn discovery now reads the channel's declared placement and current-conversation binding support through one shared owner. Tool registration and runtime prompt capabilities consume that result. The existing child-only automatic placement check remains in the ACP command path, so /acp spawn keeps its existing default and explicit binding controls.

The tool description now explains that binding can use the current conversation or a new thread. There are no config keys, persistence changes, migrations, or protocol changes.

## User Impact

When Telegram binding and spawn policy permit it, the model sees thread and both run and session modes. Persistent spawns can use the current conversation, and subsequent messages reach the bound child. Disabled spawn policy still hides those options. Discord keeps its existing binding options.

## Evidence

Baseline: 4205aca.
Runtime proof commit: b5c5988. The following commit only refreshes generated tool/prompt fixtures and their expected override list; production code and runtime proof inputs are unchanged.

- Real Gateway HTTP ingress: POST /v1/chat/completions with the documented x-openclaw-message-channel: telegram header. Complete outbound provider requests were captured with Telegram loaded. Baseline: thread absent, mode.enum=["run"]. Candidate: boolean thread, mode.enum=["run","session"].
- A Discord request retained its existing thread and run/session options. After reloading disabled spawn policy, a new Telegram request again exposed only run and omitted thread.
- Real Telegram Test Server user flow: a local deterministic provider requested sessions_spawn(thread=true, mode=session). The tool returned accepted; the child replied in the conversation. A second user message 12 seconds later reached the persistent child with its earlier task and reply context and received a visible reply. Four complete provider requests and the Telegram event timeline were retained. This proves routing and execution with controlled provider output, not autonomous model decision quality.
- A source-blind validator independently repeated the real Telegram flow and passed every contract clause. Its runner reported a process-stop error after recording; process/port checks and supported lease recovery completed cleanup.
- An earlier live setup attempt timed out resolving the bot username before sending any message. Its empty provider capture and failure were retained. Numeric chat selection resolved setup; the successful run confirmed resource cleanup.
- Registered-tool regression failed on the baseline for the missing session mode. Final registration/schema suites passed 144 tests; unchanged ACP helper tests passed 3 tests, and Telegram ACP command siblings passed 2 tests. Formatting, scoped lint, line-limit and assertion checks passed. Full type checks remain with CI.

## Consumers

- conversation-resolution.ts owns explicit spawn capability discovery. sessions-spawn-tool.ts and runtime-capabilities.ts are its only consumers.
- src/agents/agent-tools.ts:867 calls createOpenClawTools; src/agents/openclaw-tools.ts:574 registers createSessionsSpawnTool and passes the channel/config context.
- src/gateway/worker-environments/worker-session-tool-executor.ts:437-457 is an unchanged visible worktree-spawn caller. It passes neither channel nor config, so it does not exercise the newly exposed Telegram schema.
- runtime-prompt.ts, cli-runner/prepare.ts, and embedded-agent-runner/prepared-compaction-runtime.ts consume runtime capabilities. The terminal reader src/agents/system-prompt.ts:1034 reads threadbound-acp-spawn, lines 1433-1441 select the existing ACP guidance, and line 1600 renders capabilities. Tool descriptions and context descriptions derive from the schema owner's availability decision.
- The execution and follow-up owners remain unchanged: src/agents/spawn-plan.ts:168-214 rechecks policy and adapter support; src/agents/subagents/spawn/subagent-spawn.ts:230-257 awaits binding; src/agents/subagents/spawn/subagent-spawn-thread-binding.ts:58-105 awaits the binding service and records delivery origin. extensions/telegram/src/conversation-route.ts:164-176 applies the stored route, and extensions/telegram/src/bot-message-context.ts:248-258 consumes it for the later user turn. The fourth live provider request shows the same child task, prior reply, and follow-up at this terminal consumer.
- Personally inspected the exact sibling source read-only: openai/codex revision 53ff712a48379ce8df605e292afd6046ca88ae9b (git rev-parse HEAD; clean checkout at the supplied revision). At that revision, codex-rs/app-server-protocol/src/protocol/v2/thread.rs:138-144 accepts dynamicTools; codex-rs/protocol/src/dynamic_tools.rs:10-26 defines the function descriptor with camelCase inputSchema. codex-rs/core/src/tools/spec_plan.rs:1374-1399 registers dynamic handlers; codex-rs/core/src/tools/handlers/dynamic.rs:50-91 converts and exposes their function specs. codex-rs/tools/src/dynamic_tool.rs:5-14 parses input_schema through codex-rs/tools/src/json_schema.rs:25-53. codex-rs/tools/src/json_schema/types.rs:17-24,37-56 supports boolean, enum, properties, and required. codex-rs/tools/src/responses_api.rs:82-87,157-164 maps the parsed schema into function parameters with strict=false. This supports the existing optional thread boolean and mode enum contract; no sibling code or runtime test was changed. The source inspection is separate from the retained 17 passing snapshot tests.
- The provider request is the final schema consumer; HTTP and Telegram captures inspect that boundary. There is no second schema or client-side workaround.
- Generated prompt/tool fixtures consume the registered schema. Regeneration adds the Telegram fields, removes the now-identical Discord tool override, and updates prompt size/hash metadata. The snapshot test retains complete effective catalog comparisons.
- Gateway tools.catalog / tools.effective, Control UI agent tooling and chat tool views, and native composer capability views consume tool metadata; they do not own an alternative spawn schema.
- commands-acp/shared.ts remains on supportsAutomaticThreadBindingSpawn; its policy helper and tests are unchanged. No public symbols or options are removed.
- docs/tools/subagents/thread-bound-sessions.md already promises this behavior. ACP binding documentation retains the explicit current-conversation binding contract.

The lexical census sees 29 property names removed from the Discord override file. These are fixture-local deduplication, not removed API fields. Every field remains in the complete Telegram base schema. The two code consumers for all 29 fields are scripts/generate-prompt-snapshots.ts:293 (materializes the inherited complete schema) and test/scripts/prompt-snapshots.test.ts:112 (compares the complete effective catalog). The fixture producer test/helpers/agents/happy-path-prompt-snapshots.ts:645 and fixture README retain their existing paths. Other matches for generic names such as name, model, and content do not consume this fixture.

census: generic agentId reviewed — 2 callers listed
census: generic attachAs reviewed — 2 callers listed
census: generic attachments reviewed — 2 callers listed
census: generic cleanup reviewed — 2 callers listed
census: generic content reviewed — 2 callers listed
census: generic context reviewed — 2 callers listed
census: generic cwd reviewed — 2 callers listed
census: generic encoding reviewed — 2 callers listed
census: generic expectsCompletionMessage reviewed — 2 callers listed
census: generic fastMode reviewed — 2 callers listed
census: generic group reviewed — 2 callers listed
census: generic label reviewed — 2 callers listed
census: generic lightContext reviewed — 2 callers listed
census: generic mimeType reviewed — 2 callers listed
census: generic mode reviewed — 2 callers listed
census: generic model reviewed — 2 callers listed
census: generic mountPath reviewed — 2 callers listed
census: generic name reviewed — 2 callers listed
census: generic runTimeoutSeconds reviewed — 2 callers listed
census: generic runtime reviewed — 2 callers listed
census: generic sandbox reviewed — 2 callers listed
census: generic task reviewed — 2 callers listed
census: generic taskName reviewed — 2 callers listed
census: generic thinking reviewed — 2 callers listed
census: generic thread reviewed — 2 callers listed
census: generic visible reviewed — 2 callers listed
census: generic worktree reviewed — 2 callers listed
census: generic worktreeBaseRef reviewed — 2 callers listed
census: generic worktreeName reviewed — 2 callers listed

## Invalidation

Tool construction derives availability from the active loaded channel registry and current config. No cache is added. Existing run-scoped tool and prompt lifetimes remain stable; new runs after config reload or restart rebuild their schema. The HTTP disabled-policy reload and the registration policy table verify this transition. The existing MCP config/grant/context cache lifecycle is unchanged.

## Contention

None held. The change adds no locks, queues, transactions, network work, or persistence side effects.

## Tests

openclaw-tools.thread-binding.test.ts calls the registered createOpenClawTools entry point and checks current placement with support, current placement without support, disabled spawn policy, and child placement. It checks runtime capability parity in the same cases. The baseline fails only the supported-current-placement case.

The rewritten test is test/scripts/prompt-snapshots.test.ts:83-114, reconstructs complete Codex tool catalogs from readable full-tool overrides. Its registered path is createHappyPathPromptSnapshotFiles -> scenario construction at test/helpers/agents/happy-path-prompt-snapshots.ts:454 -> createOpenClawCodingTools -> createOpenClawTools at src/agents/agent-tools.ts:867 -> createSessionsSpawnTool at src/agents/openclaw-tools.ts:574. Normalization and descriptor generation occur at test/helpers/agents/happy-path-prompt-snapshots.ts:491-510. The complete materialized-versus-generated catalog assertion remains at test/scripts/prompt-snapshots.test.ts:112-113.

Validation used the targeted registration and sessions-spawn-tool suites, ACP shared helpers, and the two Telegram ACP spawn command cases. No tests were deleted. The existing snapshot test now expects no Discord override because its complete spawn schema matches Telegram; its full reconstructed catalog assertion remains. Five generated fixture files were refreshed with the owned generator, and prompt:snapshots:check passes. All 17 prompt snapshot tests pass. No test-only production seam or side effect was introduced. This is a core discovery repair; plugin packages, updater behavior, and stored state are unchanged.

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

Labels

channel: msteams Channel integration: msteams 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