Skip to content

refactor(media): remove duplicate spaced path fallback - #146933

Merged
vincentkoc merged 1 commit into
mainfrom
refactor/media-spaced-path-parsing-20260913
Sep 13, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
refactor/media-spaced-path-parsing-20260913

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 13, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Media directive parsing repeats the same fallback for filenames containing spaces.

User Impact

No user-visible behavior changes. Accepted attachments, visible text, and attachment ordering are preserved.

Why This Change Was Made

The general fallback already performs the same normalization and validation. Its append is equivalent because no attachment has been added while the shared success flag is false. Production changes: −10 lines; tests unchanged.

Evidence

  • 768 actual parser cases for local, bare, quoted, file, Windows, and UNC paths produced identical complete serialized results. This supplementary check did not exercise remote URL, Markdown, fence, or audio paths.
  • Independent review and fresh P2 autoreview are clean. Targeted formatting and the normal commit hook passed with installed oxfmt 0.65.0.
  • Exact-head CI passed at b7561dcad9e2eee7077fcaa2f65e3f3d72b2cc84 (attempt1), including type/lint/format gates. Actual job103710914720 passed all127 parser cases covering attachment variants, invalid paths, remote validation, ordered segments and Markdown; no target skips or test-name filters. The borrowed dependencies remain incompatible, so package-backed proof is hosted.

@clawsweeper

clawsweeper Bot commented Sep 13, 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.

@vincentkoc vincentkoc self-assigned this Sep 13, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Sep 13, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review September 13, 2026 10:36
@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 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 7:55 AM ET / 11:55 UTC (Revision 3).

ClawSweeper review

What this changes

Removes a duplicate fallback for attachment filenames containing spaces while preserving accepted attachments, visible text, and attachment order.

Merge readiness

✅ Ready for maintainer review

The cleanup remains useful and has no actionable correctness findings. The fallback is equivalent by source inspection, and the reviewed commit passed hosted CI; this member-authored PR remains eligible for normal maintainer handling.

Priority: P3
Reviewed head: b7561dcad9e2eee7077fcaa2f65e3f3d72b2cc84

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-preserving deletion with existing contract coverage, successful hosted CI, and no actionable findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The external-contributor proof gate does not apply to this MEMBER-authored internal cleanup. Source establishes parser equivalence; the reported comparisons and verified hosted CI are supplemental validation, not live channel proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The external-contributor proof gate does not apply to this MEMBER-authored internal cleanup. Source establishes parser equivalence; the reported comparisons and verified hosted CI are supplemental validation, not live channel proof.
Evidence reviewed 7 items Introduced change and invariant: The pinned introduction delta deletes only the duplicate fallback. Every preceding media mutation within the directive sets hasValidMedia=true; consequently, when the deleted branch could run, media.length equals mediaStartIndex. Its splice therefore equals the retained push, with identical normalization, validation options, flags, and invalidParts cleanup.
Current main still contains the duplicate: The fetched main revision retains both spacedFallback and the immediately following general fallback, so this cleanup has not already been applied there.
Latest-release comparison: The v2026.9.4 source also retains both fallback blocks. Existing support for spaced filenames is shipped behavior; this PR simplifies its implementation.
Findings None None.
Security None None.

How this fits together

The media parser separates attachment references from model and tool output into visible text and ordered media segments. Reply processing consumes those results before channel delivery.

flowchart TD
  A[Model or tool output] --> B[Media directive parser]
  B --> C[Validate candidate paths]
  C --> D[General fallback when none accepted]
  C --> E[Ordered media and visible text]
  D --> E
  E --> F[Reply processing and channel delivery]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -10. Total -10 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 1 0 10 -10
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 0 10 -10

Review metrics

None.

Technical review

Best possible solution:

Keep one general fallback for unsuccessful directive parsing and retain the existing attachment-order and validation contracts.

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

Not applicable: this PR removes redundant code rather than reporting a user-facing defect; source inspection establishes the equivalence.

Is this the best way to solve the issue?

Yes. Deleting the narrower duplicate leaves the existing general fallback as the single owner without changing accepted inputs or output ordering.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 59773963d180.

Labels

Label justifications:

  • P3: This is a bounded internal cleanup with no intended or identified user-visible 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: The external-contributor proof gate does not apply to this MEMBER-authored internal cleanup. Source establishes parser equivalence; the reported comparisons and verified hosted CI are supplemental validation, not live channel proof.

Evidence

What I checked:

  • Introduced change and invariant: The pinned introduction delta deletes only the duplicate fallback. Every preceding media mutation within the directive sets hasValidMedia=true; consequently, when the deleted branch could run, media.length equals mediaStartIndex. Its splice therefore equals the retained push, with identical normalization, validation options, flags, and invalidParts cleanup. (src/media/parse.ts:535, b7561dcad9e2)
  • Current main still contains the duplicate: The fetched main revision retains both spacedFallback and the immediately following general fallback, so this cleanup has not already been applied there. (src/media/parse.ts:535, 59773963d180)
  • Latest-release comparison: The v2026.9.4 source also retains both fallback blocks. Existing support for spaced filenames is shipped behavior; this PR simplifies its implementation. (src/media/parse.ts:536, 3a9d69db306c)
  • Existing behavior coverage: Existing parser tests cover quoted and unquoted spaced filenames, Windows and UNC paths, bare filenames, ordered segments, independent attachments, traversal rejection, unsafe remote URLs, Markdown, fences, and audio directives. No tests were changed or executed during this read-only review. (src/media/parse.test.ts:117, b7561dcad9e2)
  • Hosted validation: GitHub confirms that https://github.com/openclaw/openclaw/actions/runs/34752313435 completed successfully on the exact reviewed head, attempt 1. Job 103710914720 also reports a successful Node test shard. The captured PR body reports 127 parser cases and 768 supplementary equivalent-output comparisons; the job-log download was blocked by the review environment, so those case counts were not independently verified. (b7561dcad9e2)
  • Feature-history routing: Current-main history includes repeated parser maintenance by Peter Steinberger. GitHub identifies steipete as author of commit 36a2b5b, whose patch changed ordered-segment projection to include all accepted fallback attachments. Deeper local pickaxe and blame inspection encountered unavailable historical objects; no original-introduction claim is made. (src/media/parse.ts:551, 36a2b5b00b3f)

