Skip to content

PinchBench: make OpenClaw provider timeout configurable - #2193

Closed
AWarno wants to merge 9 commits into
mainfrom
awarno/pinchbench-preserve-openclaw-timeout-clean-dco
Closed

AWarno wants to merge 9 commits into
mainfrom
awarno/pinchbench-preserve-openclaw-timeout-clean-dco

Conversation

@AWarno

@AWarno AWarno commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Clean fix for PinchBench/OpenClaw LLM idle timeout handling.

This PR keeps OpenClaw's original provider timeout default at 120s, and adds the minimal Gym config surface needed for EFB runs to explicitly raise it, e.g. 4h.

Changes

  • Add openclaw_provider_timeout_seconds to the PinchBench agent config.
  • Pass that config as PINCHBENCH_PROVIDER_TIMEOUT_SECONDS into the per-task sandbox environment only when it is set.
  • Keep the baked PinchBench patch default at 120 seconds when the env var is unset.
  • Document the config knob in the PinchBench README, including the 4h EFB setting with task_timeout_s=14400.

No runtime sed injection and no direct image patching in app.py; the timeout is owned by the baked PinchBench patch and controlled through env/config.

Validation

Built the PinchBench Docker image from this branch:

PINCHBENCH_IMAGE=pinchbench-openclaw:timeout-120-default-clean-local \
  bash responses_api_agents/pinchbench/setup_scripts/build_image.sh

Verified the baked patch default inside the image:

"timeoutSeconds": int(os.environ.get("PINCHBENCH_PROVIDER_TIMEOUT_SECONDS", "120"))

Ran local PinchBench validation with a fake OpenAI-compatible streaming endpoint that delays 2s before the first streamed token:

case_timeout_1s_expected_idle_timeout=PASS
case_timeout_3s_expected_success=PASS

Haran Kumar Shiv Kumar and others added 5 commits July 29, 2026 16:30
OpenClaw aborts a model request when the endpoint is idle for its stream-idle
watchdog window (DEFAULT_LLM_IDLE_TIMEOUT_MS = 120s). Under high concurrency or with
slow / self-hosted endpoints this fails legitimate-but-slow generations with
[llm-idle-timeout].

Add openclaw_provider_timeout_seconds to the PinchBench agent config. It maps to
OpenClaw models.providers.<id>.timeoutSeconds, which governs the request timeout and
the stream-idle watchdog and (unlike agents.defaults.timeoutSeconds) is not clamped
back to 120s. Applied without rebuilding the image: instance mode injects it into the
in-container lib_agent.py before run_task.sh; direct_exec writes it into the generated
openclaw.json. README documents the knob + usage.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Signed-off-by: Haran Kumar Shiv Kumar <[email protected]>
@hkumar92

Copy link
Copy Markdown
Contributor

LGTM

@hkumar92

Copy link
Copy Markdown
Contributor

Validated end-to-end that this works in both execution modes (built the image from this branch, ran a task through nemo-gym's docker Sandbox-API instance path and the apptainer direct_exec path against a mock endpoint idling 140s):

mode default (patch 120s) openclaw_provider_timeout_seconds: 600
standard (docker instance) aborted ~120s, retried at +121s held the full 140s, no retry
direct-exec (apptainer) aborted ~120s, retried at +120s held the full 140s, no retry

The single baked lib_agent.py patch + app.py env-pass covers both paths (lib_agent.py runs in the sandbox in both). LGTM.

🤖 via Claude Code

@AWarno

AWarno commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by DCO-clean replacement: #2211

The original branch cannot be force-pushed under repository rules, so the replacement PR was created from a rebuilt branch with DCO trailers on all commits.

@AWarno AWarno closed this Jul 30, 2026
AWarno added a commit that referenced this pull request Jul 31, 2026
Replacement for #2193 because the original branch cannot be force-pushed
under the repository rules, and one commit in that history was missing
DCO.

This branch is rebuilt on current `main` with the same PinchBench
timeout changes and DCO trailers on all commits.

Notes:
- Adds/keeps `openclaw_provider_timeout_seconds` for PinchBench.
- Keeps the OpenClaw agent timeout ceiling fix.
- Updates the baked PinchBench patch hunk counts.
- DCO-clean commit range: all commits include `Signed-off-by`.

---------

Signed-off-by: Haran Kumar Shiv Kumar <[email protected]>
Signed-off-by: Anna Warno <[email protected]>
Co-authored-by: Haran Kumar Shiv Kumar <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>
OlegSudakov pushed a commit to OlegSudakov/Gym that referenced this pull request Aug 7, 2026
…-NeMo#2211)

Replacement for NVIDIA-NeMo#2193 because the original branch cannot be force-pushed
under the repository rules, and one commit in that history was missing
DCO.

This branch is rebuilt on current `main` with the same PinchBench
timeout changes and DCO trailers on all commits.

Notes:
- Adds/keeps `openclaw_provider_timeout_seconds` for PinchBench.
- Keeps the OpenClaw agent timeout ceiling fix.
- Updates the baked PinchBench patch hunk counts.
- DCO-clean commit range: all commits include `Signed-off-by`.

---------

Signed-off-by: Haran Kumar Shiv Kumar <[email protected]>
Signed-off-by: Anna Warno <[email protected]>
Co-authored-by: Haran Kumar Shiv Kumar <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>

This branch was previously deployed

1 inactive deployment
public — e0ad05fe Deployed Jul 30, 2026 by copy-pr-bot[bot] via release / finalize / notify #943
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