Skip to content

[Repo Assist] test(exec): add tilde-expansion edge-case tests for ExecApprovalsStore - #750

Merged
ranjeshj merged 1 commit into
mainfrom
repo-assist/test-exec-approvals-store-path-expansion-2026-06-12-5b7bcffb77abea32
Jun 18, 2026
Merged

ranjeshj merged 1 commit into
mainfrom
repo-assist/test-exec-approvals-store-path-expansion-2026-06-12-5b7bcffb77abea32

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

🤖 This PR was created by Repo Assist, an automated AI assistant.

Summary

Adds two unit tests for ExecApprovalsStore that cover previously-untested branches of ExpandHomePrefix, complementing the path-expansion coverage added in #744.

Motivation

ExpandHomePrefix has three distinct branches:

  1. path == "~" — returns home directly (the tilde-only branch)
  2. path.StartsWith("~/") — strips prefix and joins with home
  3. otherwise — returns path unchanged

The existing tests exercise branch 2 (via ResolveAsync_HomeRelativeStateDir_UsesOpenClawHome) but leave branches 1 and the interaction between a tilde-prefixed openClawHomeOverride and stateDirOverride uncovered. A future refactor of ExpandHomePrefix (e.g. collapsing the three-way conditional) could silently break branch 1 without a failing test.

New Tests

Test What it verifies
ResolveAsync_TildeOnlyStateDir_ResolvesToEffectiveHome stateDirOverride = "~" (bare tilde) resolves to effectiveHome and the file is migrated there
ResolveAsync_TildePrefixedOpenClawHome_ExpandsRelativeToOsHome openClawHomeOverride = "~/.openclaw" is expanded relative to osHomeOverride before being used as the base for further tilde expansion in stateDirOverride

Test Status

  • ✅ New tests: 2 passed, 0 failed
  • ✅ OpenClaw.Shared.Tests: 2216 passed, 8 failed (pre-existing, unrelated to this PR)
    • Pre-existing failures: MxcPolicyBuilderTests, MxcConfigBuilderTests, McpHttpServerTests, ExecApprovalV2NormalizationTests — all fail due to Windows-specific behaviour in the Linux CI environment; not caused by this change.
  • ✅ OpenClaw.Tray.Tests: 1038 passed, 0 failed, 2 skipped

Generated by 🌈 Repo Assist, see workflow run. Learn more.

Add this agentic workflows to your repo

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@97143ac59cb3a13ef2a77581f929f06719c7402a

Add two tests that cover previously-untested branches of ExpandHomePrefix:

1. ResolveAsync_TildeOnlyStateDir_ResolvesToEffectiveHome
   - stateDirOverride == "~" (tilde alone, no trailing separator) must
     resolve to the effectiveHome directory.  This exercises the
     `path == "~"` branch of ExpandHomePrefix that is distinct from the
     `path.StartsWith("~/")` branch covered by existing tests.

2. ResolveAsync_TildePrefixedOpenClawHome_ExpandsRelativeToOsHome
   - openClawHomeOverride == "~/subdir" is itself tilde-prefixed and must
     be expanded relative to osHomeOverride before it is used as the base
     for further tilde expansion in stateDirOverride.

Both tests also verify that file migration from the legacy data path to
the resolved state path succeeds and that the migrated file content is
preserved.

Co-authored-by: Copilot <[email protected]>
@clawsweeper

clawsweeper Bot commented Jun 12, 2026 •

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed June 12, 2026, 6:11 PM ET / 22:11 UTC.

Summary
Review failed before ClawSweeper could summarize the requested change.

Reproducibility: unclear. The review failed before ClawSweeper could establish a reproduction path.

Review metrics: none identified.

Merge readiness
Overall: 🌊 off-meta tidepool
Proof: 🌊 off-meta tidepool
Patch quality: 🌊 off-meta tidepool
Result: rating does not apply to this item.

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

Risk before merge

  • [P1] No close action taken because the review did not complete.

Maintainer options:

  1. Decide the mitigation before merge
    Retry the Codex review after fixing the execution failure.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • Review did not complete, so no work-lane recommendation was made.
Review details

Best possible solution:

Retry the Codex review after fixing the execution failure.

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

Unclear. The review failed before ClawSweeper could establish a reproduction path.

Is this the best way to solve the issue?

Unclear. Retry the review first so ClawSweeper can evaluate the actual issue and fix direction.

AGENTS.md: unclear because the file could not be read completely.

Codex review notes: model internal, reasoning high; reviewed against 06ed71f3c01f.

Label changes

Label changes:

  • add rating: 🌊 off-meta tidepool: Overall readiness is 🌊 off-meta tidepool; proof is 🌊 off-meta tidepool and patch quality is 🌊 off-meta tidepool.
  • remove P3: Current review triage priority is none.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🌊 off-meta tidepool, so this older rating label is no longer current.
  • remove status: 👀 ready for maintainer look: Current PR status no longer selects a status label.

Label justifications:

  • rating: 🌊 off-meta tidepool: Overall readiness is 🌊 off-meta tidepool; proof is 🌊 off-meta tidepool and patch quality is 🌊 off-meta tidepool.
Evidence reviewed

What I checked:

  • failure reason: codex execution failed.
  • codex failure detail: Codex review failed for this PR with exit 1.
  • codex stderr: de.\n\nBoth tests also verify that file migration from the legacy data path to\nthe resolved state path succeeds and that the migrated file content is\npreserved.\n\nCo-authored-by: Copilot [email protected]".
  • codex stdout: No stdout captured.

Likely related people:

  • unknown: Codex failed before it could trace repository history. (role: review did not complete; confidence: low)
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: 🌊 off-meta tidepool PR readiness rating does not apply to this item. 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-risk cleanup, docs, polish, ergonomics, or speculative feature. and removed rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels Jun 12, 2026
@kmahone
kmahone marked this pull request as ready for review June 12, 2026 22:09
@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. and removed 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 Jun 12, 2026
@ranjeshj
ranjeshj merged commit 234fa8f into main Jun 18, 2026
21 of 24 checks passed
@ranjeshj
ranjeshj deleted the repo-assist/test-exec-approvals-store-path-expansion-2026-06-12-5b7bcffb77abea32 branch June 18, 2026 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. repo-assist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant