Skip to content

perf(auth-profiles): detect auth sources through the auth readers - #164992

Merged
steipete merged 3 commits into
mainfrom
dbasync/authsource
Oct 4, 2026
Merged

steipete merged 3 commits into
mainfrom
dbasync/authsource

Conversation

@steipete

@steipete steipete commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Runtime auth-source detection performs native SQLite source/read-pool/table checks before loading credentials. In the unchanged sqlmeasure3 workload, this lane accounts for six MAIN-thread SQL calls per warmed turn. Tool discovery and several indirect callers also reach the synchronous probe.

Why This Change Was Made

Use the existing shared and agent auth readers for runtime source detection, capturing physical targets before yielding and retaining readers through classification and cleanup. Preserve missing database/table/row routing, state-only sources, and present-unreadable refusal. Classify store and state cells independently so a broken state table cannot make an absent credential row appear present.

Migrate model/session fallback, provider usage, cron preparation, inline skills, compaction, tool inventory and worker-turn preparation. Carry the resulting presence fact through synchronous image/media/PDF factories; retain lazy web-search probing through the existing selection owner. Inventory callers await preparation before releasing their runtime lease. Public synchronous coding-tool construction remains compatible and does not expose the internal preparation option.

User Impact

Auth-source checks move off the caller thread without changing credential precedence or fallback behavior. Existing auth readers, admission, transports and lifecycle remain the owners; no new service, cache, schema, retention, durability or environment-variable names. Update behavior is unchanged, so the conditional update cell does not apply.

Production diff: +420 / −59 / net +361 across 36 production files (479 changed production lines). The broader file count is the complete caller cutover plus fixture updates and worker-access documentation. Native kernels remain for documented Doctor/CLI and released synchronous SDK compatibility; static T1 is 895 → 895.

Known overlaps: #162433 (umbrella design) and #155584 (shared auth selection). The concurrent delegate-exec lane also touches worker-tool-authority.ts; this PR changes only source preparation. Usage bookkeeping from #164240 and #164588 is outside this lane. The existing other-owner session authority read at src/gateway/worker-environments/worker-turn-transcript-target.ts:29 remains follow-up debt; moved-operation boundary tests do not claim zero SQL for the entire worker flow.

Evidence

Base: 82adb7a49d36e844e4ea1989bc5d865abac916f0, the fresh origin/main at task start. Measured candidate: 451b5bb3aa99b29bfa8482ecee392a9ee3b6540f. Landing candidate: 77d2e0c9bdf123b2484dd9b7d15ea857fc51dff0.

The unchanged local sqlmeasure3 harness/observer ran on Node 24.21.0 / SQLite 3.53.4 with source maps. Both revisions completed 13/13 turns, the native child, cron, all RPCs, committed compaction and graceful shutdown. All disk stores were inside synthetic fixtures; owned processes and harness staging were cleaned up.

Successful SQL statements Before After
Authsource MAIN, ten warmed turns 60 0
Authsource MAIN per warmed turn 6.0 0.0
Authsource MAIN, complete workload 94 0
Overall MAIN, complete workload 7,824 7,792
Overall MAIN, ten warmed turns 2,223 2,245
Overall MAIN per warmed turn 222.3 224.5
Worker-thread SQL, complete workload 37,761 38,166
Helper-process SQL, complete workload 486 648
All SQL, complete workload 46,071 46,606

Target sites, using baseline line numbers: auth-profiles/sqlite-read-pool.ts:161 busy-timeout checks 10 → 0; :162 user-version checks 10 → 0; auth-profiles/sqlite-json.ts:68 table checks 20 → 0; :91 store reads 10 → 0; :98 state reads 10 → 0, across ten warmed turns. No after MAIN stack contains either source module anywhere in the workload.

This proves the moved operations leave MAIN; it does not show fewer total statements or an overall warmed reduction. Outside authsource, the warmed difference is +82: +80 scheduled/reconciliation statements (cron 34, GitHub OAuth/publication 30, placement 16), +9 existing pending-input current-custody statements, −5 foreground/freshness statements and −2 plugin startup-cleanup statements. The nine custody statements are foreground authority work, not background; one run does not establish their trigger or deterministic overhead from this change. Those producers are unchanged.

