Skip to content

feat(automation): calibrate candidate parallelism before observe (429 staircase)#478

Draft
bberkes-toloka wants to merge 1 commit into
mainfrom
feat/calibrate-candidate-parallelism
Draft

feat(automation): calibrate candidate parallelism before observe (429 staircase)#478
bberkes-toloka wants to merge 1 commit into
mainfrom
feat/calibrate-candidate-parallelism

Conversation

@bberkes-toloka

Copy link
Copy Markdown
Collaborator

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 parallelism step after pricing; the capability / shape-variant / wire-probe / resolve-reprobe steps consume the calibrated widths via step env with fallback to the configured defaults.
  • docs: OBSERVE_CALIBRATE config row.

Safety properties

  • Can only LOWER parallelism (ceiling = configured CAP_PARALLEL; workers/resolve widths min'd against their configured values) - never more aggressive than today.
  • Advisory + fail-open: tool error / missing key / OBSERVE_CALIBRATE=false keeps the defaults.
  • Floor 2: a fully throttled model still probes, just slowly (the trade for a clean observation).

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

… 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.
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

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.

1 participant