Repository navigation
fix(pinchbench): OpenClaw timeout configuration — invalid agents.list key, clamped run ceiling, coupled knobs - #2477
Merged
laszkiewiczp merged 7 commits intoAug 12, 2026
Conversation
OpenClaw 2026.6.5 validates agents.list entries with a strict schema, so the timeoutSeconds key added in #2211 is rejected as an unknown field and invalidates the entire openclaw.json. The agent then never starts and the benchmark scores 0. Reproduced against [email protected] with `openclaw config validate`: an agents.list entry of {id, model} is valid, and adding only timeoutSeconds turns it into "agents.list.0: Invalid input". The baked patch is the wider break: provider_timeout_s defaults to 120 there, so it wrote the key on every run even with no environment override, against the entry ensure_agent_exists creates. The runtime direct-exec wrapper only wrote it when PINCHBENCH_PROVIDER_TIMEOUT_SECONDS was set. Drop the agents.list write from both paths. models.providers.custom .timeoutSeconds and agents.defaults.timeoutSeconds are retained: they are the two the README documents, they validate clean, and defaults already applies to list entries that do not override it. Verified the edited patch still applies to pinchbench/[email protected] and that the resulting config passes `openclaw config validate`. Signed-off-by: plaszkiewicz <[email protected]>
OpenClaw abort-drains a stalled run after `diagnostics.stuckSessionAbortMs`, which defaults to at least 5 minutes and 3x the warn threshold. Under a saturated model endpoint ordinary generations exceed that window, so OpenClaw cuts the session mid-task. Nothing surfaces as a timeout: the endpoint still answers 200, the rollout is recorded as a success, and the partial work grades as a low score. Measured on a concurrency scan holding the model and config fixed: reward fell monotonically as rollout concurrency rose, and zero-reward rollouts became the shortest ones rather than the longest. The agent already writes provider and agent timeouts into the OpenClaw config; add the diagnostics threshold alongside them. Default stays unset, so runs that do not opt in keep OpenClaw's behaviour. Signed-off-by: plaszkiewicz <[email protected]>
…er text The regression guard matched source strings in the generated wrapper, so it passed for any refactor that kept the substring and failed for any that reworded it, without ever checking what the sandbox writes. Run the config script the wrapper carries against a seeded openclaw.json that already contains an agents.list entry, then assert on the resulting JSON: the list entry stays free of timeoutSeconds, the ceiling lands on agents.defaults, the watchdog lands on the provider, and nothing is written when unset. Verified red/green: restoring the agents.list write fails test_agents_list_entries_never_carry_a_timeout with the offending entry in the assertion message. Also drops the explanatory comment the fix carried; the behaviour it described is now pinned by the tests. Signed-off-by: plaszkiewicz <[email protected]>
Signed-off-by: plaszkiewicz <[email protected]>
The baked patch read PINCHBENCH_PROVIDER_TIMEOUT_SECONDS with a "120" default and wrote that value to agents.defaults.timeoutSeconds unconditionally. In gateway mode -- the mode PinchBench runs -- that key is the whole-run ceiling: parseTimeoutSeconds() feeds resolveGatewayAgentTimeoutMs() and falls back to 600s when the key is absent. Writing it always therefore cut the ceiling from 600s to 120s on every run that did not set the variable, aborting longer tasks mid-flight so the partial work graded as a failure rather than a timeout. Keep the 120s provider watchdog default, which matches OpenClaw's own, and set the run ceiling only when the variable is explicitly provided. The runtime direct-exec wrapper was already guarded and is unchanged. Signed-off-by: plaszkiewicz <[email protected]>
… provider knob openclaw_provider_timeout_seconds drove two unrelated bounds. The provider key is a per-request stream-idle watchdog; agents.defaults.timeoutSeconds is the whole-run ceiling that parseTimeoutSeconds() feeds to the gateway. They want opposite values -- a watchdog tight enough to notice a hung generation, and a ceiling loose enough not to pre-empt the harness -- so one field could not express a usable pair. Add openclaw_agent_timeout_seconds for the ceiling. The harness already bounds every invocation with task.timeout_seconds * timeout_multiplier and reports its own expiry as a timeout, whereas the ceiling aborts from inside and the partial work grades as a failure, so callers can now set the ceiling clear of the harness budget and keep the attribution. Add openclaw_judge_timeout_seconds. lib_grading hardcoded 300s, ignored the timeout multiplier, and ran a full OpenClaw session, so a slow judge failed grading with no way to raise the bound from the benchmark config. Regenerate the patch from the patched tree rather than editing hunk headers by hand; it now spans lib_agent.py and lib_grading.py and applies to pinchbench/[email protected]. Signed-off-by: plaszkiewicz <[email protected]>
…26-pinchbench-agents-list-timeoutseconds Signed-off-by: plaszkiewicz <[email protected]>
laszkiewiczp
deleted the
plaszkiewicz/gymbugs-26-pinchbench-agents-list-timeoutseconds
branch
August 12, 2026 14:48
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.
Fixes GYMBUGS-26.
PinchBench generates OpenClaw's
openclaw.json. Three defects in how timeouts were written there, plus one new knob.1.
timeoutSecondsonagents.list[N]invalidated the whole configOpenClaw
2026.6.5validates agent list entries with a strict schema, so the key added in #2211 is rejected as unknown and the entire document fails validation. The agent never starts and every task scores 0 — uniformly, since the config is written once per agent, not per task.Reproducible without a GPU (
npm i [email protected]), one key is the entire difference:agents.list[0]openclaw config validate{id, model}+agents.defaults.timeoutSecondsConfig valid{id, model, timeoutSeconds}+ same defaultsagents.list.0: Invalid inputNothing consumed it either — both readers resolve from
defaults(opts.cfg.agents?.defaults?.timeoutSeconds ?? 600). It was inert and fatal.The baked patch was the wider break:
provider_timeout_sdefaulted to120there, so it wrote the key on every run with no env override, onto the entryensure_agent_existscreates. Any image rebuilt frommainwas broken out of the box.2. The run ceiling was clamped to 120s
The same patch wrote that 120s default to
agents.defaults.timeoutSeconds. In gateway mode — the mode PinchBench runs — that key is the whole-run ceiling:parseTimeoutSeconds()feedsresolveGatewayAgentTimeoutMs()and falls back to 600s when absent.So every run that did not set the variable had its ceiling cut 600s → 120s. All 147 tasks have a harness budget of at least 180s (
task.timeout_seconds×timeout_multiplier), so every task was being cut short, and because OpenClaw aborts from the inside the partial work grades as a failure rather than surfacing as a timeout.Now: the 120s provider watchdog default stays (it matches OpenClaw's own); the ceiling is written only when explicitly provided.
3. One field drove two unrelated bounds
openclaw_provider_timeout_secondsset both the per-request stream-idle watchdog and the whole-run ceiling. They want opposite values — a watchdog tight enough to notice a hung generation, a ceiling loose enough not to pre-empt the harness — so no single value was usable.openclaw_agent_timeout_seconds→agents.defaults.timeoutSecondsopenclaw_judge_timeout_seconds→DEFAULT_JUDGE_TIMEOUT_SECONDS, previously hardcoded at 300s, ignored bytimeout_multiplier, and unreachable from the benchmark config despite running a full OpenClaw session4. Configurable stalled-run abort threshold
openclaw_stuck_session_abort_seconds→diagnostics.stuckSessionAbortMs. Unset, OpenClaw computesmax(5 min, 3 × stuckSessionWarnMs)= 300s of no-progress, which is inside the budget of 98 of 147 tasks. Verifieddiagnostics.stuckSessionAbortMsis accepted by the same strict schema.Verification
[email protected](above), plusdiagnostics.stuckSessionAbortMsvalidated the same way.lib_agent.pyandlib_grading.pyand applies topinchbench/[email protected](git apply --check).lib_agent.pyhas zeroagent["timeoutSeconds"], with provider /agents.defaults/tools.web.searchwrites intact.openclaw.jsoncontaining anagents.listentry, and assert on the resulting JSON — a seeded entry is required, since with an empty list the buggy loop is a no-op and any test would pass either way.Note
On current
mainthis is masked by an earlier issue:ea4c6c6c9raisedrequires-pythonto>=3.13.14while the gym-runtime image ships CPython 3.12.13, so trunk dies atuv venvbefore OpenClaw is invoked. Fixing the image alone exposes these immediately.