Skip to content

docs(media): clarify legacy MEDIA line formatting - #96275

Merged
steipete merged 3 commits into
openclaw:mainfrom
wyf027:codex/media-directive-docs-78495-reopen-20260618
Aug 1, 2026
Merged

steipete merged 3 commits into
openclaw:mainfrom
wyf027:codex/media-directive-docs-78495-reopen-20260618

Conversation

@wyf027

@wyf027 wyf027 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Restored replacement for #94436 after the fork/head repository was recreated.

Summary

  • Document that legacy final-reply MEDIA: attachments must be standalone plain-text lines.
  • Add valid and invalid examples for Markdown-wrapped or inline MEDIA: text.
  • Add a short start-page warning with a link to the rich output protocol details.

Fixes #78495.

Verification

  • node scripts/format-docs.mjs --check
  • node scripts/check-docs-mdx.mjs docs README.md
  • node scripts/docs-list.js
  • git diff --check origin/main...HEAD

Real behavior proof

Behavior addressed: Readers of the OpenClaw docs can now see that legacy final-reply MEDIA: attachments are only recognized when emitted as standalone plain-text lines, and that Markdown-wrapped or inline MEDIA: examples are invalid.

Real environment tested: Local full OpenClaw checkout on PR branch codex/media-directive-docs-78495-reopen-20260618, using the repository documentation scripts directly against the docs tree after the patch.

Exact steps or command run after this patch:

node scripts/format-docs.mjs --check
node scripts/check-docs-mdx.mjs docs README.md
node scripts/docs-list.js
git diff --check origin/main...HEAD

Evidence after fix: Terminal capture from the local documentation checks showed the patched documentation renders as valid formatted docs and remains in the generated docs listing:

Docs formatting clean (664 files).
Docs MDX check passed (679 files, 1789ms).
Listing all markdown files in docs folder:
...
reference/rich-output-protocol.md - Rich output protocol for structured media, embeds, audio hints, and replies
...
start/openclaw.md - End-to-end guide for running OpenClaw as a personal assistant with safety cautions
...
Reminder: keep docs up to date as behavior changes.

Observed result after fix: The docs formatter reported a clean tree, the MDX checker passed across the docs and README set, docs-list included the changed docs pages, and git diff --check origin/main...HEAD produced no whitespace or conflict-marker output.

What was not tested: A packaged docs-site build was not started in this environment; this PR changes only Markdown documentation and was validated with the repository docs format, MDX, listing, and diff checks.


Reopened after active-PR limit cleanup. Supersedes closed PR #94389.

What Problem This Solves

Readers need to know that legacy final-reply MEDIA: attachments are parsed only when emitted as standalone plain-text lines. Without that clarification, examples that wrap MEDIA: in Markdown or place it inline can look valid while failing the legacy parser behavior.

Evidence

The repository documentation checks passed after the docs update: node scripts/format-docs.mjs --check, node scripts/check-docs-mdx.mjs docs README.md, node scripts/docs-list.js, and git diff --check origin/main...HEAD. The detailed terminal output is included in the Real behavior proof section above. A packaged docs-site build was not started locally.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: XS labels Jun 24, 2026
@clawsweeper

clawsweeper Bot commented Jun 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 30, 2026, 7:25 AM ET / 11:25 UTC.

ClawSweeper review

What this changes

The branch documents that legacy final-reply MEDIA: attachments must be standalone plain-text lines, adds examples of Markdown and inline forms that remain text, and updates the generated documentation heading map.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

This is a narrowly scoped docs-only clarification that previously passed review without findings and has contributor-supplied documentation validation. It remains useful because the linked documentation issue is still open, but the PR is currently marked dirty against main, so it needs a rebase and a refresh of the generated docs map/checks before merge.

Priority: P3
Reviewed head: b184e6af1406816f8ae42eb26237c4b543372e64

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is focused, aligns with the stated legacy-media behavior, includes the generated-doc baseline, and has no discrete correctness finding; it needs only a rebase and validation refresh.
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 5 items PR scope and contract: The submitted patch adds a dedicated legacy MEDIA: documentation section with one valid standalone line and three invalid formatted or inline forms, while retaining structured media fields as the preferred protocol.
User-facing entry-point guidance: The start guide adds the same standalone-line warning and links readers to the rich-output protocol section, so the constraint is discoverable outside the reference page.
Generated-doc baseline: The PR updates the generated heading map for the new legacy-media section, addressing the prior review-cycle request to regenerate it.
Findings None None.
Security None None.

How this fits together

OpenClaw’s reply-directive parsing can normalize legacy MEDIA: lines into outbound media attachments, while structured media fields are the preferred path for tools, plugins, streaming, and actions. The changed documentation guides operators and model authors toward the legacy syntax that the parser recognizes and away from formatted text that remains visible chat content.

flowchart LR
  A[Assistant final reply] --> B[Legacy MEDIA line parser]
  B --> C{Standalone plain-text line?}
  C -->|Yes| D[Outbound media attachment]
  C -->|No| E[Visible text remains]
  F[Structured media fields] --> D
  G[Rich output docs] --> A
Loading

Before merge

  • Resolve merge risk (P1) - The PR is currently conflict-marked (dirty) against main; merging requires a rebase, regeneration/confirmation of docs/docs_map.md, and a fresh documentation-check result on the rebased head.
  • Complete next step (P2) - The remaining action is ordinary contributor rebase and maintainer review, not a discrete repair suitable for an automated fix lane.
Agent review details

Security

None.

PR surface