Runtime wall time was 83.24 → 198.31 s and maximum RSS 2,983,608,320 → 2,642,509,824 bytes; host contention and instrumentation make these diagnostic only. Failed SQL is excluded from successful counts: one before and two after worker-only BEGIN IMMEDIATE busy failures during audit shutdown; no MAIN errors. Build-stamp and stale-lock guards were respected during test-fixture repair; the final clean-source build passed before measurement.

The source-boundary regressions cover zero caller-thread SQL, missing/table-missing/state-only/unreadable routing, physical shared-root capture across environment mutation, and primary-error classification when cleanup also fails. Negative controls failed against the original native probe, the original undefined-hint fallback, and the pre-fix cleanup path.

All focused runs use pnpm test <files> --maxWorkers=1. Local wall times include transform/build costs and contention; these are not measured CI seconds. Hosted CI seconds are not yet available.

Focused proof Result Wall time
Source/readers, fallback, model helpers, web search, skills and provider usage (13 files) 216 passed 528.08 s
Repaired inventory, directives, compaction and session override fixtures (5 files) 173 passed 270.07 s
Final source cleanup, directive fixture and cron preparation (3 files) 105 passed 297.22 s
Tool-inventory cache regression (1 file) 1 passed 239.54 s
Progress-card inventory caller (1 file) 5 passed 190.06 s
Shared-registry rule: runtime process graph plus all nine import-closure files 29 passed / 10 files 510.59 s

Initial inventory fixture failures exposed an unintended real host-broker call from storage-free metadata tests; explicit source mocks fixed those fixtures. Mock-baseline maintenance removes exactly eight obsolete entries with no additions. The complete typecheck also caught a missed progress-card test caller; it now awaits inventory preparation, with all five focused cases passing. Final Madge: zero cycles (141.21 s). The database-worker ratchet passes with no T1 growth and zero new OPENCLAW_* names.

Authoring P2 Codex autoreview against the pinned base in private TMPDIR is scoped-clean, including the final test-only correction. An earlier static concern was independently checked against source: optional-media availability planning never calls hasAuthProfileForProvider or a source probe. openclaw-tools.media-factory-plan.ts:198 consumes the supplied store via tools/manifest-capability-availability.ts:122–127 and auth-profiles/profile-list.ts:14–18; actual media/PDF constructors receive the prepared fact through the existing options spread in openclaw-tools.ts:172–196.

Local SDK API diff completed in realpath private TMPDIR against the pinned base and production commit 8ba553d1ef4e7699f49fa84b2c98955162b14663 (digest ab62668d). Measured commit 451b5bb3aa99b29bfa8482ecee392a9ee3b6540f changes only the progress-card test; production inputs are identical. No entrypoints added or removed. The report marks 127 exports affected through seven unique reachable-declaration changes: the async helper, optional environment/prepared-presence inputs, and the existing public factory’s Omit list. The public factory remains synchronous and excludes the new internal hint, preserving its accepted option shape; no Gateway-context service method signature changes.

node scripts/check-changed.mjs --base 82adb7a49d36e844e4ea1989bc5d865abac916f0 completed with exit 0 (1,960.39 s), including all core/test type graphs, ratchets, format/lint, unused-export scans and runtime architecture guards. Runtime import cycles: zero. git diff --check passed. SDK comparison including checkout cleanup completed with exit 0 (1,360.78 s).

Released SDK check: inspected v2026.9.8 (latest release tag), including src/plugin-sdk/agent-harness.ts, src/agents/agent-tools.ts, SDK exports, src/plugins/runtime, and documented plugin contracts. The async conversions (resolveEffectiveToolInventory, resolveWorkerToolAuthority, hasUsableWebSearchProvider) are internal. The released createOpenClawCodingTools remains synchronous with its accepted input shape unchanged; the new preparation hint is omitted at that boundary and covered by the existing SDK type test. No released contract is retired, so no new deprecation record is required.

