Repository navigation
chore: isolate every profile root for UI-test child processes - #1906
Conversation
Add ApplyProfileIsolation so the fixture child gets run-owned DATA, APPDATA, LOCALAPPDATA and legacy LOCAL_DATA roots, with pure regression tests. Co-authored-by: Copilot App <[email protected]>
|
🦞👀 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 changes before merge. What this changesThe PR clears inherited OpenClaw environment variables and redirects four profile overrides before accessibility-test child processes start. Example: A fixture run uses C:\Temp\OpenClaw.Tray.Axe.123 while inheriting OPENCLAW_TRAY_LOCAL_DATA_DIR=C:\Users\Ada\AppData\Local\OpenClawTray.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep open: this maintainer-authored PR addresses a real fixture-isolation gap still present on main; no P0-P2 defect was found. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherAccessibilityAppFixture launches the real Companion executable for startup and deep-link navigation, supplying child environment variables consumed by application and setup profile resolvers. flowchart LR
A[Parent environment] --> B[AccessibilityAppFixture]
B --> C[Clear inherited OpenClaw variables]
C --> D[Set run-owned profile roots]
D --> E[Launch Companion child]
E --> F[Application and setup path resolvers]
Technical reviewBest possible solution: Keep isolation in the existing StartProcess owner, preserve the narrow environment-override contract, and use the shared temporary-directory owner in its tests. Do we have a high-confidence way to reproduce the issue? Source shows that main forwards inherited setup-local overrides into the child while the corresponding resolvers consume them; no runtime reproduction was executed during this read-only review. Is this the best way to solve the issue? The existing process-launch owner is the right repair boundary, and setting the modern roots plus legacy alias addresses the demonstrated environment leak without changing shipped defaults. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c59652f9b8ca. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 Reviewed October 28, 2026, 11:39 AM ET / 15:39 UTC. |
…nclaw#1906) Isolate inherited OpenClaw environment variables and all profile roots for accessibility UI-test child processes. Add focused regression coverage for child environment isolation. Co-authored-by: Copilot App <[email protected]>
What Problem This Solves
Fixes: UI-test child processes can read or write the developer's real OpenClaw Companion profile when the accessibility fixture launches the app, because only some of the profile root variables were redirected and inherited
OPENCLAW_*variables passed through.User Impact
User impact: no user-visible change. For the accessibility fixture child process, the helper redirects the profile roots and drops inherited
OPENCLAW_*configuration. A known residual escape remains:FunctionalUI.cswrites an error log to the real%LOCALAPPDATA%\OpenClawTrayand is not redirected by environment variables.Why This Change Was Made
AccessibilityAppFixturenow builds the child environment through one helper,ApplyProfileIsolation. The helper removes every inheritedOPENCLAW_*variable, then sets all four profile roots (OPENCLAW_TRAY_DATA_DIR,OPENCLAW_TRAY_APPDATA_DIR,OPENCLAW_TRAY_LOCALAPPDATA_DIR, and the legacyOPENCLAW_TRAY_LOCAL_DATA_DIR, which must equal<localroot>\OpenClawTray) to the fixture's own directories. The fixture sets its own variables after the helper call. New pure tests cover the contract and guard that the single process start uses the helper.Evidence
Exact head
3f782f7a4dc69fd4a47a058db05ce13ac66a7025(treecc021aa7dc51d8d834c95e55470ccf051d17a3fb), one commit onde162ba66028681700b61b5cd106323ad78aa6e8. Scope: 2 files, +168/-1, both undertests\OpenClaw.Tray.UITests.AccessibilityFixtureIsolationTestsexecuted: 4 passed, 0 failed (TRX verified).main(c59652f9) withgit merge-tree: clean, no conflicts.maindid not change either touched file.Known limits:
FunctionalUI.cswrites an error log to the real%LOCALAPPDATA%\OpenClawTray. Environment variables cannot redirect it, so it is out of scope here.Environment[writes or alias writes, the stripping test samples three keys, and a renamed helper gives an unclear guard error. Debug switches such asOPENCLAW_TRAY_TRACEno longer reach the child by design.Change Type
Scope
winnodeRequired proof pools
none: test-only change to UI-test fixture environment setup.Get-CiChangeClassification.ps1classifies both paths astargeted (recognized-paths)with laneui_tests; it lists candidate pools only as inventory, and none claim applicability (no installer, signing, MXC, GPU, ARM64, Gateway or user-visible UI behavior changed).Validation
Run on the exact head with a clean worktree, opt-ins (
OPENCLAW_RUN_E2E,OPENCLAW_RUN_MXC_E2E) unset, and task-owned temp profile roots:./build.ps1: exit 0.dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj: 4644 passed, 25 skipped, 0 failed.dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj: 4507 passed, 0 failed.dotnet test tests/OpenClaw.Tray.UITests/OpenClaw.Tray.UITests.csproj -p:Platform=x64 --filter "FullyQualifiedName~AccessibilityFixtureIsolationTests": 4 passed, 0 failed. These tests are pure and launch no app.The full UI suite was not run locally. The planner configures a hosted
ui-testslane for these paths; at the last check (11:23 local) CI had not completed (change-classificationandAdvanced setup gatepassed;fast-validationandProof-pool contractspending;ui-testscompletion not observed).Real Behavior Proof
3f782f7a4dc69fd4a47a058db05ce13ac66a7025dotnet testcommand above.TwoRunsReceiveDistinctRootsForEveryVariable,ChildEnvironmentOverridesConflictingInheritedRootsAndLegacyAlias,FixtureLaunchPathsAllUseTheIsolationHelper,ChildEnvironmentDropsEveryInheritedOpenClawVariable.N/Aattachment-metadata.json,last-chat-state.json,openclaw-tray.log,tool-metadata.json) changed during the observation window. Attribution is not established: no process-owned evidence was collected, and the focused test process ran for 1.9 seconds and is designed to start no app.Security Impact
NoNoNoNoNo(test child processes now read less of the developer's environment and profile)Yes, explain the risk and mitigation: N/ACompatibility and Migration
YesNo(UI-test child environment only; no product configuration changes)NoReview Conversations