Docs +34. Total +34 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 3 35 1 +34
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 35 1 +34

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #78495
Summary: This PR is the active documentation candidate for the standalone legacy MEDIA: formatting problem tracked by the canonical issue; the code-fence warning proposal overlaps but addresses a distinct runtime-observability concern.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Rebase the focused documentation clarification onto current main, retain the generated heading-map update if still needed, and merge once the current docs checks and conflict resolution confirm the examples still match the parser contract.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Rebase the focused documentation clarification onto current main, retain the generated heading-map update if still needed, and merge once the current docs checks and conflict resolution confirm the examples still match the parser contract.

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

Not applicable: this PR changes documentation only. The supplied documentation checks and the prior review establish a concrete validation path, but no runtime behavior is altered by this branch.

Is this the best way to solve the issue?

Yes, subject to rebase: documenting the existing standalone-line constraint beside the structured-media guidance is a narrow, maintainable response to the linked formatting confusion without changing the parser’s intentional code-fence behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 7a9d2c3e72a2.

Labels

Label justifications:

  • P3: This is a small, documentation-only clarity improvement; it does not change runtime media delivery 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:

  • PR scope and contract: The submitted patch adds a dedicated legacy MEDIA: documentation section with one valid standalone line and three invalid formatted or inline forms, while retaining structured media fields as the preferred protocol. Public docs: docs/reference/rich-output-protocol.md. (docs/reference/rich-output-protocol.md:34, b184e6af1406)
  • User-facing entry-point guidance: The start guide adds the same standalone-line warning and links readers to the rich-output protocol section, so the constraint is discoverable outside the reference page. Public docs: docs/start/openclaw.md. (docs/start/openclaw.md:209, b184e6af1406)
  • Generated-doc baseline: The PR updates the generated heading map for the new legacy-media section, addressing the prior review-cycle request to regenerate it. Public docs: docs/docs_map.md. (docs/docs_map.md:8586, b184e6af1406)
  • Prior review continuity: The latest completed ClawSweeper review at commit b184e6af1406816f8ae42eb26237c4b543372e64 found no remaining contributor-facing findings after the docs-map update. (b184e6af1406)
  • Current merge state: GitHub reports this branch as dirty against its main base, so the documentation patch must be rebased and reviewed against the current documentation tree before it can land.

Likely related people:

  • wyf027: Authored the active docs branch and its three commits; best available routing contact for rebasing the small documentation patch. Current-main file-history attribution could not be established from the available read-only inspection path. (role: current documentation proposal author; confidence: low; commits: d3e51d0f7b82, b698b3a8c0d8, b184e6af1406; files: docs/reference/rich-output-protocol.md, docs/start/openclaw.md, docs/docs_map.md)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Rebase onto current main, resolve the documented merge conflict, and rerun the repository documentation checks on the rebased head.

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.

History

Review history (4 earlier review cycles)
  • reviewed 2026-07-01T04:30:42.037Z sha 720a631 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-12T01:56:20.413Z sha 31e658c1dcbdadb404207af07c0d5b8fff112200 :: needs changes before merge. :: [P3] Regenerate the docs heading map
  • reviewed 2026-07-12T05:47:46.097Z sha 9bd01ba287ea4bdbfb82ccbc327ee872e5e99f67 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-12T14:05:39.007Z sha b184e6af1406816f8ae42eb26237c4b543372e64 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added 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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jun 24, 2026
@wyf027
wyf027 force-pushed the codex/media-directive-docs-78495-reopen-20260618 branch from 9bd01ba to b184e6a Compare July 12, 2026 13:48
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added stale Marked as stale due to inactivity and removed stale Marked as stale due to inactivity labels Jul 27, 2026
@steipete
steipete force-pushed the codex/media-directive-docs-78495-reopen-20260618 branch from b184e6a to 4375b2a Compare August 1, 2026 04:16
@steipete

steipete commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Landing verification for original contributor head 4375b2a88836966f6f913792ae08bb21bb467587, fixing #78495:

  • Preserved all three original contributor-authored commits while rebasing this original PR branch onto current main. The only conflict was generated docs/docs_map.md; regenerated it with the repository's canonical node scripts/generate-docs-map.mjs instead of hand editing. The original three-file documentation scope and contributor attribution are unchanged.
  • Personally executed the real current-main splitMediaFromOutput parser against every documented case: standalone MEDIA:/workspace/image.png yields the attachment; **MEDIA:...**, inline-code wrapping, inline prose, and fenced examples remain visible text with no attachment. Plain Markdown images also stay text unless extractMarkdownImages is explicitly enabled, at which point the image attaches. This directly verifies the linked operator-reported silent-failure behavior and the preserved Telegram-style opt-in distinction.
  • node scripts/generate-docs-map.mjs --check — generated map up to date.
  • /Users/steipete/Projects/openclaw/node_modules/.bin/oxfmt --check docs/reference/rich-output-protocol.md docs/start/openclaw.md docs/docs_map.md — all three files correctly formatted.
  • git diff --check origin/main...HEAD — clean. Exact-head CI run 30683637651 and Workflow Sanity run 30683637592 are green.
  • Proof gap: no live Telegram/Signal message was sent; this is documentation-only and the actual production attachment parser was executed directly.

The docs keep structured media as the recommended path, explain exactly when legacy final-reply text is recognized, preserve plugin/tool boundaries, and retain Fixes #78495.

@steipete
steipete merged commit 9099520 into openclaw:main Aug 1, 2026
48 checks passed
@steipete

steipete commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 1, 2026
* docs(media): clarify legacy MEDIA line formatting

* docs(media): fix heading hierarchy

* docs: update docs map for rich output protocol

---------

Co-authored-by: 吴杨帆 <[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 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.

docs: MEDIA: directive silently ignored when wrapped in markdown formatting

2 participants