Landing corrections and verification

The original CI attempt 37213979573 exposed two PR-caused failures: shared auth-row corruption no longer evicted its cached handle, and the storage-free ACP fallback fixture entered host-broker admission. Each failing file was run five times at the original head and five times at the merge base in isolated Linux worktrees: all ten head invocations failed the expected cases, and all ten baseline invocations passed. The correction restores native shared-state error propagation to the existing eviction owner and uses the existing auth-runtime opt-out in the ACP policy fixture. No inherited-failure exception is claimed for either original failure.

Further review found that a retained media tool could keep a construction-time negative source fact after the first credential was published. Deferred media selection and listing now refresh that negative through the existing async reader. Supplied auth-store snapshots keep their existing lifetime, explicit model paths stay lazy, and undefined SDK/CLI compatibility inputs retain their prior behavior. Provider checks also honor an absent source before loading the canonical credential store. Negative controls reproduced both stale provider readiness on the same retained tool and the unwanted synchronous store load.

The landing corrections do not change released SDK signatures, reader transports, schemas, stored formats, retention, or admission policy. The new helper is internal; the released SDK comparison above remains applicable to the public declarations. The original SQL measurement remains bound to its measured candidate rather than being presented as a rerun of the landing head.

Validation: the two initial CI repairs passed 122 focused tests locally (938.32 s). An isolated Linux checkout verified the correction file hashes, passed ten focused media/auth test files (139 s), all ten required import/build-graph files (61 s), and node scripts/check-changed.mjs --base 451b5bb3aa99b29bfa8482ecee392a9ee3b6540f (831 s). After the final small absence guard, the two affected helper/auth files passed all 26 tests locally (385.20 s), with targeted lint, format, and diff checks passing. The retained-tool negative control took 174.20 s locally; the store-load negative control took 352.82 s. These wall times include local transformation/build costs; the hosted numbers are batch seconds, not isolated per-case CI costs. Fresh P2 Codex autoreview of the complete landing-repair delta is scoped-clean. Required GitHub CI is bound to the final PR head; the independently qualified pre-existing UI failure below uses the explicitly authorized native admin exception.

Inherited CI failure qualification

At landing head 77d2e0c9bdf123b2484dd9b7d15ea857fc51dff0, CI run 37220273651, attempt 1 has one root failure: checks-ui-e2e-real-gateway (2/2), job 111489294517. The worker initial-setup test accepts two queued inputs but observes one launch. Immediately beforehand, the second input reports Session setup-proof-session placement authority changed. The aggregate gate fails solely from that UI shard; all other selected CI execution jobs succeeded. A cancelled non-required auto-response check belongs to a separate workflow.

Independent clean Linux/Chromium repetitions used the canonical prebuilt UI entrypoint and --maxWorkers=1: this PR head passed 5/5 (125, 72, 73, 74, 73 seconds); main merge base 82adb7a49d36e844e4ea1989bc5d865abac916f0 failed twice with the same error and assertion, then passed three times (146, 99, 71, 70, 70 seconds). A separately built current-main checkout at c9bff77155b0d6fde8214b5e9cbfbc32178eff09 passed twice and reproduced the same failure on its third run (103, 62, 91 seconds). These are single-file command wall times, including transform and fixture costs. Each head/base build took 117 seconds; current main took 105 seconds. No assertions, timeouts, fixture synchronization, or retries were added, and no CI rerun was used to obtain green.

The unchanged placement observer rejects an awaited read when another turn publishes same-session claim/ACK/workspace facts. Runtime selection begins before the per-session execution lane, so normal first-turn settlement can invalidate the second input's observation. This path predates the PR. The CI log does not isolate which of the existing runtime-selection or initial-execution observers threw; the independent main reproduction establishes inheritance without claiming a speculative repair. The test, placement observation/store/launcher/admission/ACK owners, runtime entry, and session queue are byte-identical between CI's main parent 15f60faa8e09a791b8d4c28d0f6bb94de7bd2594 and tested merge 98c1c9e11362c23c3c6efdb45dca614689e6277b, and remain unchanged at the tested current-main revision. Added auth awaits may alter timing; they introduce no placement publication or writer. Recent scheduled main UI shards also passed, consistent with the observed intermittency.

