Repository navigation
fix(gateway): retry failed observer preparation - #133178
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 4:01 AM ET / 08:01 UTC. ClawSweeper reviewWhat this changesThe PR clears a failed session-observer model-preparation promise so the observer’s existing second attempt can prepare a fresh utility model and publish a digest. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open. The branch repairs a current Gateway observer bug at the cache owner, and this MEMBER-authored, maintainer-labelled PR is not eligible for automated closure. Priority: P1 Review scores
Verification
How this fits togetherThe Gateway session observer consumes agent lifecycle and tool events for a visible Control UI session. It prepares a utility model and publishes a generated run-status digest to subscribed operators. flowchart LR
A[Agent lifecycle and tool events] --> B[Gateway session observer]
B --> C[Preparation promise cache]
C --> D[Utility model]
D --> E[Digest validation]
E --> F[Subscribed Control UI sessions]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +10, Tests +43. Total +53 across 3 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the identity-guarded failed-promise eviction at the observer completion cache owner, preserving shared pending and successful preparation, then merge after exact-head CI completes. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main retains a rejected or error-valued preparation promise, so the next scheduled attempt reuses it and reaches the consecutive-failure limit. Is this the best way to solve the issue? Yes. Clearing only the identical settled failure at the cache owner preserves pending and successful sharing while allowing the existing retry to prepare anew. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f120ed722654. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
ClawSweeper before-merge disposition for exact head
The full review reports no actionable findings and independently confirms this owner-level eviction as the best fix. |
|
Merged via squash.
|
What Problem This Solves
Fixes an issue where a transient session-observer model preparation failure
would be replayed from cache on the next attempt. The same failure exhausted
the two-attempt budget without retrying preparation, silently disabling model
observation for the run and publishing no digest even when preparation could
subsequently recover.
Why This Change Was Made
The repair lives at the
preparedPromisecache owner. It retains the exactpreparation promise while it is pending or after it succeeds, but evicts that
same promise when it rejects or fulfills with
{ error }. The identity checkprevents an older settled failure from clearing a newer preparation.
Caller-level guards were rejected because they would duplicate cache policy
outside its owner. Failure-budget or scheduler changes were also rejected:
they would mask the poisoned cache instead of allowing the existing retry to
perform a fresh preparation.
Production LOC: +13/-3 (net +10) | Tests: +87/-44
User Impact
Session observation can recover after a transient preparation failure. Users
and operators no longer lose model-generated run status because one cached
failure was counted twice.
Evidence
23d82f1af1ff16e9d255fcb95137eeb634752d8c{ error }casesfailed with one preparation call, zero completion calls, and zero broadcasts.
pnpm tsgo:core: passed.oxfmt,oxlint, andgit diff --check: passed.tsgo:core:testlane is locally blocked by sharednode_modulesdrift:the worktree resolves root
[email protected]whileui/package.jsondeclares[email protected]. Full-checkout CI owns that dependency-hydrated proof.and exact-promise eviction rather than caller guards or budget changes.