Skip to content

test(e2e): share canonical auth store reader - #126960

Merged
vincentkoc merged 2 commits into
mainfrom
codex/fix-shared-auth-e2e-126916
Aug 24, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
codex/fix-shared-auth-e2e-126916

Conversation

@steipete

@steipete steipete commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Closes #126916.

What Problem This Solves

Fresh onboarding stores shared auth profiles in state/openclaw.sqlite, but the release-scenario and Codex-on-demand assertions still opened the retired per-agent auth store. They could report missing credentials even though onboarding had persisted the canonical shared row correctly.

PR #126958 independently fixed the npm-onboard reader. This PR keeps that work in one shared E2E owner and fixes the remaining release-scenario and Codex-on-demand siblings.

Why This Change Was Made

The shared E2E auth-profile owner now reads state/openclaw.sqlite / auth_profile_stores / shared. npm-onboard, fresh release scenarios, and Codex-on-demand all consume that helper instead of maintaining separate storage queries.

Fresh proof rejects retired primary rows in auth_profile_store and auth_profile_state, but permits the main-agent SQLite database when it contains unrelated runtime state. Corrupt databases and auth-table view substitutions fail closed. Existing payload validation still rejects missing or malformed environment references and inline/raw OpenAI keys.

This is release-harness support only. It does not change runtime auth persistence, add eager agent-directory creation, or copy credentials into the retired store.

User Impact

Package and release acceptance can verify fresh reference-mode onboarding through downstream Doctor and agent checks instead of failing on a retired storage assumption.

Evidence

  • Exact product failure: Package Acceptance run 32437479569, job 96644508843, target a434545620127a3105699513d662395a43b43eb1. Onboarding exited 0; the stale assertion failed before downstream product checks.
  • Current-main integration: contributor commit replayed with authorship preserved onto c8514ed20a3ba32f218b7f114ae7bbfac44e55c6; exact PR head 969dad159ea8e96ce45d36be5621f6403af18433.
  • node scripts/run-vitest.mjs test/scripts/auth-profile-store-assertions.test.ts test/scripts/npm-onboard-channel-agent-assertions.test.ts test/scripts/release-scenarios-assertions.test.ts test/scripts/codex-install-assertions.test.ts - 65/65 passed.
  • Current merge-result proof against origin/main b0d6fff9f951bf709e37bae396628446f01cb2cd: the same four focused suites passed 65/65 in 8.42s, then the no-commit merge was aborted and the exact PR head restored cleanly.
  • Focused packaged Docker proof: pnpm test:docker:release-typed-onboarding passed on Testbox tbx_01m0rk0sxc0j9xtw1xrjje0991 after building the exact checkout package. Run 32677081321, command 6m17s, exit 0.
  • Retained current merge-result Docker proof: the same packaged typed-onboarding command passed on Testbox tbx_01m0rm2eykqrv13qjn05dyr4gh against 969dad159ea8e96ce45d36be5621f6403af18433 merged with b0d6fff9f951bf709e37bae396628446f01cb2cd. Run 32678012644, command 6m03s, exit 0; Blacksmith then stopped the successful one-shot lease.
  • node scripts/check-docker-e2e-boundaries.mts - passed.
  • node scripts/check-no-raw-http2-imports.mts - passed.
  • git diff --check and the changed-file formatting/temp-directory guards - passed.
  • Exact-head repository CI passed with zero failures or pending checks, and ClawSweeper found no blocking correctness or security issue for 969dad159ea8e96ce45d36be5621f6403af18433.

Regression provenance: the fresh shared-auth ownership transition merged in #126783 / a8a9f284fb91af6a9d78fe66f9141eb01e009b21 and explicitly proved that fresh onboarding does not persist auth in the per-agent store. This change brings all fresh package assertions forward to that contract.

AI-assisted: Amp and Codex. The runtime owner, fresh-onboarding callers, legacy-upgrade siblings, fixtures, exact package failure, and #126958 overlap were reviewed directly.

@clawsweeper

clawsweeper Bot commented Aug 21, 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 scripts Repository scripts size: M maintainer Maintainer-authored PR labels Aug 21, 2026
@steipete
steipete marked this pull request as ready for review August 21, 2026 03:01
@steipete
steipete force-pushed the codex/fix-shared-auth-e2e-126916 branch from 2e0b41e to 7a158fb Compare August 21, 2026 03:07
@steipete steipete changed the title test(e2e): read shared auth store after onboarding test(e2e): share canonical auth store reader Aug 21, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. labels Aug 21, 2026
@clawsweeper

clawsweeper Bot commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 23, 2026, 8:39 PM ET / August 24, 2026, 00:39 UTC.

