Repository navigation
fix(builderlab): refresh capabilities at feature gates - #3003
jsibbison-square wants to merge 6 commits into
Conversation
Cache capability checks for one minute, retain permissions on failure, and keep sign-in identity stable. Signed-off-by: Jarrod Sibbison <jsibbison@squareup.com> Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Jarrod Sibbison <jsibbison@squareup.com> Co-authored-by: Codex <codex@openai.com>
Check provider availability independently of registration when opening Decisions settings and within the existing request deadline. Signed-off-by: Jarrod Sibbison <jsibbison@squareup.com> Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Jarrod Sibbison <jsibbison@squareup.com> Co-authored-by: Codex <codex@openai.com>
kalvinnchau
left a comment
There was a problem hiding this comment.
🤖 Three capability-refresh regressions need attention; details inline.
| const started = generation; | ||
| const result = await me(credential, session.signal, true); | ||
| if (started !== generation) throw new Error("Builderlab session changed"); | ||
| return result; |
There was a problem hiding this comment.
🤖 [P2] Preserve refreshed capabilities across browser reload
This returns fresh flags without updating the broker account projection. After signing in without remote-agent access, granting it upstream, and discovering the grant in Settings, reloading restores the original unavailable flags. The restored dev session also starts a fresh one-minute cooldown, so reopening Settings performs no corrective request. This was reproduced in the actual app with the production broker and modeled upstream in Chromium and WebKit: the grant became available, reload removed it with the account-read count unchanged, and another minute restored it. Retain the refreshed flags and freshness with the broker sign-in, or refresh restored snapshots immediately while preserving identity and profile fields.
| refreshCapabilities = createCapabilityRefresh( | ||
| account, | ||
| async () => { | ||
| const response = await fetch("/api/builderlab/capabilities"); |
There was a problem hiding this comment.
🤖 [P2] Bind the capability request to the expected account revision
The capability GET carries no expected revision and returns none. If another development page switches the shared broker account before this renderer receives its account event, the broker reads the replacement account while owner === current still holds locally. Its flags can therefore be applied to the previous account projection until the event arrives. The broker generation fence only detects switches during its own read. Send and validate the expected public revision before reading capabilities, retaining the post-read fence. This is a source-established UI projection defect; operation routes still validate revisions, and no backend authorization bypass is established.
Signed-off-by: Jarrod Sibbison <jsibbison@squareup.com> Co-authored-by: Codex <codex@openai.com>
Signed-off-by: Jarrod Sibbison <jsibbison@squareup.com> Co-authored-by: Codex <codex@openai.com>
Why
Key changes
/auth/mecapability flags at existing remote-agent, Decisions, and community-deletion gates.Reviewer highlights
Validation
bin/pnpm author:buildpassed; Settings tests remain covered by the pre-push related-test gate.5502f2ef(includes Attention readiness discovery).Deferred acceptance