Skip to content

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

Closed
wyf027 wants to merge 2 commits into
openclaw:mainfrom
wyf027:codex/media-directive-docs-78495-reopen-20260618
Closed

wyf027 wants to merge 2 commits into
openclaw:mainfrom
wyf027:codex/media-directive-docs-78495-reopen-20260618

Conversation

@wyf027

@wyf027 wyf027 commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

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 triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 18, 2026
@wyf027

wyf027 commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

Pushed a markdownlint fix for the heading hierarchy failure in docs/reference/rich-output-protocol.md. Local git diff --check passes; the targeted markdownlint command could not complete locally because pnpm install timed out downloading optional packages before running the linter.

@wyf027

wyf027 commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Updated the Real behavior proof with local full-checkout documentation evidence. I validated the PR body locally with evaluateRealBehaviorProof, which returns passed, and ran:

  • 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

@clawsweeper

clawsweeper Bot commented Jun 18, 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 repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 18, 2026
@clawsweeper

clawsweeper Bot commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 21, 2026, 9:36 AM ET / 13:36 UTC.

Summary
This PR adds examples in docs/reference/rich-output-protocol.md and docs/start/openclaw.md explaining that legacy final-reply MEDIA: directives must be standalone plain-text lines.

PR surface: Docs +31. Total +31 across 2 files.

Reproducibility: yes. Source inspection shows splitMediaFromOutput extracts MEDIA: only from trimmed line-start directives outside fenced code, and existing tests preserve prose and fenced MEDIA: as text; I did not run a live channel delivery repro in this read-only review.

Review metrics: none identified.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #78495
Summary: This PR is the active docs-only candidate for the canonical Markdown-wrapped legacy MEDIA: formatting report; runtime warning work is adjacent but distinct.

Members:

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

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🌊 off-meta tidepool
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Next step before merge

  • No automated repair lane is needed because this PR is already the candidate docs fix and the remaining action is maintainer review or merge.

Security
Cleared: Docs-only diff with no dependency, workflow, permission, secret-handling, install, release, or runtime code changes.

Review details

Best possible solution:

Land this docs clarification if maintainers accept the docs-only mitigation, while keeping runtime warning or parser-behavior changes separate in #80396.

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

Yes. Source inspection shows splitMediaFromOutput extracts MEDIA: only from trimmed line-start directives outside fenced code, and existing tests preserve prose and fenced MEDIA: as text; I did not run a live channel delivery repro in this read-only review.

Is this the best way to solve the issue?

Yes for the docs-only scope. The PR documents the current parser contract on the two public pages that already discuss media output; parser leniency or warning logs are broader runtime choices and are already separate in #80396.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 11a2e03bd4de.

Label changes

Label justifications:

  • P3: This is a low-risk documentation clarification for an existing legacy media directive footgun with no 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: Real behavior proof is not required because this PR only changes files under docs/.
Evidence reviewed

PR surface:

Docs +31. Total +31 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 2 31 0 +31
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 31 0 +31

What I checked:

Likely related people:

  • Vincent Koc: Current blame for the docs snapshot, parser, and parser tests points to recent work by this author on the central MEDIA docs/source surface. (role: recent area contributor; confidence: medium; commits: 61d1fd1f7217, c645ec4555c0; files: docs/reference/rich-output-protocol.md, docs/start/openclaw.md, src/media/parse.ts)
  • Peter Steinberger: History shows multiple earlier MEDIA parser changes that shaped line-start extraction, local path handling, and invalid-token behavior. (role: feature-history contributor; confidence: high; commits: 072998a6ab72, 951a4ea06522, d925d9849c3b; files: src/media/parse.ts, src/media/parse.test.ts, docs/start/openclaw.md)
  • Tak Hoffman: History links this author to assistant directive rendering and the Control UI normalizer path that consumes splitMediaFromOutput. (role: adjacent UI contributor; confidence: medium; commits: cc5c691f0069; files: ui/src/ui/chat/message-normalizer.ts, src/media/parse.ts, src/media/parse.test.ts)
  • Aman113114-IITD: Authored the historical merged docs PR that added similar rich-output MEDIA: warning text, although that merge commit is not contained in current main. (role: related docs contributor; confidence: medium; commits: c876fecbe71c; files: docs/reference/rich-output-protocol.md)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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 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.

@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 18, 2026
@wyf027

wyf027 commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

Updated the PR body to satisfy the current Real behavior proof policy:

  • added/confirmed ## What Problem This Solves
  • added/confirmed ## Evidence
  • kept the detailed validation notes in the existing Real behavior proof section

I also tried to rerun the failed Real behavior proof workflow, but GitHub rejected the rerun with Must have admin rights to Repository, so this needs a maintainer rerun or another repository-side trigger.

@wyf027 wyf027 closed this by deleting the head repository Jun 23, 2026
@wyf027

wyf027 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

Restored as #96275 after recreating the fork/head branch.

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. proof: supplied External PR includes structured after-fix real behavior proof. 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

1 participant