Repository navigation
fix(gateway): keep chat metadata responsive across auth refresh - #139192
Conversation
|
🦞👀 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: needs maintainer review before merge. Reviewed September 5, 2026, 11:53 AM ET / 15:53 UTC. ClawSweeper reviewWhat this changesKeeps chat metadata requests responsive during authentication refresh by preserving recorded publication failures and preventing obsolete refresh work from settling newer requests. Merge readiness✅ Ready for maintainer review Keep open: current main still contains the reported defect. This protected maintainer PR provides a focused repair, and no blocking correctness findings were identified. Priority: P2 Review scores
Verification
How this fits togetherGateway chat metadata combines prepared model, authentication, and skill information for chat clients. Its lifecycle determines when requests receive current models and commands, wait for publication, or receive a recorded failure. flowchart TD
A[Model and authentication publication] --> C[Gateway metadata lifecycle]
B[Skill and catalog changes] --> C
C --> D{Generation state}
E[Chat metadata request] --> D
D -->|Ready| F[Models and commands]
D -->|Replacing or failed| G[Wait or recorded error]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +6, Tests +349. Total +355 across 5 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Retain the publication-owned refresh flow; the six added production lines distinguish initial attachment from failure and fence obsolete work without adding a competing recovery path. Do we have a high-confidence way to reproduce the issue? Yes, from source: settle one configured owner's failure, then refresh another owner's authentication while global publication remains unavailable. The new composition test encodes this sequence; no tests were executed during this read-only review. Is this the best way to solve the issue? Yes. Repairing invalidation and settlement at the metadata lifecycle preserves genuine failures and existing shutdown semantics; client retries or broader publication announcements would conceal or violate those boundaries. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0e6b033d4bdb. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* origin/main: (46 commits) fix(gateway): keep chat metadata responsive across auth refresh (openclaw#139192) fix(doctor): keep Workshop relocation lint read-only (openclaw#139193) perf(ui): retain unchanged forwarded avatar publications (openclaw#139181) fix(config): guide exec policy migration repairs (openclaw#139143) test(i18n): refresh representative Watch key (openclaw#139197) fix(agents): preserve recovered scheduled-run outcomes (openclaw#139037) refactor(acp): simplify pending operation accounting (openclaw#139189) fix(plugin-sdk): harden account scope for pairing requests and challenges (openclaw#139142) perf(gateway): avoid redundant PR landing ancestry checks (openclaw#139186) perf(ui): release captured audio cache leases directly (openclaw#139174) fix(skills): validate names in library forms (openclaw#139184) fix(sessions): reduce cold catalog listing delays (openclaw#139146) perf(cron): scan preserved action output once (openclaw#139163) fix(agents): keep fresh tool results readable under context pressure (openclaw#139165) fix(compaction): heartbeat sessions ignore the active transcript byte cap (openclaw#136533) perf(agents): reuse snapshotted web search result rows (openclaw#139162) fix(onboarding): keep Tauri setup recoverable and verify model results (openclaw#139140) fix(memory): rank indexed sessions by source activity (openclaw#139112) perf(terminal): avoid rebuilding sanitized link fallbacks (openclaw#139159) perf(agents): bound retained tool result projection data (openclaw#139157) ...
…claw#139192) * fix(gateway): keep metadata reads settled during auth refresh * test(gateway): normalize metadata lifecycle promise callbacks
…claw#139192) * fix(gateway): keep metadata reads settled during auth refresh * test(gateway): normalize metadata lifecycle promise callbacks (cherry picked from commit 707edba)
What Problem This Solves
Fixes an issue where users reading chat metadata could wait indefinitely after a configured model owner failed and another owner's authentication refreshed successfully. Healthy auth publication could also produce a false
chat metadata refresh failedwarning when previously queued metadata work ran during the replacement window.Why This Change Was Made
Metadata invalidation now revokes obsolete refresh work while preserving its existing replacement wait and shutdown ownership. The Gateway lifecycle distinguishes an owner that has not published yet from one whose publication is pending or has failed, so subordinate changes cannot erase a recorded failure and create an unowned wait. The canonical publication event still rebuilds fresh metadata; real preparation and publication failures remain visible.
This completes the owner boundary used by #123433. It does not change configuration, persistence, protocol, dependencies, or provider policy. Production LOC: +31/-25 (net +6) for the required initial/available/unavailable distinction and refresh ownership fencing. Tests: +370/-9.
User Impact
Chat metadata waits for the current publication and returns its result or recorded failure. Superseded background work cannot publish stale auth availability or fail a newer reader. Shutdown still joins outstanding preparation and projections.
Evidence
d3386f151859443fe9dd589d7451ffde1554afd0, three complete suites produced exactly nine expected regression failures and 71 passing controls. The real prepared-owner composition reproduces the stranded reader after a prior worker failure followed by a successful main-only auth publication.git diff --checkpass; the normal pre-commit hook preserves the tested source bytes.f0ca6cd52633e367721a4c5809ff1ca5d3e4abe8. All owned process groups were confirmed dead and proof archives downloaded and hash-verified.Provenance: the warning predates the unrelated session-patch repair that exposed it during QA. The original introducing change is unproven; no causal attribution to that repair. The live evidence uses a real built Gateway and QA channel with a loopback synthetic provider, and does not establish production prevalence.