The native review retains tests.result: fail and exact run/head attribution for the approved pre-existing-failure admin route. This race remains follow-up work in placement admission; the passing repetitions are not presented as a fix. The completed ClawSweeper review of this head (2026-10-04 17:28 UTC) reports no actionable correctness or security findings, and the final P2 review is scoped-clean.

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime commands Command implementations agents Agent runtime and tooling size: L labels Oct 4, 2026
@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: 77d2e0c9bdf123b2484dd9b7d15ea857fc51dff0
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/agents/auth-profiles.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/auth-profiles/legacy-source-diagnostic.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/auth-profiles/runtime-snapshots.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/auth-profiles/session-override.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/auth-profiles/source-check.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/auth-profiles/sqlite-json.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/gateway/worker-environments/worker-tool-authority.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.

Carefully review these changes before merging.

@steipete

steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 4, 2026, 2:30 PM ET / 18:30 UTC (Revision 4).

ClawSweeper review

What this changes

The PR moves credential-source detection through existing asynchronous auth readers and prepares source-presence facts for model selection and tool discovery.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open: this remains a distinct, useful optimization absent from current main. The prior correctness findings are repaired, and the earlier migration-proof blocker does not apply to the read-only execution change. No actionable patch defect remains.

Priority: P2
Reviewed head: 77d2e0c9bdf123b2484dd9b7d15ea857fc51dff0

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, coherent implementation with strong scoped runtime evidence and repaired prior findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The complete, hash-matched body records real production workload observations showing the changed auth-reader path leaves MAIN SQL at measured candidate 451b5bb, with final-head semantic corrections separately validated. No stored-data contract changes, so migration proof is not applicable.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The complete, hash-matched body records real production workload observations showing the changed auth-reader path leaves MAIN SQL at measured candidate 451b5bb, with final-head semantic corrections separately validated. No stored-data contract changes, so migration proof is not applicable.
Evidence reviewed 9 items Pinned introduction and clean checkout: Reviewed the introduced merge-base-to-head delta, rather than endpoint drift. The checkout matches the pinned original head and remains clean. The supplied stale test merge was not used to infer removal of current-main behavior.
Existing reader ownership: Source detection captures physical locations before yielding, delegates to existing agent/shared readers, preserves unreadable-store routing, disposes readers, and checks captured admission before returning. The underlying reader transport and admission implementations are unchanged.
Prior findings resolved: Shared-state native read failures now propagate to the existing poisoned-handle eviction owner. The ACP policy fixture uses the existing auth-runtime opt-out. Deferred media actions refresh negative source facts, with a regression exercising credential publication through the same retained tool.
Findings None None.
Security None None.

How this fits together

Auth profiles supply credentials and account state to OpenClaw’s model and tool selection. Source detection determines whether those callers should use the canonical credential loader or continue without a stored profile source.

flowchart TD
  A[Model and tool preparation] --> B[Capture auth store locations]
  B --> C[Existing asynchronous readers]
  C --> D[Classify source presence]
  D --> E[Canonical credential loader]
  D --> F[No stored source]
  E --> G[Model and tool selection]
  F --> G
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +362, Tests +294, Docs +14, Other -8. Total +662 across 64 files.

View PR surface stats
Area Files Added Removed Net
Source 37 422 60 +362
Tests 25 444 150 +294
Docs 1 14 0 +14
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 8 -8
Total 64 880 218 +662

Review metrics

Metric Value Why it matters
Production and regression growth Production net +361 LOC; tests and support net +295 LOC Production growth is justified by captured-reader lifecycle handling and the complete caller cutover.
Measured caller-thread SQL Auth-source SQL: 6.0 → 0.0 per warmed turn The recorded production workload demonstrates the targeted execution move without claiming lower overall SQL or latency.

