feat(automation): calibrate candidate parallelism before observe (429 staircase)#478
Draft
bberkes-toloka wants to merge 1 commit into
Draft
feat(automation): calibrate candidate parallelism before observe (429 staircase)#478bberkes-toloka wants to merge 1 commit into
bberkes-toloka wants to merge 1 commit into
Conversation
… staircase) New / low-capacity models often rate-limit or destabilize under the observe stage's default 10-wide probe pools, contaminating the observation and landing the PR in needs-human for infra reasons. Add a cheap pre-observe calibration that measures what concurrency the candidate actually serves cleanly and lowers the pool widths for that run accordingly. - automation calibrate-parallelism (new subcommand): a staircase of waves of concurrent 1-token completions at increasing levels (default 2/4/6/8/10). A level is clean with zero HTTP 429 and at most one transient non-429 error; the recommendation is the highest clean level, capped at the configured ceiling and floored at 2. Deterministic orchestration is separated from the network call, so the logic is unit-tested with a fake requester (15 tests). - integrate-model.yml: a "Calibrate candidate parallelism" step (id: calibrate) after the pricing step. Safety properties: it can only LOWER parallelism (ceiling = the configured CAP_PARALLEL; workers/resolve widths are min'd against their configured values), it is advisory + fail-open (tool error, missing key, or OBSERVE_CALIBRATE=false keeps the defaults), and a kill-switch repo variable (OBSERVE_CALIBRATE=false) skips it entirely. The capability, shape-variant, wire-probe, and resolve-reprobe steps consume the calibrated widths via step-level env with a fallback to the configured defaults. - docs: OBSERVE_CALIBRATE row in the configuration table, including the trade-off note (a heavily throttled model calibrates down to 2 and the observe takes proportionally longer - the price of a clean observation). Cost: ~60 one-token requests, ~1-2 minutes, negligible spend. Honest scoping: this addresses the 429/capacity contamination class; a max_turns-dominated dirty observe (model loops without finishing) is a different failure mode and still routes to needs-human at the gate.
Contributor
|
Claude encountered an error after 0s —— View job I'll analyze this and get back to you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New / low-capacity models often rate-limit under the observe stage's default 10-wide probe pools, contaminating the observation (429/instability) and landing the PR in needs-human for infra reasons. This adds a cheap pre-observe calibration step that measures the concurrency the candidate actually serves cleanly and lowers the pool widths for that run.
What
automation calibrate-parallelism(new subcommand): staircase of waves of concurrent 1-token completions at increasing levels (2/4/6/8/10). A level is clean with zero 429 and at most one transient error; recommendation = highest clean level. Pure orchestration separated from the network call; 15 unit tests.integrate-model.yml:Calibrate candidate parallelismstep after pricing; the capability / shape-variant / wire-probe / resolve-reprobe steps consume the calibrated widths via step env with fallback to the configured defaults.OBSERVE_CALIBRATEconfig row.Safety properties
CAP_PARALLEL; workers/resolve widths min'd against their configured values) - never more aggressive than today.OBSERVE_CALIBRATE=falsekeeps the defaults.Cost
~60 one-token requests, ~1-2 min, negligible spend.
Honest scoping
This addresses the 429/capacity contamination class. A max_turns-dominated dirty observe (like muse-spark-1.1's 163/200: the model loops without finishing) is a different failure mode and still correctly routes to needs-human at the gate.
Validation: 146 tool tests green, ruff + black clean, workflow YAML parses, CLI fail-open verified.
🤖 Generated with Claude Code