Skip to content

fix(test): materialize OpenAI live auth profile - #129759

Merged
RomneyDa merged 5 commits into
mainfrom
fix/release-openai-auth-materialization
Aug 26, 2026
Merged

RomneyDa merged 5 commits into
mainfrom
fix/release-openai-auth-materialization

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Aug 26, 2026 •

Copy link
Copy Markdown
Member

Summary

  • materialize OPENAI_API_KEY into the selected gateway live harness's isolated SQLite auth store before profile-first discovery
  • put the generated OpenAI profile first without copying unrelated agent state
  • cover empty and pre-populated isolated stores

Root cause

Release Checks injected OPENAI_API_KEY, but the gateway live harness only loaded existing SQLite auth rows. OpenAI live selection intentionally uses profile-first auth, so an empty CI store produced zero runnable candidates before the gateway's later per-run isolation step.

The selected gateway harness now prepares the credential in its auth-profile store and persists it through the canonical SQLite owner before candidate lookup. Runtime auth remains profile-only; this does not add an environment fallback. Keeping this in the selected harness is required because release validation deliberately executes orchestration from a separate trusted-main checkout.

Evidence

The trusted exact-head live jobs remain the proof of the masked release credential's validity.

Scope

  • Production LOC: +0/-0
  • Tests/live harness: +86/-0
  • No config, protocol, schema-version, or runtime fallback changes

Exact-head isolation proof

  • 9c28cc393cc5b3986e7b72aaa485b1e23b39aa41: trusted OpenAI API-key-default live lane passed after moving discovery into disposable state.
  • Focused non-live suite: 147 passed, 2 skipped.
  • Regression proves the ambient auth profile store remains unchanged.
  • Full branch autoreview: clean (0.99).

@clawsweeper

clawsweeper Bot commented Aug 26, 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 size: S maintainer Maintainer-authored PR labels Aug 26, 2026
@openclaw-barnacle openclaw-barnacle Bot added the gateway Gateway runtime label Aug 26, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 26, 2026
@clawsweeper

clawsweeper Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 11:19 PM ET / August 26, 2026, 03:19 UTC.

ClawSweeper review

What this changes

The PR stores the injected OpenAI live-test key in disposable SQLite auth state before profile-first model discovery, then selects that generated profile explicitly.

Regression provenance

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

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open for protected maintainer handling. Current main still performs profile-first OpenAI selection without first materializing the injected credential; the exact PR head addresses that test-harness gap with disposable state and targeted coverage.

Priority: P1
Reviewed head: 9c28cc393cc5b3986e7b72aaa485b1e23b39aa41
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Strong exact-head live evidence and focused owner-boundary coverage support the repair; only the routine rebase refresh remains.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The PR body supplies an exact-head trusted OpenAI API-key live job showing successful after-fix candidate execution; redact any credentials in future evidence.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The PR body supplies an exact-head trusted OpenAI API-key live job showing successful after-fix candidate execution; redact any credentials in future evidence.
Evidence reviewed 6 items Current-main gap: Current main creates models.json and resolves candidate auth with profile-first precedence, but does not prepare a selected OpenAI profile before that lookup.
PR owner-boundary repair: The PR enters disposable state before discovery, materializes the profile there, persists it before models.json generation, and passes the selected profile ID to auth resolution.
Auth contract: OpenAI is explicitly profile-required in live-test mode, so staging a profile rather than adding an environment fallback matches the existing auth contract.
Findings None None.
Security None None.

Live Verification

Command: OPENCLAW_LIVE_TEST=0 pnpm test:live:gateway-profiles

Result: FAIL (failed) — step 1 run OPENCLAW_LIVE_TEST=0 pnpm test:live:gateway-profiles: previous terminal command was still running after 30 seconds: "OPENCLAW_LIVE_TEST=0 pnpm test:live:gateway-profiles"

$ node --import tsx scripts/test-live.mts -- src/gateway/gateway-models.profiles.live.test.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-129759-5ASiNs/target

Assertions:

  • FAIL expect_output: Test Files

How this fits together

Gateway live validation discovers provider models and credentials before starting an isolated gateway run. Its selected auth profiles determine which models become runnable candidates for the release-check prompt suite.

flowchart LR
A[Injected release credential] --> B[Disposable live-test state]
B --> C[SQLite auth profile]
C --> D[Profile-first model discovery]
D --> E[Runnable OpenAI candidate]
E --> F[Gateway prompt validation]
Loading

Decision needed

Question Recommendation
After rebasing on current main, should this protected maintainer PR land with its exact-head OpenAI live proof refreshed? Rebase and land: Refresh the exact-head live OpenAI lane after rebase, then land the isolated profile-materialization repair.

Why: The patch is a focused repair with no blocking finding, but the maintainer label requires explicit human handling and the live harness has advanced since the PR base.

Before merge

  • Resolve merge risk (P1) - The branch is behind current main; rebase and repeat the exact-head OpenAI live lane so the disposable-state boundary is exercised against the merge result.
Agent review details

Security

None.

PR surface

Tests +158. Total +158 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 160 2 +158
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 160 2 +158

Review metrics

Metric Value Why it matters
Production versus test LOC production +0/-0; tests +160/-2 The change is confined to the gateway live-test harness and adds regression coverage without changing shipped runtime behavior.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Rebase this focused test-only repair, preserve disposable pre-discovery auth staging, and rerun the exact-head OpenAI validation before landing.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Rebase this focused test-only repair, preserve disposable pre-discovery auth staging, and rerun the exact-head OpenAI validation before landing.

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

Yes, source establishes the path: profile-first OpenAI discovery with an empty isolated auth store yields no candidate despite an injected key; the linked trusted pre-fix and exact-head runs cover that scenario.

Is this the best way to solve the issue?

Yes. Persisting the generated profile in the disposable discovery store is the narrow owner-boundary repair; an environment fallback would contradict the existing profile-first contract.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body supplies an exact-head trusted OpenAI API-key live job showing successful after-fix candidate execution; redact any credentials in future evidence.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The PR body supplies an exact-head trusted OpenAI API-key live job showing successful after-fix candidate execution; redact any credentials in future evidence.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.
  • remove merge-risk: 🚨 compatibility: Current PR review selected no merge-risk labels.
  • remove merge-risk: 🚨 auth-provider: Current PR review selected no merge-risk labels.
  • remove merge-risk: 🚨 security-boundary: 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:

  • P1: This repairs an OpenAI release-validation path that otherwise yields no runnable candidate despite an injected credential.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The PR body supplies an exact-head trusted OpenAI API-key live job showing successful after-fix candidate execution; redact any credentials in future evidence.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body supplies an exact-head trusted OpenAI API-key live job showing successful after-fix candidate execution; redact any credentials in future evidence.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Current-main blame attributes the profile-store builder that this repair reuses to commit 5ce9b61. (role: introduced current live auth-store behavior; confidence: high; commits: 5ce9b61ceb16; files: src/gateway/gateway-models.profiles.live.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 (3 earlier review cycles)
  • reviewed 2026-08-26T02:07:35.571Z sha 2fabd49 :: needs changes before merge. :: [P1] Keep live credentials out of the host auth store
  • reviewed 2026-08-26T02:22:06.883Z sha bbd102a :: found issues before merge. :: [P1] Persist discovery auth only in disposable state
  • reviewed 2026-08-26T02:35:38.247Z sha 9c28cc3 :: needs maintainer review before merge. :: none

@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper re-review\n\nThe head changed materially after the active review began. Exact-head trusted OpenAI API-key-default proof is now green: https://github.com/openclaw/openclaw/actions/runs/32922170925/job/98038199357

@clawsweeper

clawsweeper Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper assist is taking a look at your question.

I queued a lightweight read-only assist pass. It will post a separate answer comment and will not edit the durable ClawSweeper review comment or trigger close, merge, repair, label, or branch changes.

Request: re-review\n\nThe head changed materially after the active review began. Exact-head trusted OpenAI API-key-default proof is now green: https://github.com/openclaw/openclaw/actions/runs/32922170925/job/98038199357

@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

The head changed materially after the active review began. Exact-head trusted OpenAI API-key-default proof is green: https://github.com/openclaw/openclaw/actions/runs/32922170925/job/98038199357

@clawsweeper

clawsweeper Bot commented Aug 26, 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:

@clawsweeper

clawsweeper Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper assist: The exact-head trusted OpenAI API-key-default job is green, but a full correctness re-review is still needed to confirm the prior P1 isolation concern is resolved.

Evidence:

Suggested next action: request @clawsweeper review for a fresh full review of the current head.


Source: #129759 (comment)
Assist reasoning: high.

@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Exact head 9c28cc3 resolves the prior P1 by entering disposable state before discovery and proving the ambient auth store remains unchanged. Trusted exact-head OpenAI API-key-default live proof: https://github.com/openclaw/openclaw/actions/runs/32923111099/job/98040942215

@clawsweeper

clawsweeper Bot commented Aug 26, 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:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 26, 2026
@clawsweeper clawsweeper Bot added the status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. label Aug 26, 2026
@RomneyDa
RomneyDa merged commit eb448db into main Aug 26, 2026
149 checks passed
@RomneyDa
RomneyDa deleted the fix/release-openai-auth-materialization branch August 26, 2026 16:47
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 27, 2026
* fix(test): materialize OpenAI live auth profile

* fix(test): stage OpenAI auth before discovery

* fix(test): bind prepared OpenAI live profile

* fix(test): prepare live auth before model generation

* test(gateway): isolate live auth discovery state
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor 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