Skip to content

fix(pinchbench): OpenClaw timeout configuration — invalid agents.list key, clamped run ceiling, coupled knobs - #2477

Merged
laszkiewiczp merged 7 commits into
mainfrom
plaszkiewicz/gymbugs-26-pinchbench-agents-list-timeoutseconds
Aug 12, 2026
Merged

laszkiewiczp merged 7 commits into
mainfrom
plaszkiewicz/gymbugs-26-pinchbench-agents-list-timeoutseconds

Conversation

@laszkiewiczp

@laszkiewiczp laszkiewiczp commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Fixes GYMBUGS-26.

PinchBench generates OpenClaw's openclaw.json. Three defects in how timeouts were written there, plus one new knob.

1. timeoutSeconds on agents.list[N] invalidated the whole config

OpenClaw 2026.6.5 validates 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.timeoutSeconds Config valid
{id, model, timeoutSeconds} + same defaults agents.list.0: Invalid input

Nothing 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_s defaulted to 120 there, so it wrote the key on every run with no env override, onto the entry ensure_agent_exists creates. Any image rebuilt from main was 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() feeds resolveGatewayAgentTimeoutMs() 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_seconds set 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.timeoutSeconds
  • openclaw_judge_timeout_seconds → DEFAULT_JUDGE_TIMEOUT_SECONDS, previously hardcoded at 300s, ignored by timeout_multiplier, and unreachable from the benchmark config despite running a full OpenClaw session

4. Configurable stalled-run abort threshold

openclaw_stuck_session_abort_seconds → diagnostics.stuckSessionAbortMs. Unset, OpenClaw computes max(5 min, 3 × stuckSessionWarnMs) = 300s of no-progress, which is inside the budget of 98 of 147 tasks. Verified diagnostics.stuckSessionAbortMs is accepted by the same strict schema.

Verification

  • Schema A/B against [email protected] (above), plus diagnostics.stuckSessionAbortMs validated the same way.
  • Patch regenerated from the patched tree rather than hand-edited; it now spans lib_agent.py and lib_grading.py and applies to pinchbench/[email protected] (git apply --check).
  • Image built from this branch; baked lib_agent.py has zero agent["timeoutSeconds"], with provider / agents.defaults / tools.web.search writes intact.
  • End-to-end on oci-hsg with the rebuilt SIF and this branch pinned as the Gym revision: 20/20 rollouts, 0 failures, tool calls present, all five knobs verified in-job.
  • 84 tests pass. The timeout tests execute the config script the wrapper carries against a seeded openclaw.json containing an agents.list entry, 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 main this is masked by an earlier issue: ea4c6c6c9 raised requires-python to >=3.13.14 while the gym-runtime image ships CPython 3.12.13, so trunk dies at uv venv before OpenClaw is invoked. Fixing the image alone exposes these immediately.

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]>
@copy-pr-bot

copy-pr-bot Bot commented Aug 11, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

…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]>
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]>
@laszkiewiczp laszkiewiczp changed the title fix(pinchbench): stop writing timeoutSeconds onto agents.list entries; configurable stalled-run abort fix(pinchbench): OpenClaw timeout configuration — invalid agents.list key, clamped run ceiling, coupled knobs Aug 12, 2026
…26-pinchbench-agents-list-timeoutseconds

Signed-off-by: plaszkiewicz <[email protected]>

@kslowik kslowik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@laszkiewiczp
laszkiewiczp merged commit 349244f into main Aug 12, 2026
9 checks passed
@laszkiewiczp
laszkiewiczp deleted the plaszkiewicz/gymbugs-26-pinchbench-agents-list-timeoutseconds branch August 12, 2026 14:48
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