Repository navigation
[Repo Assist] test(exec): add tilde-expansion edge-case tests for ExecApprovalsStore - #750
Conversation
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]>
|
Codex review: needs maintainer review before merge. Reviewed June 12, 2026, 6:11 PM ET / 22:11 UTC. Summary Reproducibility: unclear. The review failed before ClawSweeper could establish a reproduction path. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Review detailsBest 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 changesLabel changes:
Label justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
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
|
🤖 This PR was created by Repo Assist, an automated AI assistant.
Summary
Adds two unit tests for
ExecApprovalsStorethat cover previously-untested branches ofExpandHomePrefix, complementing the path-expansion coverage added in #744.Motivation
ExpandHomePrefixhas three distinct branches:path == "~"— returnshomedirectly (the tilde-only branch)path.StartsWith("~/")— strips prefix and joins withhomepathunchangedThe existing tests exercise branch 2 (via
ResolveAsync_HomeRelativeStateDir_UsesOpenClawHome) but leave branches 1 and the interaction between a tilde-prefixedopenClawHomeOverrideandstateDirOverrideuncovered. A future refactor ofExpandHomePrefix(e.g. collapsing the three-way conditional) could silently break branch 1 without a failing test.New Tests
ResolveAsync_TildeOnlyStateDir_ResolvesToEffectiveHomestateDirOverride = "~"(bare tilde) resolves toeffectiveHomeand the file is migrated thereResolveAsync_TildePrefixedOpenClawHome_ExpandsRelativeToOsHomeopenClawHomeOverride = "~/.openclaw"is expanded relative toosHomeOverridebefore being used as the base for further tilde expansion instateDirOverrideTest Status
OpenClaw.Shared.Tests: 2216 passed, 8 failed (pre-existing, unrelated to this PR)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 skippedAdd this agentic workflows to your repo
To install this agentic workflow, run