Stored data model

Persistent data-model change detected: unknown-data-model-change: src/agents/auth-profiles/source-check.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Use the existing async readers for runtime discovery while preserving canonical credential loading, current admission checks, and the released synchronous factory contract.

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

Yes, source establishes the current-main synchronous SQLite path, and the supplied before/after production workload measures its caller-thread cost. This read-only review did not execute it.

Is this the best way to solve the issue?

Yes: reusing existing readers and carrying prepared facts is a focused execution change, and the repaired head preserves error classification and deferred credential discovery.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 88934753a492.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded runtime performance improvement with preserved credential-selection behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The complete, hash-matched body records real production workload observations showing the changed auth-reader path leaves MAIN SQL at measured candidate 451b5bb, with final-head semantic corrections separately validated. No stored-data contract changes, so migration proof is not applicable.
  • proof: sufficient: Contributor real behavior proof is sufficient. The complete, hash-matched body records real production workload observations showing the changed auth-reader path leaves MAIN SQL at measured candidate 451b5bb, with final-head semantic corrections separately validated. No stored-data contract changes, so migration proof is not applicable.

Evidence

What I checked:

  • Pinned introduction and clean checkout: Reviewed the introduced merge-base-to-head delta, rather than endpoint drift. The checkout matches the pinned original head and remains clean. The supplied stale test merge was not used to infer removal of current-main behavior. (77d2e0c9bdf1)
  • Existing reader ownership: Source detection captures physical locations before yielding, delegates to existing agent/shared readers, preserves unreadable-store routing, disposes readers, and checks captured admission before returning. The underlying reader transport and admission implementations are unchanged. (src/agents/auth-profiles/source-check.ts:100, 77d2e0c9bdf1)
  • Prior findings resolved: Shared-state native read failures now propagate to the existing poisoned-handle eviction owner. The ACP policy fixture uses the existing auth-runtime opt-out. Deferred media actions refresh negative source facts, with a regression exercising credential publication through the same retained tool. (src/agents/auth-profiles/sqlite-json.ts:178, 77d2e0c9bdf1)
  • No stored-data model change: Comparison with the original sqlite-json blob shows changes confined to read-error classification; cell keys, JSON serialization, writes, and deletes remain unchanged. No introduced schema or migration change exists. The previous migration-proof request therefore does not establish an outstanding upgrade blocker. (src/agents/auth-profiles/sqlite-json.ts:168, 77d2e0c9bdf1)
  • Public factory compatibility: The public coding-tool factory remains synchronous and omits the internal presence hint from accepted options. SDK export searches show the converted inventory, worker preparation, and web-search availability functions are not exposed through these SDK/runtime surfaces. The private-options type test explicitly protects the public boundary. (src/agents/agent-tools.ts:610, 77d2e0c9bdf1)
  • Complete captured proof inspected: Read the complete GitHub body and verified its SHA-256 equals the captured source identity 9fc833d2915334fcf002f50de7ff8188f35b8ecacc4c4c9a8aa553fa7c050259, with 14,409 UTF-16 units. The production workload completed 13/13 turns before and after; auth-source MAIN SQL fell from 60 to zero across ten warmed turns at measured candidate 451b5bb. Final-head corrections have separately reported boundary validation. These observations do not establish an overall latency or total-SQL improvement. (451b5bb3aa99)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • stevenlee-oai: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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-10-04T15:46:39.781Z sha 451b5bb :: blocked before merge. :: none
  • reviewed 2026-10-04T15:53:07.960Z sha 451b5bb :: blocked before merge. :: [P2] Preserve corruption errors for shared-handle eviction | [P2] Isolate the ACP fallback fixture from auth-source admission
  • reviewed 2026-10-04T17:28:54.091Z sha 77d2e0c :: blocked before merge. :: none

Propagate shared-state read errors to the existing corruption-eviction owner and keep the storage-free ACP fallback fixture outside auth admission.

Refresh negative source facts when deferred media actions need them, and honor a prepared absence before invoking the canonical credential loader. Preserve supplied auth-store snapshots and synchronous SDK/CLI compatibility.
@steipete

steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 Oct 4, 2026
@steipete
steipete merged commit 90c4d9a into main Oct 4, 2026
172 of 176 checks passed
@steipete
steipete deleted the dbasync/authsource branch October 4, 2026 18:50
@steipete

steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

steipete added a commit that referenced this pull request Oct 4, 2026
Route the fallback-runner and cron conversation delivery suites through
isolated infra forks after async auth source detection began using the
shared-state owner. Both reproduced broker admission errors in their old
thread projects. Normal Node hosts initialize the broker locally; no
production behavior or assertions change.

The unchanged fallback test now preserves the exact provider failure after
committed delivery. Both cron retry cases and the async auth-source sibling
suite pass: 8 tests, 519.70s wrapper wall time with cold preparation.
Changed-file checks pass (763.39s), as does independent P2 review.

Refs #164992; main CI run 37228653021, jobs 111513599521 and 111513599698.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
…enclaw#164992)

* perf(auth-profiles): detect auth sources through the auth readers

* test(auth-profiles): await progress-card inventory preparation

* fix(auth-profiles): preserve source semantics in deferred tools

Propagate shared-state read errors to the existing corruption-eviction owner and keep the storage-free ACP fallback fixture outside auth admission.

Refresh negative source facts when deferred media actions need them, and honor a prepared absence before invoking the canonical credential loader. Preserve supplied auth-store snapshots and synchronous SDK/CLI compatibility.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
Route the fallback-runner and cron conversation delivery suites through
isolated infra forks after async auth source detection began using the
shared-state owner. Both reproduced broker admission errors in their old
thread projects. Normal Node hosts initialize the broker locally; no
production behavior or assertions change.

The unchanged fallback test now preserves the exact provider failure after
committed delivery. Both cron retry cases and the async auth-source sibling
suite pass: 8 tests, 519.70s wrapper wall time with cold preparation.
Changed-file checks pass (763.39s), as does independent P2 review.

Refs openclaw#164992; main CI run 37228653021, jobs 111513599521 and 111513599698.
steipete added a commit that referenced this pull request Oct 13, 2026
…170770)

## What Problem This Solves

Scheduled main CI fails `image-generate-tool.auth.test.ts` when the retained image tool test saves real credentials. It runs in the `agents-tools` thread pool, where the credential owner correctly rejects an unadmitted writer before the test can verify refreshed availability.

Commit `90c4d9a6edebdb2b256fd2129d461227b9d1df42` (#164992) added this real-write regression. Commit `50414196f1912053abee1ddcab595fca3c7e7889` (#170632) later introduced credential custody and moved other native credential fixtures into the forked database-worker owner, but missed this file.

Add the image-auth file to that existing owner and extend the existing routing contract to require inclusion in infra and exclusion from agents-tools. All six behavioral cases, the fixture helper, and the production credential guard remain unchanged. No checks are removed; no schema, SDK, runtime SQL, T1, or update behavior changes. Two test-routing files: +4/-0; production: +0/-0.

## Evidence

The actual scheduled-main baseline is run [38359584345](https://github.com/openclaw/openclaw/actions/runs/38359584345), job [115170479640](https://github.com/openclaw/openclaw/actions/runs/38359584345/job/115170479640), head `0348a2526c561d8ccce61bfd23931024a6b8f13e`. The failure is `Auth profile credential writes require an admitted worker` at `credential-write-custody.ts:72`, through `writeAuthProfiles` to `image-generate-tool.auth.test.ts:57`. The containing agents-tools shard reports 1 failed / 1933 passed / 1 skipped tests (47.73 seconds Vitest; 49.77 seconds wrapper). This is observed main execution, not a source-parity inference.

Changed-file formatting, direct changed-file oxlint, and `git diff --check` passed. One isolated Codex review completed with no actionable findings; native commit hooks passed. No local tests or type scans ran under compute conservation. Candidate proof:

```sh
pnpm test src/agents/tools/image-generate-tool.auth.test.ts --maxWorkers=1
pnpm test test/vitest-scoped-config.test.ts --maxWorkers=1 -t "keeps infra and database worker consumers rooted at the repository"
```

The exact original file passed all six cases on candidate `30edf5f4bed3e34b3aab06d39c8a914b976ff76d` in [focused CI 38362624127/job115180185169](https://github.com/openclaw/openclaw/actions/runs/38362624127/job/115180185169): 26.08 seconds Vitest, 64.20 seconds wrapper; unchanged-source verification passed. The routing contract passed in ordinary CI 38361217277/job115176092361 (2.501-second case, 24/24 file cases). Ordinary CI omitted the original file, so the supplement ran only its six cases. No duplicate baseline was run.

Final ordinary CI: 49 successful checks, 39 skipped, no failures or pending checks. Static, type, architecture, security, and required CI gates passed. Database ratchets remained T1 454 to 454, compatibility calls 9 to 9, and all dialect groups 0 to 0. This is a test-only owner-routing correction; no SQL savings are claimed.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 14, 2026
…penclaw#170770)

## What Problem This Solves

Scheduled main CI fails `image-generate-tool.auth.test.ts` when the retained image tool test saves real credentials. It runs in the `agents-tools` thread pool, where the credential owner correctly rejects an unadmitted writer before the test can verify refreshed availability.

Commit `24fc8a49a8c1c4f106d92c833b440cec6e6d55f6` (openclaw#164992) added this real-write regression. Commit `c3b5d0c7bc15f2f497247c3127cfa844d34c6e74` (openclaw#170632) later introduced credential custody and moved other native credential fixtures into the forked database-worker owner, but missed this file.

Add the image-auth file to that existing owner and extend the existing routing contract to require inclusion in infra and exclusion from agents-tools. All six behavioral cases, the fixture helper, and the production credential guard remain unchanged. No checks are removed; no schema, SDK, runtime SQL, T1, or update behavior changes. Two test-routing files: +4/-0; production: +0/-0.

## Evidence

The actual scheduled-main baseline is run [38359584345](https://github.com/openclaw/openclaw/actions/runs/38359584345), job [115170479640](https://github.com/openclaw/openclaw/actions/runs/38359584345/job/115170479640), head `116f0502239e7f1cd4a85f57331f986f616e8939`. The failure is `Auth profile credential writes require an admitted worker` at `credential-write-custody.ts:72`, through `writeAuthProfiles` to `image-generate-tool.auth.test.ts:57`. The containing agents-tools shard reports 1 failed / 1933 passed / 1 skipped tests (47.73 seconds Vitest; 49.77 seconds wrapper). This is observed main execution, not a source-parity inference.

Changed-file formatting, direct changed-file oxlint, and `git diff --check` passed. One isolated Codex review completed with no actionable findings; native commit hooks passed. No local tests or type scans ran under compute conservation. Candidate proof:

```sh
pnpm test src/agents/tools/image-generate-tool.auth.test.ts --maxWorkers=1
pnpm test test/vitest-scoped-config.test.ts --maxWorkers=1 -t "keeps infra and database worker consumers rooted at the repository"
```

The exact original file passed all six cases on candidate `30edf5f4bed3e34b3aab06d39c8a914b976ff76d` in [focused CI 38362624127/job115180185169](https://github.com/openclaw/openclaw/actions/runs/38362624127/job/115180185169): 26.08 seconds Vitest, 64.20 seconds wrapper; unchanged-source verification passed. The routing contract passed in ordinary CI 38361217277/job115176092361 (2.501-second case, 24/24 file cases). Ordinary CI omitted the original file, so the supplement ran only its six cases. No duplicate baseline was run.

Final ordinary CI: 49 successful checks, 39 skipped, no failures or pending checks. Static, type, architecture, security, and required CI gates passed. Database ratchets remained T1 454 to 454, compatibility calls 9 to 9, and all dialect groups 0 to 0. This is a test-only owner-routing correction; no SQL savings are claimed.
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 docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. security-sensitive-changed size: XL 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