Repository navigation
Conversation
Guard default tray test processes before linked owners cache paths, preserve safe explicit roots and reject real profiles. Add a discovery-free subprocess regression and stop reading real settings contents in the settings isolation test. 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 isolates tray test profile paths before static initialization and replaces real settings-content reads with metadata checks. Example: A developer runs Tray.Tests on Windows without profile overrides.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep open: this maintainer-authored PR addresses a source-confirmed test-isolation defect, and no introduced correctness bug was found. Priority: P2 Before merge
FindingsNone. Agent review detailsHow this fits togetherTray.Tests compiles application profile owners directly; a test-only module initializer supplies their environment overrides, and a reflection subprocess observes the resulting paths. flowchart TD
A[Direct tray test run] --> B[Test module initializer]
B --> C[Validated profile overrides]
C --> D[Linked application path owners]
D --> E[Isolated test files]
F[Reflection subprocess] --> D
Technical reviewBest possible solution: Keep the isolation guard at test-module startup and retain the fresh-process regression without changing shipped profile resolution. Do we have a high-confidence way to reproduce the issue? Current-main profile resolvers fall back to real Windows profiles without overrides, and the existing isolation test reads real settings contents; the author's initializer-removal negative control supports the startup failure path. Is this the best way to solve the issue? The test module owns the earliest reliable initialization boundary, and the separate reflection process checks cached application paths without test discovery or settings construction. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 51f18c1222c9. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
Review metrics
LabelsLabel 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 Reviewed October 22, 2026, 5:09 AM ET / 09:09 UTC. |
What Problem This Solves
Fixes: direct Tray.Tests runs can read or write a developer's real tray profile when no isolation overrides were supplied.
User Impact
User impact: no shipped application behavior changes. Local Tray.Tests processes get isolated defaults before linked application code can cache profile paths.
Why This Change Was Made
A test-only module initializer fills missing profile overrides and rejects explicit real release/dev profile paths before changing the environment. Safe caller overrides remain intact, including the effective legacy-only setup path.
Tray's direct local and roaming resolvers use only
OPENCLAW_TRAY_DATA_DIR, so that override is supplied independently even when modern roaming/local roots exist. The modern roots remain available to their own consumers. A small reflection subprocess checks actual static paths without test discovery or application, provider, settings, or logger construction.The existing settings isolation test now inspects real-file metadata only. Its synthetic owned settings still have exact path and saved-value assertions.
Evidence
Source and final test-evidence review: dedicated independent Claude Opus reviewer cleared commit
734aa41aa11f61c1dcca6f314196bdbc518a7e97for draft publication, with no P0/P1/P2 findings. This is not application or Gateway runtime proof.[ModuleInitializer]Two earlier build intervals saw the real local tray log grow by 365 bytes at
2026-10-22T08:12:59.7561717Zand2026-10-22T08:21:05.2982567Z. Those intervals overlapped other workstreams and remain unattributed. They are preserved as failed isolation receipts, not erased by later passes. No other real-profile metadata changed. A quiet no-reuse build and the final ordinary environment-only build and full suites did not reproduce the changes. Quiet scheduling and worker isolation changed together, so no specific writer or historical fix is claimed. No real-profile bytes were read, restored, hashed, or deleted.Change Type
Scope
winnodeRequired proof pools
none: test-process initialization only. No shipped application, native UI, Gateway, installer, or node-command behavior changes.Validation
Normal commands started with task-owned
OPENCLAW_TRAY_DATA_DIR,OPENCLAW_TRAY_APPDATA_DIR,OPENCLAW_TRAY_LOCALAPPDATA_DIR, and the legacy directOPENCLAW_TRAY_LOCAL_DATA_DIR, plusOPENCLAW_REPO_ROOTandDOTNET_GENERATE_ASPNET_CERTIFICATE=false. Final mandatory commands also set process-localMSBUILDDISABLENODEREUSE=1,DOTNET_CLI_USE_MSBUILD_SERVER=0, andUseSharedCompilation=false; they use unmodified commands, with no PATH shim or shared build-server shutdown. The intentionally empty/partial override inputs are limited to the pure reflection regression children. Build and test commands are serial.dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --filter 'FullyQualifiedName~TrayTestProfileIsolationTests|FullyQualifiedName~SettingsManagerIsolationTests.OpenClawTrayDataDirRedirectsSettingsAwayFromRealAppData' --logger 'trx;LogFileName=focused.trx' --results-directory <unique-run-directory>dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --filter 'FullyQualifiedName~TrayTestProfileIsolationTests.FreshTestHost' --logger 'trx;LogFileName=focused.trx' --results-directory <unique-negative-control-directory>pwsh -NoProfile -File .\build.ps1dotnet build .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csprojdotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore --logger 'trx;LogFileName=shared.trx' --results-directory <unique-run-directory>dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore --logger 'trx;LogFileName=tray.trx' --results-directory <unique-run-directory>Source manifests were unchanged within each run. Final mandatory runs used clean commit
734aa41aa11f61c1dcca6f314196bdbc518a7e97. The focused source matches that committed tree; the negative-control source differs by removal of the initializer attribute only. Shared skips cover existing hardware/integration cases and are not claimed as custom proof.Real Behavior Proof
734aa41aa11f61c1dcca6f314196bdbc518a7e97, base51f18c1222c996fb6fa2eb4d7e8d668492103a0e.Passed! - Failed: 0, Passed: 24, Skipped: 0, Total: 24. Negative control reportsStartup isolation did not establish an isolated direct profile.orStartup isolation resolved a real tray profile.before file/log owner access.Yes/No/N/A): N/A. Evidence is copied process/TRX output; private local artifacts are not public proof links.Security Impact
Yes/No): No.Yes/No): No.Yes/No): No.Yes/No): No shipped surface. Tests add a dependency-free reflection subprocess.Yes/No): Yes, tests use isolated defaults and stop reading real settings bytes.Yes, explain the risk and mitigation: explicit lexical paths into real release/dev profiles are rejected before environment mutation. Existing 8.3, junction, and symlink aliases are not canonicalized, so callers must supply genuinely task-owned roots. No production profile cleanup is performed.Compatibility and Migration
Yes/No): Yes for shipped application behavior and safe explicit test roots.Yes/No): Yes, test processes fill unset/blank tray isolation overrides; relative or real-profile overrides fail closed.Yes/No): No.Review Conversations