Skip to content

OpenConceptLab/ocl_online#517 | Mapper settings checkpoint, runs follow the server's suggested concurrency, output language by permission, exact group names - #111

Open
snyaggarwal wants to merge 1 commit into
mainfrom
ocl_online#517
Open

snyaggarwal wants to merge 1 commit into
mainfrom
ocl_online#517

Conversation

@snyaggarwal

@snyaggarwal snyaggarwal commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

OpenConceptLab/ocl_online#517

What changes

  • Request settings come from a checkpoint. getMapperSettings(user) is added to the @openconceptlab/oclmap-extensions stub (autoMatchCheck.js). It returns the most rows per request and requests in flight the form allows. The open stub returns the form's full range (1000 × 50), so the open build behaves as before. requestLimits.js no longer reads groups: it applies whatever the checkpoint returns, and a saved project runs within it.
  • Runs follow the server's suggested concurrency. Each server's capacity gate (services/capacity.js) keeps the latest X-OCL-Capacity-Suggested-Concurrency, and the Auto Match scheduler (matchBatch.js) runs no more requests than it. A suggestion only lowers a run, never raises it above the project's setting. A suggestion of 0 counts as 1, since that lane's 429s already pause the gate.
  • Output language is a permission. Staff, and users with users.mapper_ai_output_locale, choose the OCL AI Assistant's output language (aiVisibility.js). The group checks are gone.
  • Exact group names. hasAuthGroup matches a group's exact name, never a group whose name contains it. The unused canSwitchServer is removed, since it relied on the substring match.

Related PRs

Merge order

  1. OpenConceptLab/oclinfrastructure#20, then OpenConceptLab/ocl_online#517 | capacity tier per group from the groups config, output language permission oclapi2#948, so the permission exists and is granted before this ships.
  2. OpenConceptLab/ocl_online#548 before this PR: the deploy image calls getMapperSettings, so the installed package must export it.
  3. This PR.

Testing

  • npm test: 563 pass. eslint src: clean.
  • New tests cover the checkpoint's settings, the permission, the gate's suggestion and the scheduler running fewer requests after a lower suggestion.
  • A production webpack build with the package installed succeeds and bundles the package's settings.
  • Not checked in a browser.

🤖 Generated with Claude Code

…ow the server's suggested concurrency, output language by permission, exact group names

@snyaggarwal snyaggarwal left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reviewed with the sibling changes for OpenConceptLab/ocl_online#517. No blocking findings. The public app now consumes neutral checkpoint/permission/server-capacity answers and keeps the open build whole; the scheduler respects the server suggestion without raising the configured concurrency. PR checks are green.

@paynejd paynejd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed together with OpenConceptLab/oclapi2#948 and the private PRs for OpenConceptLab/ocl_online#517. Codex pass 1 is in a separate comment.

Please change before merge

  1. Leave following the suggested concurrency to OpenConceptLab/ocl_online#340, per the decision on OpenConceptLab/ocl_online#517.

    • Take out the scheduler cap (getLimit in matchBatch.js) and the gate's suggest and suggestedConcurrency (services/capacity.js), with their tests.
    • Keep reading and logging the headers as before.
    • Keep the checkpoint, the permission and the exact group match.

    There are two reasons, with details inline:

    • The limiter runs in shadow mode, but oclapi2 still sends the header, and its value never goes above the default per-user limit (1–4, by tier). So runs drop below what getMapperSettings allows before OpenConceptLab/ocl_online#340 has calibrated those numbers. The open build changes too: with no groups config, every non-staff user is in the lowest tier, so 1 request in flight.
    • The suggestion is kept per server and outlives the call that set it. Codex reproduced a lexical algorithm set to 5 running one request at a time after a semantic call suggested 1.
  2. Build order for the private image.

    • If the Mapper image is built before the oclmap-plugin branch exports getMapperSettings, the import is undefined and MapProject throws on load. webpack only warns at build time.
    • Merging OpenConceptLab/ocl_online#548 first isn't enough: a separate workflow run publishes that branch. Wait for that run, or have the Dockerfile check that the installed package exports every name the open stub exports.

Checked

  • requestLimits.js and aiVisibility.js no longer name a group. The checkpoint's rows per request and requests in flight are applied within the form's range, and the open stub gives the full range.
  • hasAuthGroup matches exact names, and every remaining caller passes an exact group name.
  • The new permission is granted to every group that had the output-language choice before.
  • Merges cleanly onto main (637fcea). CI is green.

const active = new Set()
let heldMs = 0
const isHeld = () => Boolean(gate?.isPaused() && gate.pausedForMs() <= maxHoldMs - heldMs)
const getLimit = () => Math.min(concurrency, gate?.suggestedConcurrency?.() || Infinity)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Per the decision on OpenConceptLab/ocl_online#517, please take this cap out and leave it to OpenConceptLab/ocl_online#340. That ticket calibrates the per-user numbers first, and it covers the rerank path too, which ignores the suggestion today.

As it stands:

  • Shadow mode still caps runs. oclapi2 sends X-OCL-Capacity-Suggested-Concurrency in shadow mode too, and the value never goes above the per-user lane (core/capacity/config.py defaults, 1–4). So this caps runs below the project's setting while nothing is enforced.
  • The suggestion goes stale. The gate is one per server and keeps the last suggestion. A $match with neither semantic nor reranker isn't gated and carries no header, so it can't refresh the suggestion; in a multi-algorithm run that's every algorithm that isn't semantic. After a semantic call suggested 1, a lexical algorithm set to 5 runs one request at a time.

@paynejd

paynejd commented Oct 21, 2026

Copy link
Copy Markdown
Member

Codex review, pass 1 (codex-cli 0.163.0, commit ce79acb)

Verdict: findings. 1 finding(s).

  • F1.1 (P1) src/components/map-projects/matchBatch.js:124: The new cap applies a heavy-request concurrency suggestion to subsequent lexical-only matching.
findings.json
{
  "reviewer": "codex-cli 0.163.0",
  "perspective": "defects",
  "mode": "full",
  "commit": "ce79acb52c9c6099e1297c6f8e00ff7cfe2b1dc9",
  "verdict": "findings",
  "prior": [],
  "findings": [
    {
      "id": "F1.1",
      "severity": "P1",
      "tag": null,
      "file": "src/components/map-projects/matchBatch.js",
      "line": 124,
      "claim": "The new cap applies a heavy-request concurrency suggestion to subsequent lexical-only matching.",
      "scenario": "A semantic or rerank response suggests concurrency 1, which is retained in the origin-wide gate. A subsequent multi-algorithm run sends lexical batches with semantic=false and reranker=false. oclapi2 deliberately excludes these requests from capacity limiting and sends no capacity headers, so they cannot replace the retained suggestion. The entire lexical phase runs serially despite configured concurrency 5. Reproduced with the actual scheduler: maximum concurrency was 1 with the retained suggestion and 5 with a fresh gate.",
      "action": "Scope concurrency suggestions to requests covered by the corresponding capacity policy, while preserving shared 429 pauses. Add a regression covering a heavy response followed by lexical-only batches without capacity headers.",
      "lines_delta": null,
      "confidence": "high"
    }
  ]
}

This branch has not been deployed

No deployments
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