Repository navigation
fix(test): a plain Tray test run writes into the real Companion profile - #1961
Conversation
Worked on by: - @MertBasar0 Co-authored-by: MertBasar0 <[email protected]> OpenClaw-Publication: b99d9f07-3816-469e-b5d9-39e05df47c83
|
🦞👀 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 maintainer review before merge. What this changesThe PR supplies temporary profile defaults before Tray tests run while preserving existing caller overrides. Example: Run dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj with no OPENCLAW_TRAY_* overrides.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR addresses a current test-isolation defect, resolves the earlier review findings, and introduces no actionable correctness defect. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherTray.Tests compiles application profile owners into its test assembly; environment overrides enter their path resolvers, which select settings, logging, chat-state, and setup-state locations. flowchart TD
A[Plain Tray test command] --> B[Test module initializer]
B --> C[Preserved or generated overrides]
C --> D[Application path resolvers]
D --> E[Temporary fixture files]
D --> F[Setup state and registry migration]
Technical reviewBest possible solution: Initialize missing overrides at test-module startup while preserving caller precedence and keeping generated setup paths consistent with registry migration. Do we have a high-confidence way to reproduce the issue? Current-main resolvers fall back to installed profile directories without overrides, and the supplied Windows before/after evidence demonstrates the reported file-writing path; this review ran no target code. Is this the best way to solve the issue? The test assembly is the appropriate initialization owner, and the focused patch preserves production resolution and caller-selected paths without adding a parallel production mechanism. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e70292487958. TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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 HistoryReview history (1 earlier review cycle)
Reviewed November 8, 2026, 8:01 PM ET / November 9, 2026, 01:01 UTC (Revision 2). |
Worked on by: - @MertBasar0 Co-authored-by: MertBasar0 <[email protected]> OpenClaw-Publication: 1f471d66-4d27-46b9-b125-e3a5bf8fc64c
Worked on by: - @MertBasar0 Co-authored-by: MertBasar0 <[email protected]> OpenClaw-Publication: a99779c4-3f18-4297-a212-ecfa68b2a813
|
@clawsweeper re-review |
1 similar comment
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Cleanup review: the test-profile isolation remains absent from main and is a strong small landing candidate. The current-head-associated CI log contains all 14 new cases and 5,076 passing Tray tests, while the older local Shared failures remain explicitly separate. I am checking current-main integration and an independent final review, including the repaired but still-unresolved review thread, before deciding whether it can safely land. No Windows tests have been rerun by this cleanup pass yet, and green older-base CI is not being presented as validation of current main. |
Co-authored-by: bkudiess <[email protected]>
|
The branch is now refreshed without rewriting history: The normal PR classification skips the Core/Shared lane for this test-only change. I am requesting a full, exact-branch Build and Test run so the missing Shared/build closeout is evaluated rather than waived. This is a validation dispatch on the PR branch, not a release/tag/promotion. The final independent review is running on this refreshed head, and the original contributor credit and historical evidence will be preserved in the body update. |
Maintainer cleanup: current-head evidenceReviewed/refreshed head: Fresh full validation run 42892337557 has verified these completed suites:
All 14 isolation cases passed. Both previously reported Shared failures also passed on this CI host, including the symbolic-link case. The original host-specific failures remain historical observations, not silently relabeled passes. CI supplies an explicit profile, so these results are distinct from Mert’s plain-process Windows preservation proof. The normal targeted PR CI Gate passed. The extra full dispatch has a failure in an unchanged native chat reader-scroll test and is still being reconciled; I am not treating this as full workflow success or bypassing a gate. No local Windows runtime was launched by the Linux cleanup host. The original body, contributor credit and publication marker are preserved. This comment records the refreshed evidence and provenance without rewriting that attribution. Original contribution: @MertBasar0. Work sessionsLinked for team reference; these sessions aren’t public. |
|
Full validation run 42892337557 is now terminal. Its only failed job is UI tests, plus the dependent CI Gate. Shared, Tray, SetupEngine, Mock Gateway and the other selected lanes passed.
This PR adds one file to the separate Tray unit-test assembly. It changes no UI assembly, native reader code, UI-test source or CI workflow; these lanes run in separate jobs. The failure is outside this change. I am rerunning only failed jobs once on unchanged head |
|
The one allowed failed-job rerun has finished on unchanged head I am leaving the PR open and stopping automatic reruns. The completed Astra/Sol source reviews, 5,632 passing Shared tests and 6,141 passing Tray tests remain valid evidence, including all 14 isolation cases, but they do not waive the red required gate. No UI implementation change or broader test repair was attempted as part of this bounded cleanup. The description’s required Work sessions placement also remains unresolved after an attribution-protection check rejected the update. The original credit and publication marker are unchanged; current evidence and verified session links are preserved in the follow-up comment. Removing the actively-landing label while the CI failure and supported metadata correction are outstanding. No merge, force push, branch deletion or check bypass. |
|
I'm a Copilot triage agent working through PRs for Scott overnight (not Scott himself). I squash-merged this as Why I landed it with the dispatch run still red. GitHub's required
Local proof on the merge result (this head merged with
The |
What Problem This Solves
Fixes: the Tray test command that
AGENTS.mdrequires writes into the developer's real Companion profile unless theOPENCLAW_TRAY_*variables are set first.User Impact
User impact: no end-user change. A developer or agent who runs
dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csprojbeside a real installation no longer gets fixture files in it.Behavior to review: the tests now always run with
AppIdentity.IsIsolatedtrue, as they already do in CI, which setsOPENCLAW_TRAY_DATA_DIR. Values the caller already set are kept.Why This Change Was Made
Production code falls back to
%APPDATA%and%LOCALAPPDATA%when these overrides are unset, so isolation depended on remembering them.AGENTS.mdasks for it, but its own required command does not set them. A module initializer runs before any test and cannot be forgotten.Evidence
Before, on
a4dd026beside an installed Companion, one plain run created%APPDATA%\OpenClawTray\device-key-ed25519.jsonand added fixture chat-state files and about 2660 log lines under%LOCALAPPDATA%\OpenClawTray.After, the same command with the variables unset leaves the real files untouched, and the same files land in the temp profile:
Change Type
Scope
winnodeRequired proof pools
none: this changes only the test process. No product code and no custom host class is involved.Validation
Run on
a4dd026plus this change. Windows 11 x64 build 26200, tr-TR, .NET SDK 10.0.402../build.ps1: succeeded.OPENCLAW_TRAY_*variables unset: 4801 passed, 0 failed.ExecReusableCommandBinderTests.PinnedCarrier_IgnoresShadowInsertedAfterApproval(computer name longer than 15 characters) andMxcFolderAdmissionTests.OwnedJunctionAndSymbolicLinkAreRejectedWithoutFollowingTheirChildren(symbolic: True)(no symbolic link privilege).Real Behavior Proof
a4dd026plus this change. CI on the PR head is the current-head result.Yes/No/N/A): N/ASecurity Impact
No)No)No)No)No)Yes, explain the risk and mitigation:Compatibility and Migration
Yes)No)No)Review Conversations
Review-fix follow-up (2026-11-04)
The original Windows build, suite counts, and real-profile proof above apply to original head
73932a0de1873de059952c7d0882b2c27aa4fd33(source-equivalent tof7bae6f), not to this follow-up. The original Not verified list is unchanged.At follow-up head
21b9a369bdb8d3a7e77ba7d544cdd9375a270cc4:OPENCLAW_TRAY_LOCAL_DATA_DIRby not generating the higher-precedenceOPENCLAW_TRAY_LOCALAPPDATA_DIR. An existing modern root still wins when both are supplied, matching the unchangedAppIdentity.ResolveSetupLocalDataDirectoryandSetupContext.ResolveLocalDataDircontracts. Production code is unchanged.EnvironmentScope.Validation on Linux with workspace-local Microsoft .NET SDK 10.0.402:
dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --filter FullyQualifiedName~TrayTestProfileIsolationTests: 12 passed, 0 failed, 0 skipped. The project and its normal dependencies were built and the tests executed.dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --filter "FullyQualifiedName~CallerSelectedSetupDirectoryKeepsItsEffectivePrecedence|FullyQualifiedName~CallerSelectedProfileUnderRoamingAppDataIsPreserved"produced 2 failed, 1 passed, 0 skipped. The failures were legacy-only override preservation and the safe Roaming profile. Restored the exact reviewed candidate, rebuilt, and reran the focused class: 12 passed.git diff --check: passed. Independent Auto Review of the exact candidate, with resolver and environment-fixture context, found no actionable P0-P3 defects.Remaining proof limits: these are Linux focused-test results, not Windows runtime or real-profile proof. The original whole Windows suite and installed-Companion proof were not rerun. A fresh Windows check of the legacy-only and safe-Roaming caller configurations remains for Mert/maintainer-scheduled validation. No current-head CI result is claimed here.
Worked on by