Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesPreserves whitespace in explicit non-home diagnostics export paths and documents destination handling. Example: Export diagnostics to the existing directory "/tmp/ quoted dir ".
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a concrete bug still present on current main with a focused shared-owner change; no actionable findings remain. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Gateway diagnostics and stability CLI commands pass output paths to a shared exporter, which collects sanitized diagnostics and publishes a private ZIP archive. flowchart LR
A[Diagnostics export CLI] --> C[Shared support exporter]
B[Stability export CLI] --> C
C --> D[Resolve destination]
D --> E[Build sanitized ZIP]
E --> F[Atomic file publisher]
Technical reviewBest possible solution: Merge the focused shared-exporter fix after the existing exact-head checks pass. Do we have a high-confidence way to reproduce the issue? Current-main source directly shows the trimming mechanism, and the contributor supplied matching CLI red/green output; no target code was executed during this review. Is this the best way to solve the issue? This is the smallest complete fix: preserve nonblank input in the existing destination owner and avoid its second trimming path for non-home destinations. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 388b7e4523b6. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource -2, Tests +36, Docs +1. Total +35 across 3 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (2 earlier review cycles)
Reviewed October 26, 2026, 5:25 PM ET / 21:25 UTC (Revision 3). |
Trim the configured path only to detect an omitted value, then resolve non-home paths without resolveHomeRelativePath, which trims input, so quoted directories and file names keep their literal whitespace. Absolute paths must go through path.resolve for the same reason: resolveHomeRelativePath trims internally, and its base-directory branch is a no-op for absolute input.
637da49 to
6d581da
Compare
|
Rebased onto current Production change is 1 import + 2 lines:
Verification on a remote runner (Node 24.22.1), same files on base and head so the diff is the only variable: The third case ( @clawsweeper re-review — the standing verdict was authored against |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…law#181775) Preserve literal non-home diagnostics export destinations instead of trimming them through the home-path resolver. Retain blank defaults and existing home-path behavior; account for Windows trailing-space path semantics in the regression tests. Validated with two red-on-base path regressions, 21 passing tests using real ZIP outputs, typed lint/format checks, independent review, and exact-head CI. Recorded CLI before/after evidence is in the PR. Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: wangmiao0668000666 <[email protected]>
Preserve literal non-home diagnostics export destinations instead of trimming them through the home-path resolver. Retain blank defaults and existing home-path behavior; account for Windows trailing-space path semantics in the regression tests. Validated with two red-on-base path regressions, 21 passing tests using real ZIP outputs, typed lint/format checks, independent review, and exact-head CI. Recorded CLI before/after evidence is in the PR. Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: wangmiao0668000666 <[email protected]> (cherry picked from commit bfb988f) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit c0e8769c864cdba57be58c5cd8f83f9ca86bbc9a)
What Problem This Solves
Diagnostics export trims a quoted output path. An existing directory such as
" quoted dir "can become a different file target, and an explicit filename can lose its trailing space.User Impact
gateway diagnostics export --outputandgateway stability --export --outputhonor literal nonblank, non-home output paths. Existing directories receive the generated ZIP; blank input still selects the default support directory.Why This Change Was Made
The export writer uses the existing nonblank-string helper and sends non-home paths directly to
path.resolve, avoiding a second trim inside the home-path helper. Existing~handling stays with that helper. Both CLI commands already share this writer.The trailing-space directory regression now skips Windows, matching the file-path case: Windows normalizes those names. The CLI reference documents the destination behavior.
Thanks @wangmiao0668000666 for the fix and original CLI reproduction.
Evidence
src/logging/diagnostic-support-export.test.tswithnode scripts/run-vitest.mjs ... --maxWorkers=1. Wall time: 30.10s, dominated by transform startup (94%); actual test work is under one second. The tests create real ZIP files and assert their filesystem destinations.git diff --checkpass.gateway diagnostics export --output "…/ quoted dir "writes inside that directory after the fix; the base writes the trimmed sibling file. A normal-file control passes.Independent P0–P2 review of the final staged candidate: no actionable findings. The prior index-only Windows test finding is resolved.
Retained contributor runtime evidence
The following is the contributor’s recorded trace, retained for inspection. It was not rerun on the latest merged head; the production path change is unchanged, and the fresh regression results above cover the integrated source.
Inspectable RED -> GREEN terminal trace
Unit RED (base
571040c3104= old owner + new regression tests), Dockernode scripts/run-vitest.mjs run src/logging/diagnostic-support-export.test.ts --maxWorkers=1:Unit GREEN (candidate = base + this PR, fresh compile after cache clear, same command):
Real-CLI RED (base, Docker,
HOME=/tmp/oc-diag-proof-state,OPENCLAW_STATE_DIR=/tmp/oc-diag-proof-state,OPENCLAW_CONFIG_PATH=/tmp/oc-diag-proof-state/openclaw.json,literal directory
/tmp/oc-diag-proof-out/ quoted basepre-created):Real-CLI GREEN (candidate, same isolated env shape, literal directory
/tmp/oc-diag-proof-out/ quoted candpre-created):Legal control (candidate, normal path):