ClawSweeper review

What this changes

The PR centralizes fresh-install E2E reads of the shared auth-profile SQLite row and updates release, npm-onboard, and Codex-on-demand assertions to use it.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep open. The PR is still necessary: current main’s affected E2E assertions retain retired per-agent reads, while fresh auth ownership persists the shared row in the state database. No blocking correctness or security finding was identified; exact-head integration validation remains the merge gate.

Priority: P2
Reviewed head: 969dad159ea8e96ce45d36be5621f6403af18433

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch follows the runtime owner’s shared-store contract with focused regression coverage; current-head integration validation is the remaining confidence reducer.
Proof confidence 🌊 off-meta tidepool Not applicable: Not applicable: this MEMBER-authored PR changes E2E test support, and the supplied evidence includes the prior package-acceptance failure plus focused test coverage.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Not applicable: this MEMBER-authored PR changes E2E test support, and the supplied evidence includes the prior package-acceptance failure plus focused test coverage.
Evidence reviewed 6 items Canonical runtime ownership: The auth-profile owner reads fresh shared credentials from auth_profile_stores using the shared key when the database target is shared-state.
Current-main gap: The comparison against current main shows the three affected assertion consumers still had their own stale reader logic; the proposed head replaces those reads with the shared reader.
PR owner-boundary repair: The new E2E-only reader queries the shared row and separately rejects retired primary auth rows without requiring an unrelated agent database to be absent.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs test/scripts/auth-profile-store-assertions.test.ts test/scripts/npm-onboard-channel-agent-assertions.test.ts test/scripts/release-scenarios-assertions.test.ts test/scripts/codex-install-assertions.test.ts

Result: PASS (completed)

node scripts/run-vitest.mjs test/scripts/auth-profile-store-assertions.test.ts test/scripts/npm-onboard-channel-agent-assertions.test.ts test/scripts/release-sc
enarios-assertions.test.ts test/scripts/codex-install-assertions.test.ts
runner@runnervm76f27:/tmp/clawsweeper-live-proof-126960-I7r2I6/target$ node scripts/run-vitest.mjs test/scripts/auth-profile-store-assertions.test.ts test/scrip
ts/npm-onboard-channel-agent-assertions.test.ts test/scripts/release-scenarios-assertions.test.ts test/scripts/codex-install-assertions.test.ts
node scripts/run-vitest.mjs test/scripts/auth-profile-store-assertions.test.ts test/scripts/npm-onboard-channel-agent-assertions.test.ts test/scripts/release-sc
enarios-assertions.test.ts test/scripts/codex-install-assertions.test.ts
[test] starting test/vitest/vitest.tooling.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-126960-I7r2I6/target

 ✓  tooling  test/scripts/codex-install-assertions.test.ts (31 tests) 1837ms
 ✓  tooling  test/scripts/npm-onboard-channel-agent-assertions.test.ts (13 tests) 727ms
 ✓  tooling  test/scripts/release-scenarios-assertions.test.ts (12 tests) 474ms
 ✓  tooling  test/scripts/auth-profile-store-assertions.test.ts (9 tests) 21ms

 Test Files  4 passed (4)
      Tests  65 passed (65)
   Start at  00:40:15
   Duration  3.63s (transform 306ms, setup 78ms, import 107ms, tests 3.06s, environment 0ms)

[test] passed 1 Vitest shard in 9.30s
runner@runnervm76f27:/tmp/clawsweeper-live-proof-126960-I7r2I6/target$ node scripts/run-vitest.mjs test/scripts/auth-profile-store-assertions.test.ts test/scrip
ts/npm-onboard-channel-agent-assertions.test.ts test/scripts/release-scenarios-assertions.test.ts test/scripts/codex-install-assertions.test.ts




























Assertions:

  • PASS expect_output: Test Files

How this fits together

Fresh onboarding records shared provider credentials in the global state SQLite database. Release and package E2E scenarios consume that state to verify onboarding before continuing to channel setup, Doctor, and agent execution.

flowchart LR
  Onboarding[Fresh onboarding] --> SharedStore[Shared state database]
  LegacyStore[Retired agent database] --> LegacyCheck[No primary auth rows]
  SharedStore --> Reader[Shared E2E auth reader]
  LegacyCheck --> Assertions[Release and install assertions]
  Reader --> Assertions
  Assertions --> Acceptance[Package acceptance result]
Loading

Before merge

  • Resolve merge risk (P1) - The focused run recorded in the PR body targets the earlier head 7a158fb; current head 969dad1 adds schema and retired-row hardening, so the focused suite should pass on the current merge result before landing.
Agent review details

Security

