镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

refactor(builderlab): keep capabilities fresh in the session - #3003

Merged
baxen merged 12 commits into
mainfrom
jsib-261108-builderlab-capabilities
Nov 9, 2026
Merged

baxen merged 12 commits into
mainfrom
jsib-261108-builderlab-capabilities

Conversation

@jsibbison-square

@jsibbison-square jsibbison-square commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Why

  • Builderlab permissions stayed at their sign-in values until another login.

Key changes

  • The session keeps permissions fresh, so gates don't have to. Reading a signed-in session snapshot re-reads the capability flags from /v1/auth/me in the background once they are a minute old. Acting on a permission waits for that read through freshCredential(signal), which can be cancelled. This covers agent requests, agent creation and Decisions. Gates only read flags; they no longer refresh by hand.
  • Each sign-in shares one in-flight request and a one-minute cache, including failed attempts. Previous permissions are kept on HTTP, network or parsing failures. Credential identity, app viewers and the profile read at sign-in are preserved.
  • Builderlab stays registered as a Decisions provider while you are signed in. Without access it reports needs-setup, and its settings say decisions are unavailable for this account. While it re-reads a refusal it reports checking.
  • Decisions default routing: the first default that can answer (ready or unconfirmed) answers. When none can, TypeSafe is the provider, since adding its key is something the user can do. The status is checking while another default is still finding out. A request waits for checking within its deadline, as Attention readiness already did. A checking Builderlab therefore never moves the selection or delays TypeSafe.
  • Communities keeps its own account read, as on main.
  • Development broker: reloads keep refreshed flags and their cache age. Capability reads are fenced to the expected revision and aborted with their session. Sign-in and capability checks share one flag parser.

Reviewer highlights

  • Compared with this PR's earlier revision (gate-level refresh), there are about 2 refresh points instead of about 14. The registerProviderDiscovery/refreshProviders plugin API and its routing and readiness special cases are removed. The Decisions Settings refresh no longer depends on an unstable active prop.
  • Behavior changes to review:
    • Signed-in users without Decisions access now see Builderlab in Settings → Decisions API, marked unavailable.
    • If Builderlab is explicitly chosen and access is lost, requests fail as unauthorized instead of falling back.
    • If another provider is explicitly chosen, a new Builderlab grant is noticed the next time Builderlab's status is read.
    • Reading the session can start a background /auth/me read, at most once a minute. There is no timer.
  • Native and broker sessions fence late results to the original sign-in. Urgent Stop starts a refresh without waiting for it.

Validation

  • pnpm typecheck and pnpm lint are clean.
  • Full vitest run at a4fd6f57: 1,031 of 1,040 files pass and 8 are skipped. The one failure, MediaDownloadAction.test.tsx, passes when run alone, and this PR doesn't touch it. Pre-push hooks passed.
  • Coverage includes:
    • The one-minute boundary, concurrent reads, cancellation during a re-read, failure retention, account switches and disposal.
    • The broker HTTP route and the reload cache.
    • New grants picked up through Settings, through a request, and with another provider chosen.
    • Attention classifying with a new grant and no TypeSafe key.
    • Routing: the first default that can answer, the TypeSafe fallback when none can, a checking default not moving the selection or holding a request when another can answer, and no dispatch after the deadline.
  • No browser journeys added or removed; this change uses service tests and mounted React integration tests.

Deferred acceptance

  • Native app exercise, human acceptance, and rendered checks of the Decisions Settings change (both themes, narrow/wide, enlarged text, keyboard/pointer) are still pending.

jsibbison-square and others added 4 commits November 8, 2026 08:29
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>
@jsibbison-square
jsibbison-square marked this pull request as ready for review November 7, 2026 22:36
@jsibbison-square
jsibbison-square requested review from a team as code owners November 7, 2026 22:36

@kalvinnchau kalvinnchau left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Three capability-refresh regressions need attention; details inline.