Likely related people:

  • steipete: 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.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-13T10:36:41.883Z sha b7561dc :: needs maintainer review before merge. :: none
  • reviewed 2026-09-13T10:42:05.180Z sha b7561dc :: needs maintainer review before merge. :: none

@vincentkoc
vincentkoc merged commit df5c530 into main Sep 13, 2026
259 checks passed
@vincentkoc
vincentkoc deleted the refactor/media-spaced-path-parsing-20260913 branch September 13, 2026 12:50
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 13, 2026
* temp/pr-145950: (101 commits)
  refactor(memory-wiki): share freshness result construction (#146935)
  improve(gateway): use metadata projection for presence (#146817)
  test(agents): reuse complete Responses model fixtures (#147015)
  fix(sessions): align the reclamation-memory test with the archive session owner (#147028)
  refactor(terminal): simplify copy-sensitive token checks (#146934)
  refactor(media): remove duplicate spaced path fallback (#146933)
  refactor(cli): reuse command-group names (#146893)
  improve(plugins): reduce JavaScript generation capture work (#146993)
  test: align plugin fixtures with current runtime contracts (#147000)
  refactor(browser): separate session tab tracking from cleanup (#146973)
  fix(tests): make systemd clock fixtures private (#146990)
  fix(linux): retire sleep guards when logind disconnects (#146046)
  refactor(matrix): share draft fallback delivery (#144840)
  fix(sessions): preserve cross-agent replies after reload (#146799)
  test(models): cover quota recovery during catalog discovery (#146708)
  fix(macos): recover browser sign-in when no browser opens (#146787)
  fix(process): prevent one-shot agents exiting while polling (#144268)
  fix(status): label the session inventory as stored (#146979)
  fix: avoid repeated background reads while loading chat (#146953)
  refactor(ui): narrow Skill Workshop proposal context (#146977)
  ...
vincentkoc added a commit that referenced this pull request Sep 13, 2026
* commit '060e856e5f9df245d63c98990fcb47e18108c6b9': (97 commits)
  refactor(memory-wiki): share freshness result construction (#146935)
  improve(gateway): use metadata projection for presence (#146817)
  test(agents): reuse complete Responses model fixtures (#147015)
  fix(sessions): align the reclamation-memory test with the archive session owner (#147028)
  refactor(terminal): simplify copy-sensitive token checks (#146934)
  refactor(media): remove duplicate spaced path fallback (#146933)
  refactor(cli): reuse command-group names (#146893)
  improve(plugins): reduce JavaScript generation capture work (#146993)
  test: align plugin fixtures with current runtime contracts (#147000)
  refactor(browser): separate session tab tracking from cleanup (#146973)
  fix(tests): make systemd clock fixtures private (#146990)
  fix(linux): retire sleep guards when logind disconnects (#146046)
  refactor(matrix): share draft fallback delivery (#144840)
  fix(sessions): preserve cross-agent replies after reload (#146799)
  test(models): cover quota recovery during catalog discovery (#146708)
  fix(macos): recover browser sign-in when no browser opens (#146787)
  fix(process): prevent one-shot agents exiting while polling (#144268)
  fix(status): label the session inventory as stored (#146979)
  fix: avoid repeated background reads while loading chat (#146953)
  refactor(ui): narrow Skill Workshop proposal context (#146977)
  ...
vincentkoc added a commit that referenced this pull request Sep 13, 2026
* temp/pr-137049: (110 commits)
  improve: reduce GitHub OAuth maintenance work for large agent rosters (#147021)
  fix(test): avoid settings lock writer startup timeouts (#147029)
  fix(update): correct backup guidance and cover incident regressions (#147023)
  refactor(gateway): share connection lifecycle across transports (#145950)
  refactor(telegram): share HTML text escaping (#146936)
  perf(build): reduce disk use in UI performance checks (#146687)
  refactor(memory-wiki): share freshness result construction (#146935)
  improve(gateway): use metadata projection for presence (#146817)
  test(agents): reuse complete Responses model fixtures (#147015)
  fix(sessions): align the reclamation-memory test with the archive session owner (#147028)
  refactor(terminal): simplify copy-sensitive token checks (#146934)
  refactor(media): remove duplicate spaced path fallback (#146933)
  refactor(cli): reuse command-group names (#146893)
  improve(plugins): reduce JavaScript generation capture work (#146993)
  test: align plugin fixtures with current runtime contracts (#147000)
  refactor(browser): separate session tab tracking from cleanup (#146973)
  fix(tests): make systemd clock fixtures private (#146990)
  fix(linux): retire sleep guards when logind disconnects (#146046)
  refactor(matrix): share draft fallback delivery (#144840)
  fix(sessions): preserve cross-agent replies after reload (#146799)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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