None.

PR surface

Tests +198, Other +38. Total +236 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 4 223 25 +198
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 5 121 83 +38
Total 9 344 108 +236

Review metrics

Metric Value Why it matters
Production versus test delta production +0/-0; E2E test support +121/-83; tests +223/-25 The growth is confined to a shared assertion owner and regression fixtures; no shipped runtime behavior or configuration surface changes.

Stored data model

Persistent data-model change detected: database schema: test/scripts/auth-profile-store-assertions.test.ts, database schema: test/scripts/codex-install-assertions.test.ts, database schema: test/scripts/release-scenarios-assertions.test.ts, serialized state: scripts/e2e/lib/codex-on-demand/assertions.mjs, serialized state: test/scripts/release-scenarios-assertions.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #126916
Summary: This PR is the candidate repair for the canonical stale-auth-assertion report; the prior merged PR covered only the npm onboarding sibling.

Members:

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

Merge-risk options

Maintainer options:

  1. Validate the current merge result (recommended)
    Run the four focused assertion suites against the current merge result so the new hardening and current-main integration are both covered.

Technical review

Best possible solution:

Land one shared E2E auth-store reader after the current merge-result suite confirms all three scenario consumers preserve the fresh shared-store and legacy-row invariants.

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

Yes—source-reproducible: current main’s assertion consumers read retired per-agent tables while the auth owner writes fresh shared credentials to state/openclaw.sqlite; the PR body also records the matching package-acceptance failure.

Is this the best way to solve the issue?

Yes. One E2E-local reader removes three divergent storage queries while keeping the explicit check that fresh onboarding leaves no retired primary auth rows.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a bounded release-acceptance assertion repair that can otherwise block package validation after successful onboarding.
  • merge-risk: 🚨 automation: The PR changes release and package E2E assertions, so an incorrect storage read could mask or falsely report onboarding failures.
  • 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: Not applicable: this MEMBER-authored PR changes E2E test support, and the supplied evidence includes the prior package-acceptance failure plus focused test coverage.

Evidence

What I checked:

Likely related people:

  • steipete: Auth ownership commit a8a9f28 established the fresh shared-state contract that these assertions must follow. (role: introduced the shared-auth ownership transition; confidence: high; commits: a8a9f284fb91; files: src/agents/auth-profiles/sqlite.ts, src/agents/auth-profiles/shared-store-bootstrap.ts)
  • RomneyDa: Merged commit be891d2 repaired the npm onboarding sibling for the same shared-auth storage transition. (role: recent E2E assertion contributor; confidence: high; commits: be891d2ac0ab; files: scripts/e2e/lib/npm-onboard-channel-agent/assertions.mjs)
  • vincentkoc: Current head 969dad1 adds the checked shared reader and regression coverage. (role: current assertion hardening contributor; confidence: high; commits: 969dad159ea8; files: scripts/e2e/lib/auth-profile-store-assertions.mjs, test/scripts/auth-profile-store-assertions.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Run the four focused assertion suites on the current merge result and retain the redacted output with the PR.

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 (5 earlier review cycles)
  • reviewed 2026-08-21T03:13:21.990Z sha 7a158fb :: needs maintainer review before merge. :: none
  • reviewed August 20, 2026, 11:43 PM ET / August 21, 2026, 03:43 UTC sha unknown :: needs maintainer review before merge. :: none
  • reviewed 2026-08-22T21:14:47.468Z sha 7a158fb :: needs maintainer review before merge. :: none
  • reviewed 2026-08-22T21:34:31.306Z sha 7a158fb :: needs maintainer review before merge. :: none
  • reviewed 2026-08-22T21:56:42.261Z sha 7a158fb :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added clawsweeper-recovery-stuck merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. and removed clawsweeper-recovery-stuck labels Aug 22, 2026
@vincentkoc vincentkoc self-assigned this Aug 24, 2026
@vincentkoc
vincentkoc force-pushed the codex/fix-shared-auth-e2e-126916 branch from 7a158fb to 969dad1 Compare August 24, 2026 00:34
@vincentkoc

Copy link
Copy Markdown
Member

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@vincentkoc
vincentkoc merged commit 8b18d22 into main Aug 24, 2026
165 checks passed
@vincentkoc
vincentkoc deleted the codex/fix-shared-auth-e2e-126916 branch August 24, 2026 01:00
@vincentkoc

Copy link
Copy Markdown
Member

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 24, 2026
* test(e2e): read shared auth store after onboarding

* test(e2e): harden shared auth proof

---------

Co-authored-by: Amp <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: M 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.

test(e2e): onboard auth-profile assertion reads the pre-migration per-agent store

3 participants