Comment thread src/features/decisions/service.ts Resolved
Comment thread browser-host/builderlab.mjs Resolved
Comment thread src/bundled/builderlab/dev-session.ts Resolved
@jsibbison-square
jsibbison-square marked this pull request as draft November 7, 2026 23:08
jsibbison-square and others added 4 commits November 8, 2026 10:10
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>
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>
@jsibbison-square
jsibbison-square marked this pull request as ready for review November 7, 2026 23:38

@kalvinnchau kalvinnchau left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 One reproduced sign-out regression and one maintenance finding remain; the three previously reported repair paths are addressed.

Comment thread src/bundled/builderlab/dev-session.ts Resolved
Comment thread src/bundled/builderlab/capabilities.ts Resolved
@jsibbison-square
jsibbison-square marked this pull request as draft November 8, 2026 00:04
jsibbison-square and others added 2 commits November 8, 2026 11:05
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>
@jsibbison-square
jsibbison-square marked this pull request as ready for review November 8, 2026 00:51
@jsibbison-square jsibbison-square changed the title fix(builderlab): refresh capabilities at feature gates fix(builderlab): refresh builderlab capabilities at feature gates Nov 9, 2026
baxen and others added 2 commits November 8, 2026 19:16
…f at each gate

Reading a signed-in session snapshot now re-reads permissions once they are
a minute old, and actions wait for that through freshCredential. Gates read
flags and no longer refresh by hand.

Builderlab stays registered as a Decisions provider while signed in and
reports needs-setup without access, or checking while a refusal is being
re-read. Default routing passes over a default that needs setup, and
decide waits for a checking provider within its deadline. This replaces the
provider discovery API and its routing and readiness special cases.

Communities keeps its own account read, as on main.

Signed-off-by: Bradley Axen <baxen@squareup.com>
A default still checking whether it can answer no longer takes the
selection: without a choice, the first default that is ready or
unconfirmed answers, and otherwise TypeSafe, whose key the user can add,
with status checking while another default is still finding out. A
refused Builderlab re-reading its permissions therefore no longer flips
the selected provider once a minute or holds TypeSafe requests behind
its account read, and a user without Builderlab access or a TypeSafe key
is shown TypeSafe's setup rather than Builderlab's refusal.

The session no longer parses can_delete_buzz_communities, which only
Communities' own account read uses, and the development broker parses
capability flags in one place for sign-in and capability checks.

Signed-off-by: Bradley Axen <baxen@squareup.com>
Co-authored-by: mbot <3754f8729004d95654c46dbab3129e4ab9ef05cc2534e2a3fbfc155983bd637b@buzz.block.builderlab.xyz>
@baxen baxen changed the title fix(builderlab): refresh builderlab capabilities at feature gates refactor(builderlab): keep capabilities fresh in the session Nov 9, 2026

@baxen baxen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Reviewed at a4fd6f5. Permissions now stay fresh in the session, so gates just read flags and only acting paths (agent requests, agent creation, Decisions) wait for a re-check, cancellably. The provider-discovery API is gone; Decisions routing picks the first default that can answer and falls back to TypeSafe, so a re-check without access no longer flips the selected provider. Typecheck clean; builderlab, decisions, agents, attention and browser-host suites pass locally (2,307 tests). The CI failures on the first run were GitHub 504s fetching pnpm/hermit, not test failures.

@baxen
baxen merged commit d00b896 into main Nov 9, 2026
104 of 136 checks passed
@baxen
baxen deleted the jsib-261108-builderlab-capabilities branch November 9, 2026 06:58
aharvard added a commit to aharvard/buzz-app that referenced this pull request Nov 9, 2026
Picks up c202642 (block#2837), which fixes the ThreadPanel catch-up test
that fails on every run of a merge with the older main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* origin/main: (155 commits)
  deps: accept RUSTSEC-2026-0459 for libsqlite3-sys 0.38, move rmcp to 3.9.0 (block#3077)
  fix(communities): accept invite links and bare hosts in Join a community (block#2412)
  fix(builderlab): open a remote agent's Activity on the conversation it was opened from (block#3051)
  refactor(builderlab): keep capabilities fresh in the session (block#3003)
  feat(moderation): show invite links as a QR code (block#3029)
  Keep Create agent's Model row readable and give Goose a Thinking row (block#2673)
  Join a community right after creating it in Settings (block#2991)
  Let new Solo chats start temporary by default (block#2874)
  fix(messages): fill a screen that a head of folded agent activity leaves empty (block#3037)
  fix(search): search saved conversations while the community is offline or connecting (block#2724)
  test(agents): make version-history date assertion time-zone independent (block#3010)
  feat(relay): gate artifact writers on NIP-AR support (block#2735)
  fix(channels): open the dock's community switcher from Personal space (block#2806)
  fix(members): keep the list's place after a member change (block#2818)
  fix(channels): keep a launcher's side panel open on Close all tabs (block#2803)
  fix(activity): show a remote agent's Buzz send as its reply (block#3025)
  refactor(settings): move external identity authorization to security (block#3032)
  test(typeahead): serve the fixture pages as a build so cold loads fit (block#2793)
  feat(channels): list unread top-level mentions in sidebar Activity, and count only unread mentions on the Inbox card (block#2722)
  fix(solo): delete a removed workspace's settings after the groups write (block#2819)
  ...

Signed-off-by: Andrew Harvard <aharvard@squareup.com>
baxen added a commit that referenced this pull request Nov 9, 2026
* origin/main:
  deps: accept RUSTSEC-2026-0459 for libsqlite3-sys 0.38, move rmcp to 3.9.0 (#3077)
  fix(communities): accept invite links and bare hosts in Join a community (#2412)
  fix(builderlab): open a remote agent's Activity on the conversation it was opened from (#3051)
  refactor(builderlab): keep capabilities fresh in the session (#3003)
  feat(moderation): show invite links as a QR code (#3029)
  Keep Create agent's Model row readable and give Goose a Thinking row (#2673)

Signed-off-by: Bradley Axen <baxen@squareup.com>
gilgtm added a commit that referenced this pull request Nov 9, 2026
…pover-card-layout-7eeda1e0

* origin/main: (128 commits)
  deps: accept RUSTSEC-2026-0459 for libsqlite3-sys 0.38, move rmcp to 3.9.0 (#3077)
  fix(communities): accept invite links and bare hosts in Join a community (#2412)
  fix(builderlab): open a remote agent's Activity on the conversation it was opened from (#3051)
  refactor(builderlab): keep capabilities fresh in the session (#3003)
  feat(moderation): show invite links as a QR code (#3029)
  Keep Create agent's Model row readable and give Goose a Thinking row (#2673)
  Join a community right after creating it in Settings (#2991)
  Let new Solo chats start temporary by default (#2874)
  fix(messages): fill a screen that a head of folded agent activity leaves empty (#3037)
  fix(search): search saved conversations while the community is offline or connecting (#2724)
  test(agents): make version-history date assertion time-zone independent (#3010)
  feat(relay): gate artifact writers on NIP-AR support (#2735)
  fix(channels): open the dock's community switcher from Personal space (#2806)
  fix(members): keep the list's place after a member change (#2818)
  fix(channels): keep a launcher's side panel open on Close all tabs (#2803)
  fix(activity): show a remote agent's Buzz send as its reply (#3025)
  refactor(settings): move external identity authorization to security (#3032)
  test(typeahead): serve the fixture pages as a build so cold loads fit (#2793)
  feat(channels): list unread top-level mentions in sidebar Activity, and count only unread mentions on the Inbox card (#2722)
  fix(solo): delete a removed workspace's settings after the groups write (#2819)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants