Skip to content

ref(perf): Share one fan-out cap, and rename nested Threads in feeds - #3578

Merged
BYK merged 1 commit into
mainfrom
perf/fan-out-constant
Nov 17, 2026
Merged

BYK merged 1 commit into
mainfrom
perf/fan-out-constant

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Follow-up to review on #3573.

  • The p-limit fan-outs in @sentry/junior that each had their own cap of 8 now use one FAN_OUT_CONCURRENCY constant from src/chat/fan-out.ts. Caps of 5 for Slack lookups and plugin message sends stay local, because a provider rate limit sets them. policies/performance.md points at the constant.
  • Renaming a Conversation no longer refetches every feed, so the feed cache must hold the new title. It wrote the title only to top-level feed rows, and a renamed Thread nested under its parent row kept its old title. The rename now uses the same nested-row patch as archive, renamed from markFeedConversation to patchFeedConversation.

via @BYK.

--

View Session [Sentry]

Use one FAN_OUT_CONCURRENCY constant for the p-limit fan-outs that had
their own cap of 8. A rename now updates a Thread row nested in a parent
feed row too.

Co-Authored-By: BYK <[email protected]>
@sentry-junior
sentry-junior Bot requested a review from BYK November 17, 2026 13:50
@vercel

vercel Bot commented Nov 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 17, 2026 1:50pm UTC

Request Review

@BYK
BYK merged commit a2fbdce into main Nov 17, 2026
49 checks passed
@BYK
BYK deleted the perf/fan-out-constant branch November 17, 2026 14:26
BYK pushed a commit that referenced this pull request Nov 17, 2026
First follow-up to the `no-await-in-loop` baseline from
#3573. It clears every baseline file outside
`packages/junior/src/chat`: 172 sites in 48 files. The baseline goes
from 467 sites in 137 files to 295 sites in 89 files.

**Fixed: about 52 sites, now run at once or batched**
- `auto-archive`: one `UPDATE … WHERE conversation_id IN (…)` per page
replaces one `UPDATE` per root.
- memory store: one `inArray` read of alias targets.
- Slack message links: look up all linked workspace domains at once.
- Pending messages: read both web actor ids at once.
- `junior check`: look for app markers at once.
- github: parallel reaction deletes, notice closes and legacy item
closes. Per-ref conflict checks and per-target syncs use p-limit at 5,
under GitHub rate limits.
- Test setup: read migrations at once, then apply them in order. One
multi-statement sequence reset. Parallel `pool.end`.
- Eval fixtures: delete auth state for all providers and users at once.

**Disabled with a reason: 120 sites that must stay in order**
- Pagination cursors, polls, retries and REPL loops.
- Webhook and event publishes that keep delivery order. Ordered
migrations.
- Stream output (ACP transport).
- `junior check` loops whose "first name wins" duplicate maps depend on
order, and its local file reads.
- Eval history replay and recorded uploads.
- Sweeps and heartbeats that stay sequential under GitHub rate limits.

Long loops use one `/* oxlint-disable no-await-in-loop -- reason */`
block. Loops with one or two sites use next-line comments. A few loop
bodies moved to functions (`reconcilePullRequest`, `checkConflict`,
`prepareCheckout`, `refreshCheckout`), so one comment covers each loop.

**Still in the baseline**
- `packages/junior/src/chat`: 292 sites in 88 files. They follow in the
next PRs.
- `junior-google/src/tools/read-meeting-transcript.ts`: 3 sites. Its
Drive reads can run at once, but `meet.test.ts` gives responses in call
order. The fix needs a URL-routed fake, so it goes with the chat PRs.

`junior-github` keeps local named caps (5 for GitHub calls, 8 for
internal work), because a plugin does not import core internals. Core
sites here do not use the shared `FAN_OUT_CONCURRENCY` from
#3578 yet, so this PR does not depend on it.

<!-- junior-request-attribution:start -->
via @BYK.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3A7e1432c2f4a2110ee7bb48718f8b6fad -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent%3A7e1432c2f4a2110ee7bb48718f8b6fad)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A7e1432c2f4a2110ee7bb48718f8b6fad/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
BYK added a commit that referenced this pull request Nov 17, 2026
…nce (#3628)

Follow-up to #3584 and #3578. This
removes the last `no-await-in-loop` baseline file outside
`packages/junior/src/chat`, and moves two fan-outs to
`FAN_OUT_CONCURRENCY`.

- **Google Meet transcripts:** `readMeetingTranscript` reads the
metadata and export of each attached Doc through `pLimit(5)`. The
content budget still takes records in attachment order. Long records are
saved to the sandbox after that. Drive requests no longer come in a
fixed order, so the Meet test fake now answers by URL path.
`junior-google` gets `p-limit` as a dependency. The baseline drops from
295 sites in 89 files to 292 in 88.
- **`junior check`:** the independent file reads (plugin versions,
plugin directories, packaged content, app files, skill directories) run
through `pLimit(FAN_OUT_CONCURRENCY)`. This removes 13 "reads few files"
disable comments. The packaged-content reads share one limiter, and a
package's own work holds no slot, so nested reads cannot wait on each
other. Five disable comments stay where the order is the behavior: the
first file or plugin that matches wins, and plugin factories run in
export order.
- **Slack link cards:** the workspace domain lookups run through
`pLimit(FAN_OUT_CONCURRENCY)`, in place of a `bounded-fan-out` disable
comment.

<!-- junior-request-attribution:start -->
via @BYK.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3A7e1432c2f4a2110ee7bb48718f8b6fad -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent%3A7e1432c2f4a2110ee7bb48718f8b6fad)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A7e1432c2f4a2110ee7bb48718f8b6fad/?project=4510944073809921)

<!-- junior-session-footer:end -->

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: BYK <[email protected]>

This branch was successfully deployed

1 active deployment
Preview – junior-docs — e9095458 Deployed Nov 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant