Skip to content

test(cli): keep Unix socket fixtures within path limits - #139565

Merged
steipete merged 1 commit into
mainfrom
codex/test-audit-connect-socket
Sep 6, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/test-audit-connect-socket

Conversation

@steipete

@steipete steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Related: #139428

What Problem This Solves

The connect CLI socket-refusal test fails during socket creation under a long temporary directory, before exercising the CLI's refusal behavior. The Unix socket pathname exceeds the platform limit.

Why This Change Was Made

Use the existing tracked private temp-directory helper with the short /tmp root for this socket fixture. Retain the real server, CLI call, socket-preservation assertion, close-in-finally and directory cleanup.

User Impact

No production behavior changes. The test now reaches its intended assertions even under nested runner temp paths. Net one added test line.

Evidence

The original case reproduced EINVAL while binding a 249-byte pathname under a deterministic long TMPDIR. All 20 connect CLI cases pass after the repair under that same long parent. Full changed gate, formatting/diff check, deslop and independent P2 review pass. No runtime speedup claimed.

@clawsweeper

clawsweeper Bot commented Sep 6, 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 cli CLI command changes size: XS maintainer Maintainer-authored PR labels Sep 6, 2026
@steipete
steipete marked this pull request as ready for review September 6, 2026 00:38
@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 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 5, 2026, 8:43 PM ET / September 6, 2026, 00:43 UTC.

ClawSweeper review

What this changes

The PR places the connect CLI’s Unix socket test fixture under /tmp so long runner temporary paths do not prevent the test from reaching its assertions.

Merge readiness

✅ Ready for maintainer review

The fixture repair remains useful: fetched main and the latest release retain the problematic temporary-directory selection. No actionable defect was found, and the maintainer-sponsored test-audit campaign supports retaining this PR.

Priority: P3
Reviewed head: 6053328ef7bdbec82a92b9209f30921bb07f01da

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused fixture repair preserves meaningful coverage and uses an existing helper contract.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied MEMBER classification exempts this maintainer test-only PR from the external-contributor proof gate; its body reports the relevant socket-bind failure and successful repaired suite, which were not independently rerun.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied MEMBER classification exempts this maintainer test-only PR from the external-contributor proof gate; its body reports the relevant socket-bind failure and successful repaired suite, which were not independently rerun.
Evidence reviewed 7 items Verified introduced change: The merge-base-to-head diff changes only the socket fixture root and adds its explanation; refusal assertions, server shutdown, and tracked cleanup remain intact.
Existing fixture allocation contract: The helper accepts an explicit root, allocates a unique directory with mkdtempSync, records it, and registers cleanup after each test. The explicit root bypasses the potentially long canonical system temporary directory.
Current-main necessity: Fetched main still creates this socket fixture without an explicit short root.
Findings None None.
Security None None.

How this fits together

The connect CLI reads setup targets before connecting a machine to a Gateway. This test checks that a socket supplied as a target file is rejected and preserved.

flowchart LR
  A[Test runner] --> B[Tracked directory under /tmp]
  B --> C[Real Unix socket]
  C --> D[Connect target-file reader]
  D --> E[Reject non-regular file]
  E --> F[Assert socket preserved]
  F --> G[Close server and clean directory]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +1. Total +1 across 1 file.

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

Review metrics

None.

Technical review

Best possible solution:

Use the existing tracked short-root fixture while preserving the real socket refusal and cleanup checks.

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

Yes: current source lets a long temporary root flow directly into the Unix socket pathname, and the PR reports a concrete 249-byte failing case. This review did not execute that case.

Is this the best way to solve the issue?

Yes: the existing helper already supports a short root, so the patch fixes fixture construction without weakening the behavior being tested.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a narrowly scoped test-fixture portability repair with no production 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: The supplied MEMBER classification exempts this maintainer test-only PR from the external-contributor proof gate; its body reports the relevant socket-bind failure and successful repaired suite, which were not independently rerun.

Label justifications:

  • P3: This is a narrowly scoped test-fixture portability repair with no production 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 supplied MEMBER classification exempts this maintainer test-only PR from the external-contributor proof gate; its body reports the relevant socket-bind failure and successful repaired suite, which were not independently rerun.

Evidence

What I checked:

  • Verified introduced change: The merge-base-to-head diff changes only the socket fixture root and adds its explanation; refusal assertions, server shutdown, and tracked cleanup remain intact. (src/cli/connect-cli.test.ts:181, 6053328ef7bd)
  • Existing fixture allocation contract: The helper accepts an explicit root, allocates a unique directory with mkdtempSync, records it, and registers cleanup after each test. The explicit root bypasses the potentially long canonical system temporary directory. (test/helpers/temp-dir.ts:37, 6053328ef7bd)
  • Current-main necessity: Fetched main still creates this socket fixture without an explicit short root. (src/cli/connect-cli.test.ts:181, e284dad94f9c)
  • Latest-release comparison: The supplied latest release also retains the same long-root-sensitive socket fixture. (src/cli/connect-cli.test.ts:181, 3928bad9badf)
  • Preserved product contract: The documented target-file contract leaves non-regular files in place; the retained test exercises the real CLI reader and verifies that the socket survives rejection. Public docs: docs/cli/connect.md. (docs/cli/connect.md:109, 6053328ef7bd)
  • Reported validation and campaign context: The captured PR body reports EINVAL for a 249-byte socket pathname before the change and all 20 connect CLI cases passing afterward under the same long temporary parent. The open campaign at Test audit: reduce redundant test code and full-suite runtime #139428 explicitly lists this socket repair as pending work; it does not claim a full-suite speedup. (6053328ef7bd)

Likely related people:

  • Peter Lee: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • 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.

@steipete
steipete merged commit f5cefc5 into main Sep 6, 2026
170 checks passed
@steipete
steipete deleted the codex/test-audit-connect-socket branch September 6, 2026 00:47
@steipete

steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 6, 2026
* origin/main: (302 commits)
  test(gateway): preserve held-work close failures (#139593)
  refactor(exec): share package argument scanning (#139560)
  fix(audit): preserve sequence range validation before numeric decoding (#139587)
  fix(transcripts): retain capture ownership through failed cleanup (#139572)
  refactor(models): share selector reference traversal (#139571)
  perf(agents): classify allowlists without intermediate sets (#138392)
  chore(release): update appcast for 2026.9.2 (#139575)
  fix(ci): synchronize cloud retries and board widget input (#139506)
  fix(plugins): explain SDK incompatibilities after core updates (#139458)
  fix(voice-call): retain installed WebSocket behavior under Bun (#139567)
  test(text): consolidate literal sanitizer cases (#139579)
  test(gateway): observe native drain without a lint exception (#139576)
  test(memory): consolidate visibility fixtures without policy defaults (#139569)
  fix(ui): show shimmer skeletons while loading Control UI (#139525)
  test(qa): make cleanup child logging deterministic (#139566)
  test(cli): keep Unix socket fixtures within path limits (#139565)
  fix: avoid slow incognito key checks in large session stores (#139528)
  feat(macos): open Gateway windows from the Gateways menu (#139522)
  test(workshop): isolate marker casing fixture identities (#139554)
  fix(process): require cleanup evidence before releasing owned work (#139517)
  ...

# Conflicts:
#	scripts/release-check.ts
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes 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