Skip to content

fix(sql-editor): harden Server Beam MAX_SQL (all bridge calls) - #160

Open
huyplb wants to merge 2 commits into
mainfrom
cursor/server-beam-cap-fixes-7e48
Open

fix(sql-editor): harden Server Beam MAX_SQL (all bridge calls)#160
huyplb wants to merge 2 commits into
mainfrom
cursor/server-beam-cap-fixes-7e48

Conversation

@huyplb

@huyplb huyplb commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes the two Medium findings from the Server Beam review:

  1. Cap bypass — plain sql\…`under Beam no longer skipsMAX_SQL(onlysql.on` used to count).
  2. Concurrency — Beam bridge calls are queued so Promise.all cannot race the counter; queries run one at a time under Beam.

Tests added

  • createBeamSqlCap unit tests (hard max + interleaved microtasks)
  • Plain sql counts toward the cap (mixed with sql.on)
  • Promise.all of MAX_SQL + 5 → exactly MAX_SQL fulfilled, 5 rejected; max in-flight = 1
  • Exactly MAX_SQL sequential calls still succeeds

API / copy

Error text: Server Beam allows at most N SQL bridge calls per editor Execute

Open in Web Open in Cursor 

cursoragent and others added 2 commits August 3, 2026 05:08
Plain sql`` under Beam no longer bypasses the cap. Bridge calls are
queued so Promise.all cannot race the counter. Adds createBeamSqlCap
helpers and coverage for sequential, mixed, and concurrent limits.

Co-authored-by: huy.phan9 <huyplb@users.noreply.github.com>
Co-authored-by: huy.phan9 <huyplb@users.noreply.github.com>
@cursor

cursor Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_43e688b3-7808-476a-91e0-75515bc4ba0b)

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.

2 participants