Repository navigation
fix: keep credential diagnostics responsive on slow filesystems - #200222
Conversation
Prepare legacy source presence, provider diagnostics, and shared-store identity through the existing async admission and observation owners. Keep live candidate subscriptions scoped to readers and preserve final credential effect checks without an intervening await. Four serving-boundary guards fail before the fix. Synthetic two-second legacy-file reads reduce the heartbeat gap from 2014 ms to 17 ms while preserving provider-specific migration refusal. Normal measured owner time increases by 0.64 ms; no new cache, schema, or configuration.
|
🦞👀 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 Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
|
Codex review: needs maintainer review before merge. What this changesThis PR prepares credential-file presence, migration diagnostics, and shared-store identity asynchronously. Example: Reading legacy credentials takes two seconds while another agent is working.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR addresses a concrete Gateway responsiveness problem, resolves the earlier findings, and introduces no identified correctness or security defect; exact-head CI remains pending. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe auth-profile owner combines persisted credential rows, legacy-file observations, and migration policy into credential reads and writes consumed by model and session authentication. flowchart TD
A[Model and session requests] --> B[Auth profile owner]
B --> C[Async file preparation]
B --> D[Existing database workers]
C --> E[Prepared migration diagnostics]
D --> F[Credential and store operations]
E --> F
F --> G[Final authority checks]
Technical reviewBest possible solution: Prepare filesystem facts through the existing auth owners while preserving provider-scoped refusals and synchronous authority checks at credential effects. Do we have a high-confidence way to reproduce the issue? Pinned main reaches synchronous legacy-file reads during credential diagnostics, and the supplied matched fault-injection evidence demonstrates event-loop blocking; this read-only review ran no target code. Is this the best way to solve the issue? The patch repairs the blocking boundary using existing observation, parsing, worker admission, and publication owners, with no unnecessary parallel implementation identified. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2435c1faa791. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +291, Tests +210. Total +501 across 31 files. Added test files: 0. View PR surface stats
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
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 (3 earlier review cycles)
Reviewed November 16, 2026, 3:44 PM ET / 20:44 UTC (Revision 4). |
|
Addressed all three open items from review 6926718190 in
CI run 43935316801 has exactly these four failing cases. The unmodified head reproduces four failures plus one passing control; the repaired fixtures pass all five. Both affected type graphs, scoped lint/format, and fresh isolated Codex review pass. Production is unchanged. An isolated real-Gateway responsiveness proof is also in progress; no live proof is claimed yet. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
The requested real-Gateway proof is complete. Current head Real isolated Gateway proof on Two concurrent actual legacy diagnostic reads for synthetic agent During that hold, three real health RPC round trips completed in 32.183 / 25.475 / 25.542 ms. An unrelated real After release, the affected session ended in error and Limitations: health responses used the existing cached payload (including a startup CPU-degraded flag), so their timings establish RPC responsiveness rather than a fresh healthy event-loop sample. The actual completed provider turn independently proves useful work during the hold. This is macOS APFS with a targeted asynchronous read delay, not btrfs transaction reproduction, broad no-sync-FS proof, or a latency benchmark. No production hooks, config options, or production source changes were added. Cleanup completed: Gateway/worker test fixture and wrapper joined, Gateway PID absent, owned port unbound, synthetic state deleted, in-memory credential consumer ended, task secret-delivery instruction script removed, and only its task tmux window closed. No existing Gateway or Team service was changed. |
|
CI repair in Run 43941147230 failed at that action. The exact main-parent replay passed, so this is not being classified as inherited and the screenshot history is not claimed as the timing failure's introducing commit. The complete affected file passes 4/4 on the exact PR source with the fix; formatting and fresh isolated Codex review are clean. Production is unchanged, and the earlier three numbered auth findings remain fixed. The real-Gateway proof in comment6927368868 uses byte-identical production. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Final head All 20 authored production modules are byte-identical to the reviewed/live-proven source. Core types pass after integration, and the two affected UI fixtures pass 8/8 with verified compiled generation. Fresh Codex review is clean. Prior fixture findings 1–3 remain fixed; the body retains their exact red/green proof and the failed-run history. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…claw#200222) * fix: keep credential diagnostics responsive on slow filesystems Prepare legacy source presence, provider diagnostics, and shared-store identity through the existing async admission and observation owners. Keep live candidate subscriptions scoped to readers and preserve final credential effect checks without an intervening await. Four serving-boundary guards fail before the fix. Synthetic two-second legacy-file reads reduce the heartbeat gap from 2014 ms to 17 ms while preserving provider-specific migration refusal. Normal measured owner time increases by 0.64 ms; no new cache, schema, or configuration. * test(auth): preserve async admission in diagnostic fixtures * test(ui): remove obsolete screenshot scroll from ACK proof
Backport 9323fb9 (#200192) and 3f33eb9 (#200222) as one credential-owner slice on the 2026.11.6 release base. Reuse native admission preparation without importing replacement execution or snapshot architecture. Preserve physical-alias FIFO reservations, capture shared ownership before awaiting preparation, and retain one-shot cancellation/deadline settlement. Co-authored-by: RomneyDa <[email protected]>
Recheck the canonical registry immediately before publication and retain extra descriptors until joined host or worker retirement. Parent independently reviewed native overlap, generation preservation, and both cleanup paths; 47 targeted tests passed. Follow-up to backports #200192 and #200222. Co-authored-by: RomneyDa <[email protected]>
Follow up the release adaptations of #200136 (59d9759), #200192 (9323fb9), and #200222 (3f33eb9). Preserve validated worker fields across asynchronous admission; restore required imports, await diagnostics, and normalize the nullable path adapter. Parent review complete. Doctor regression failed before the repair; 17 parent tests across Doctor and attachment boundaries pass afterward. Seven-file scoped typed lint, format and whitespace checks pass. Worker session-path suite: 9 passed. Full release qualification remains pending. Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
Fixes: cold credential reads, updates, and migration diagnostics can freeze the Gateway while the filesystem is busy.
Related: #197510, #200136, #200192.
User Impact
Credential operations continue waiting for their required files without blocking other Gateway work. Existing migration refusals, provider scope, credential authority, FIFO admission, and reader retirement remain intact. No configuration or migration is required.
Why This Change Was Made
The async row reader still reached synchronous legacy-file presence checks and diagnostic reads. Prepare those facts asynchronously through the existing file-observation and diagnostic owners; live readers subscribe to their own candidate paths and release subscriptions when disposed. Credential effects consume the prepared refusal and retain their final authority checks without an intervening await. Shared-store bootstrap prepares physical identity and source facts through the existing asynchronous admission hook.
Production grows by 291 lines across 20 modules (tests/support: +210 lines) to preserve live-reader observation and the named synchronous SDK/maintenance contract. This adds no cache, worker, schema, configuration, or protocol. The normal measured path costs about 0.64 ms more; this change targets responsiveness rather than a general throughput gain. Remaining generic writer reverse lookup, source-cohort comparison, credential-boundary canonicalization, explicit secrets rebuilds, and deprecated synchronous SDK paths are outside this stage.
Evidence
The motivating read-only Team observation was 25c9790, 2026-11-16 05:02 PST: MAIN spent 1.97 s in
openat2(O_CREAT)on~/agents/roboclaw-x/agent/openclaw-agent.sqlite.plugin-model-catalog.lock, withbtrfs_create → start_transaction → wait_current_trans;scheduler:update.remote-model-catalogstalled the loop for 2,002 ms during a btrfs commit triggered by managed worktree removal. That specific lock was removed in #200136; this PR closes additional auth paths found by the same audit. No Team data was copied or changed.pnpm check:changedcompleted: production types, all 29 test type graphs, lint, format, and structural/security/worker/schema/import guards passed. The command exits 1 on unused exports: 116 entries, including 112 matched to a clean earlier baseline and four package-release exports added by feat(update): keep each release in its own directory on OpenClaw-owned installs #198835 /b868ed4c21ba0. A clean exact parent9323fb9dreproduces all 116 entries with zero candidate-only findings. Parent-relative history proves the four new declarations and their absence of external production callers in feat(update): keep each release in its own directory on OpenClaw-owned installs #198835; the older 112 remain baseline matches, with individual causal attribution incomplete. This is not a blanket inherited-CI waiver. The earlier exact-667 failures (ProjectedContinuationSource,partContinuation) were introduced by fix(ui): continue self-woken work in the turn that started it #200056 /24385a20428a. Fresh isolated Codex review completed three clean passes through P2. No changed module is runtime-imported by the Control UI.Earlier stage-1 native-staging runs had two unexplained 10 s timeouts; passing replays do not establish a fix or inherited cause. The separately attributed main watch-benchmark regression (#197445 /
36afa92b2370, exact parent4a74c61ae7c438587bc272840d180d16f7c5a283) also remains a follow-up. This PR does not change those tests or claim a global zero-sync result. Exact-head CI and final-head ClawSweeper review will gate landing.Consumer repair: CI run 43935316801 at
a59eac28exposed four failures in three fixtures. The admission interceptor now forwards the existing async preparation callback; the pure diagnostic fixture supplies its affected provider; and the permission-error fixture intercepts the asynchronous identity inspector. Existing rollback, provider-isolation, and legacy-ownership assertions are unchanged. Exact-head local reproduction was four failures and one passing control; the same five cases pass after the repair. Both affected test type graphs, scoped lint/format, and a fresh isolated Codex delta review pass. Production is unchanged.Real isolated built-Gateway proof also passed (1/1, generation verified) on
a59eac28, whose 20 changed production modules are byte-identical to finalfc5bf62e. Two concurrent MAIN-initiated legacy diagnostic reads were held for 2,183.079 ms. During that hold, three health RPCs returned in 32.183/25.475/25.542 ms and an unrelated real-model turn completed in 2,099.627 ms with the expected terminal reply. The affected session retained its provider-specific migration refusal and Doctor instruction. Its total 65,923.944 ms includes failed loopback-only synthetic provider retries; this proves eventual refusal, not immediate pre-network refusal. Health payloads were cached and retained a startup CPU-degraded flag, so RPC timings and the completed real-model turn establish responsiveness, not a newly sampled healthy event-loop state. APFS plus targeted async read injection; all owned processes/state were cleaned up. Full sanitized receipts are in the accompanying PR comment.A subsequent CI failure in run 43941147230 was confined to an obsolete screenshot-positioning scroll in the UI ACK ownership test. Commit
21febc760a6f5deletes only that action; all draft, tool visibility/content, ACK/history ordering, continuation, and Stop-target assertions remain. The scroll was introduced for screenshots in #155746; #178793 removed the screenshots but left this action. That is provenance, not an established introducer of the timing failure. The unchanged exact main-parent case passed locally, so no inherited-failure exception is claimed. All four cases pass both on that parent with the fix and on the exact PR source with the same one-line fix; formatter and isolated Codex review are clean. Production is unchanged. New exact-head CI and zero-open final-head Claw review gate landing.While final CI was running, main also received the same UI scroll deletion in #200183 and a resolved-command-row locator in #200202. The merge retains both compatible fixes; no auth production file changed on main. This PR does not claim either peer change as newly introduced auth behavior.
CI run 43946411593 tested
21febc76against main800bd59cand exposed a main integration regression: #200203 moved the identity helper but missed an OAuth caller introduced by #200192. The exact main parent reproducesTS2724; the build and affected UI collection logs report that same missing export. Main already repairs the import in #200242 /0879f3e9. Final headfc5bf62e55c79c64d43e77848a2bd71e6cc79311integrates that material dependency without conflicts. All 20 authored production modules remain byte-identical; the peer UI fixes are retained and no longer part of this PR's diff. Core types pass; the two affected browser fixtures pass 8/8, compiled generation verified, and fresh isolated Codex P0–P2 review is clean. The failed run remains failed; fresh exact-head CI and zero-open Claw review are required.