Skip to content

test: stabilize auth and lifecycle fixtures - #129397

Merged
shakkernerd merged 7 commits into
mainfrom
test/auth-lifecycle-cleanups
Aug 25, 2026
Merged

shakkernerd merged 7 commits into
mainfrom
test/auth-lifecycle-cleanups

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Combine three test-only repairs for stale auth coverage, leaked fixture state, and heavyweight module loading.

Changes

Onboarding Ambient Discovery

#129052 removed Claude credential-file discovery when native Claude authentication ownership moved back to the CLI. Remove the obsolete Claude fixture while retaining Codex discovery coverage.

Compaction Runtime Context

Stop compaction context tests from depending on the non-isolated runner's global process-registry reset. Use a unique scope and same-instance cleanup for the integration case, while leaving ordering coverage with the dedicated process-reference suite.

Turn Model Differential

Mock unrelated thinking and message-channel helpers so the focused model-selection suite does not load heavyweight runtime barrels during collection.

Performance

  • model-selection suite: no output after 225.52 seconds before, 8/8 passing in 6.38 seconds after
  • compaction suite: 43/43 passing
  • onboarding suite: focused test passing locally and on Testbox

Verification

  • 52 combined focused tests
  • full embedded-agent CI group: compaction suite passing
  • formatting
  • repository guards from each focused patch
  • git diff --check
  • autoreview

@clawsweeper

clawsweeper Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels Aug 25, 2026
@shakkernerd
shakkernerd force-pushed the test/auth-lifecycle-cleanups branch from 06aea25 to 692a593 Compare August 25, 2026 15:04
@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 25, 2026
@clawsweeper

clawsweeper Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 12:08 PM ET / 16:08 UTC.

ClawSweeper review

What this changes

This PR updates three tests to remove retired Claude file-discovery coverage, guarantee compaction fixture cleanup, and isolate model-selection tests from heavyweight imports.

Merge readiness

✅ Ready for maintainer review

The prior cleanup finding is fixed: all registry and timer setup now falls inside fixture-owned cleanup scopes. No new patch defect was found; keep this maintainer-authored PR open for normal exact-head CI and merge handling.

Priority: P3
Reviewed head: c311e9fe49d1c67a5255ca1f0edcd92c11340101

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The updated cleanup scope addresses the prior blocker and the test-only patch is coherent.
Proof confidence 🌊 off-meta tidepool Not applicable: Maintainer-authored, test-only PR; contributor real-behavior proof is not applicable.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Maintainer-authored, test-only PR; contributor real-behavior proof is not applicable.
Evidence reviewed 5 items Fixture cleanup repaired: The try block now starts before fake timers, session construction, registry writes, context construction, and assertions; finally clears the registry and restores real timers.
Owner-boundary and sibling evidence: Compaction reads scoped process references through the registry helper, while the sibling attempt suite already owns registry cleanup with try/finally.
Current ambient-discovery contract: Onboarding’s ambient helper checks only Codex file credentials; the retained test exercises that owner boundary after the merged native-Claude-auth change.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs src/agents/embedded-agent-runner/compaction-runtime-context.test.ts src/agents/command/model-selection.turn-model-differential.test.ts src/commands/onboard-inference-ambient.test.ts

Result: PASS (completed)

node scripts/run-vitest.mjs src/agents/embedded-agent-runner/compaction-runtime-context.test.ts src/agents/command/model-selection.turn-model-differential.test.
ts src/commands/onboard-inference-ambient.test.ts
runner@runnervm76f27:/tmp/clawsweeper-live-proof-129397-6djlP8/target$ node scripts/run-vitest.mjs src/agents/embedded-agent-runner/compaction-runtime-context.t
est.ts src/agents/command/model-selection.turn-model-differential.test.ts src/commands/onboard-inference-ambient.test.ts
node scripts/run-vitest.mjs src/agents/embedded-agent-runner/compaction-runtime-context.test.ts src/agents/command/model-selection.turn-model-differential.test.
ts src/commands/onboard-inference-ambient.test.ts
[test] starting test/vitest/vitest.commands.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-129397-6djlP8/target

 ✓  commands  src/commands/onboard-inference-ambient.test.ts (1 test) 98ms

 Test Files  1 passed (1)
      Tests  1 passed (1)
   Start at  16:09:53
   Duration  1.41s (transform 1.10s, setup 965ms, import 25ms, tests 98ms, environment 0ms)

[test] starting test/vitest/vitest.agents-embedded-agent.config.ts

































Assertions:

  • PASS expect_output: passed

How this fits together

These tests cover onboarding’s ambient credential discovery and agent runtime preparation. They use local filesystem, process-registry, and import fixtures to keep focused test behavior isolated from unrelated runtime state.

flowchart LR
  A[Credential fixture] --> B[Onboarding discovery]
  C[Process fixture] --> D[Compaction context]
  E[Focused mocks] --> F[Model selection]
  B --> G[Focused test results]
  D --> G
  F --> G
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests 0. Total 0 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 3 79 79 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 79 79 0

Review metrics

Metric Value Why it matters
Production versus test LOC production +0/-0; tests +79/-79 (net 0) All changes are colocated test fixtures, so the patch does not alter production runtime behavior.

Root-cause cluster

Relationship: canonical
Canonical: #129397
Summary: This PR combines the useful test-only changes from three earlier closed, unmerged PRs into one reviewable branch.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Land the focused fixture repairs once exact-head CI completes successfully; keep the model-selection differential suite limited to its selection contract.

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

Not applicable: this PR repairs test isolation rather than reporting a user-facing behavior defect; its focused test results are reported in the PR body.

Is this the best way to solve the issue?

Yes. Cleanup is now owned by each registry-mutating fixture, and the import mocks follow the scoped guidance for focused, import-bound agent tests.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Maintainer-authored, test-only PR; contributor real-behavior proof is not applicable.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove merge-risk: 🚨 automation: Current PR review selected no merge-risk labels.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P3: This is low-risk test-fixture stabilization with no production behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Maintainer-authored, test-only PR; contributor real-behavior proof is not applicable.

Evidence

What I checked:

Likely related people:

  • steipete: Recent history includes compaction-target consolidation and process-session ordering work on the owners exercised by this fixture. (role: recent compaction and process-runtime contributor; confidence: high; commits: 59ea107d094f, 9e3d7c93cfac, 15fd32a540a0; files: src/agents/embedded-agent-runner/compaction-runtime-context.ts, src/agents/bash-process-references.ts, src/agents/bash-process-registry.ts)
  • obviyus: The merged native Claude authentication change identified in the PR context is why the obsolete Claude file-discovery expectation is being removed. (role: introduced adjacent native-Claude-auth policy; confidence: medium; commits: 750a64e7cd4a; files: src/commands/onboard-inference-ambient.test.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-25T15:11:04.421Z sha 692a5937f85c4ca0c5451a52e94932cbb7812480 :: needs changes before merge. :: [P2] Enclose all fixture setup in the cleanup scope

@shakkernerd shakkernerd self-assigned this Aug 25, 2026
@shakkernerd
shakkernerd force-pushed the test/auth-lifecycle-cleanups branch 2 times, most recently from 6c3b416 to c311e9f Compare August 25, 2026 16:02
@clawsweeper clawsweeper Bot added 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 25, 2026
@shakkernerd
shakkernerd force-pushed the test/auth-lifecycle-cleanups branch from c311e9f to b85bc4b Compare August 25, 2026 16:37
@shakkernerd
shakkernerd merged commit 606bf4d into main Aug 25, 2026
112 of 114 checks passed
@shakkernerd
shakkernerd deleted the test/auth-lifecycle-cleanups branch August 25, 2026 16:39
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Improved: Auth and lifecycle tests now isolate process state, retain current ambient-auth coverage, and avoid unrelated runtime imports.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 26, 2026
Stabilize auth and lifecycle test fixtures by removing retired Claude file-auth coverage, isolating process registry state, and avoiding heavyweight turn-model imports.

Refs openclaw#129052.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling commands Command implementations maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant