Skip to content

fix(erxes): document executor graphql concurrency limits - #24

Open
darjss wants to merge 2 commits into
fix/slides-setdeck-themeversionfrom
fix/executor-concurrency-caps
Open

fix(erxes): document executor graphql concurrency limits#24
darjss wants to merge 2 commits into
fix/slides-setdeck-themeversionfrom
fix/executor-concurrency-caps

Conversation

@darjss

@darjss darjss commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Why

Buyanaa's agent hit Executor HTTP 500 from parallel GraphQL storms and wasted steps on page/perPage pagination. PR #27 fixed empty tool output; this PR adds erxes guardrails with runtime enforcement.

Scope

  • packages/workshop-shared/src/erxes-executor-guidance.ts — single source for pagination, concurrency, discovery budget, instance instructions
  • packages/workshop-backend/src/overseer.ts — per-chat Executor MCP semaphore (max 5 in-flight)
  • packages/workshop-backend/src/agent.tsexecutorDescribe capped at 3/turn; tool descriptions from shared guidance
  • scripts/deploy-instance.ts — injects INSTANCE_INSTRUCTIONS env var from shared text
  • packages/gatekeeper-erxes/src/erxes.tsEXECUTOR_TYPES from shared guidance

Verification

  • bunx vitest run __tests__/executor-tools.test.ts (includes semaphore test)

Test plan

  • Deploy sets INSTANCE_INSTRUCTIONS on backend worker
  • Parallel executor calls queue instead of overloading host
  • 4th executorDescribe in one turn returns limit message

Summary by Sourcery

Add end-to-end erxes Executor guidance and concurrency guardrails to prevent overloaded GraphQL sessions and improve reliable pagination.

New Features:

  • Add shared erxes Executor guidance covering cursor pagination, filter formatting, tool discovery, and safe GraphQL concurrency.
  • Provide default deploy-time erxes agent instructions with admin-configured instructions taking precedence.

Bug Fixes:

  • Prevent overloaded Executor sessions by limiting concurrent MCP calls per chat and discouraging parallel pagination scans.
  • Limit executorDescribe usage per turn to reduce unnecessary catalog calls before execution.

Enhancements:

  • Centralize erxes Executor limits and guidance across agent prompts, generated executor types, runtime controls, and deployment configuration.

Deployment:

  • Inject default erxes agent instructions into deployed backend workers through INSTANCE_INSTRUCTIONS.

Documentation:

  • Document erxes Executor workflows, pagination requirements, concurrency guardrails, and gadget scheduling guidance.

Tests:

  • Add coverage verifying that the Executor MCP semaphore caps in-flight calls.

@sourcery-ai

sourcery-ai Bot commented Sep 1, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates the prompt-only Executor documentation to prevent GraphQL page-fetch overload by prescribing bounded concurrency, sequential paging, totalCount-first queries, and partial-result handling.

File-Level Changes

Change Details Files
Document GraphQL paging and concurrency guardrails in the generated Executor type guidance.
  • Limit GraphQL tool calls to five concurrent requests and prefer sequential page fetching.
  • Recommend fetching totalCount first, avoiding large parallel Promise.all scans, and returning partial results on failure.
packages/gatekeeper-erxes/src/erxes.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 35adec2d-c8c9-47c5-b892-484b85d85873

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@darjss
darjss force-pushed the fix/executor-concurrency-caps branch from 7a4df34 to 9ca67a9 Compare September 1, 2026 08:14
@darjss
darjss force-pushed the fix/slides-setdeck-themeversion branch from ded9f2b to c14a43b Compare September 1, 2026 08:14
@github-actions github-actions Bot added the kernel label Sep 1, 2026
Single source in workshop-shared for pagination/concurrency/discovery guidance.
Cap in-flight Executor MCP calls per chat, limit executorDescribe per turn,
inject INSTANCE_INSTRUCTIONS on deploy, and fall back when admin config is empty.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant