feat(agents): surface timeout budget in tool schemas and errors #84

Merged
CoreRasurae merged 3 commits from feature/m2-tool-timeout-awareness into master 2026-07-31 08:31:16 +00:00
Member

Summary

  • Surfaces the tool agent's configurable timeout (seconds) in the LLM-facing schemas for shell and http_request — the only two built-in tools whose execution actually enforces it — so the model knows upfront these calls are time-boxed.
  • When either tool times out, the raised error now names timeout as the adjustable config field (not just the elapsed seconds), and http_request now distinguishes a timeout from other request failures instead of collapsing everything into a generic "HTTP request failed" message. Non-timeout HTTP failures are unaffected.
  • No new ADR: this stays within ADR-2030's already-accepted extensions (D-1 schema registry, D-4/D-6 error-quality improvements).
  • Second, separate commit: wires the previously-unused benchmark_regression nox session into CI as a new, non-blocking benchmark job — ASV benchmarks existed (asv.conf.json, benchmarks/) but were never invoked by any workflow. Kept informational (not in status-check's required list) since a local run took ~15 minutes.

Closes #82

Test plan

  • nox -s lint — clean
  • nox -s format -- --check — clean
  • nox -s typecheck — 0 errors (1 pre-existing, unrelated warning: langchain_google_genai import)
  • nox -s security_scan — 0 findings (bandit + semgrep)
  • nox -s dead_code — clean
  • nox -s unit_tests — 141 features / 2782 scenarios / 13172 steps passed
  • nox -s coverage_report — 96.8% (>= 96.5% threshold); llm_tools.py 100%, tool.py 98% (no missing coverage on changed lines)
  • nox -s integration_tests (Robot Framework) — 27/27 suites passed
  • nox -s benchmark_regression (ASV) — "BENCHMARKS NOT SIGNIFICANTLY CHANGED", as expected for a messaging-only change

🤖 Generated with Claude Code

## Summary - Surfaces the tool agent's configurable `timeout` (seconds) in the LLM-facing schemas for `shell` and `http_request` — the only two built-in tools whose execution actually enforces it — so the model knows upfront these calls are time-boxed. - When either tool times out, the raised error now names `timeout` as the adjustable config field (not just the elapsed seconds), and `http_request` now distinguishes a timeout from other request failures instead of collapsing everything into a generic "HTTP request failed" message. Non-timeout HTTP failures are unaffected. - No new ADR: this stays within ADR-2030's already-accepted extensions (D-1 schema registry, D-4/D-6 error-quality improvements). - Second, separate commit: wires the previously-unused `benchmark_regression` nox session into CI as a new, non-blocking `benchmark` job — ASV benchmarks existed (`asv.conf.json`, `benchmarks/`) but were never invoked by any workflow. Kept informational (not in `status-check`'s required list) since a local run took ~15 minutes. Closes #82 ## Test plan - [x] `nox -s lint` — clean - [x] `nox -s format -- --check` — clean - [x] `nox -s typecheck` — 0 errors (1 pre-existing, unrelated warning: `langchain_google_genai` import) - [x] `nox -s security_scan` — 0 findings (bandit + semgrep) - [x] `nox -s dead_code` — clean - [x] `nox -s unit_tests` — 141 features / 2782 scenarios / 13172 steps passed - [x] `nox -s coverage_report` — 96.8% (>= 96.5% threshold); `llm_tools.py` 100%, `tool.py` 98% (no missing coverage on changed lines) - [x] `nox -s integration_tests` (Robot Framework) — 27/27 suites passed - [x] `nox -s benchmark_regression` (ASV) — "BENCHMARKS NOT SIGNIFICANTLY CHANGED", as expected for a messaging-only change 🤖 Generated with [Claude Code](https://claude.com/claude-code)
CoreRasurae added this to the v2.1.0 milestone 2026-07-30 17:42:20 +00:00
CoreRasurae added the
Type
Feature
label 2026-07-30 17:43:29 +00:00
CoreRasurae force-pushed feature/m2-tool-timeout-awareness from 0ddbdd8312 to 91cb2b0f95 2026-07-30 17:56:59 +00:00 Compare
CoreRasurae force-pushed feature/m2-tool-timeout-awareness from 91cb2b0f95 to 2d3b45f2f5 2026-07-30 18:15:36 +00:00 Compare
CoreRasurae added 2 commits 2026-07-30 18:24:54 +00:00
The `benchmark` and `benchmark_regression` nox sessions existed and
were fully functional (asv.conf.json configured, benchmarks/ populated),
but neither was ever invoked by any CI workflow — only Robot Framework
integration_tests was actually wired in and required for merge.

Adds a `benchmark` job running `nox -s benchmark_regression` (asv
continuous against origin/master). Requires fetch-depth: 0 plus an
explicit fetch of origin/master, since the other jobs' shallow/ref-only
checkout wouldn't have that ref available for the diff.

Deliberately NOT added to status-check's required job list: a local run
of benchmark_regression took ~15 minutes end-to-end (69 benchmarks x 2
commits x repeated timing rounds for statistical confidence), which is
too slow to gate every merge. continue-on-error: true and the nox
session's own success_codes=[0, 2] keep it non-blocking; results are
still uploaded as an artifact for manual inspection, matching the
project's stated intent for benchmark checks to be informational.

Refs: #82
CoreRasurae force-pushed feature/m2-tool-timeout-awareness from 2d3b45f2f5 to c04b7ba7eb 2026-07-30 18:24:54 +00:00 Compare
CoreRasurae added 1 commit 2026-07-30 18:30:12 +00:00
feat(agents): surface timeout budget in tool schemas and errors
CI / lint (pull_request) Successful in 50s
CI / quality (pull_request) Successful in 55s
CI / security (pull_request) Successful in 1m25s
CI / typecheck (pull_request) Successful in 1m34s
CI / build (pull_request) Successful in 1m34s
CI / integration_tests (pull_request) Successful in 5m18s
CI / unit_tests (pull_request) Successful in 6m38s
CI / benchmark (pull_request) Failing after 42m6s
CI / lint (push) Successful in 47s
CI / typecheck (push) Successful in 1m26s
CI / security (push) Successful in 1m9s
CI / quality (push) Successful in 50s
CI / build (push) Successful in 1m36s
CI / integration_tests (push) Successful in 3m45s
CI / unit_tests (push) Successful in 5m42s
CI / coverage (push) Successful in 4m44s
CI / status-check (push) Successful in 6s
CI / benchmark (push) Successful in 44m16s
CI / coverage (pull_request) Successful in 4m57s
CI / status-check (pull_request) Successful in 7s
4b354f5b2d
The `shell` and `http_request` built-in tools are the only two whose
execution actually honors the tool agent's `timeout` config field
(ToolAgent._execute_shell_command, ToolAgent._http_request_tool), but
their LLM-facing schemas (_BUILTIN_TOOL_SCHEMAS in llm_tools.py) never
told the model a timeout applied, and neither tool's timeout error
named the config field that controls it.

- _BUILTIN_TOOL_SCHEMAS["shell"] and ["http_request"] descriptions now
  state that execution is bounded by the agent's configured `timeout`
  (seconds), matching the existing precedent of documenting `file_read`'s
  `max_chars` behavior in its schema.
- _execute_shell_command's timeout ExecutionError now names `timeout`
  as the adjustable config field, in addition to the elapsed seconds it
  already reported.
- _http_request_tool now catches asyncio.TimeoutError distinctly from
  the generic `except Exception`, so a request timeout produces a
  message naming the config field instead of the previous generic
  "HTTP request failed" text (which gave no indication a timeout was
  the cause). Non-timeout HTTP failures are unaffected — same
  exception handling, same message shape as before.

No change to enforcement mechanics: `self.timeout` remains the sole
config field (default 1s, Actor Configuration Standard §4.5). This is
schema/message content only, within the extension precedent already
established by ADR-2030 (D-1 schema registry, D-4/D-6 error-quality
improvements) — no new ADR was needed for this change.

Tests: extended features/tool_agent.feature (updated the two existing
shell/http_request timeout scenarios to also assert the new config-field
hint) and features/llm_tools_coverage.feature (new scenarios asserting
both schema descriptions mention the timeout budget). Full suite:
141 features / 2782 scenarios / 13172 steps passed; coverage 96.8%
(>=96.5% threshold). Robot integration_tests: 27/27 suites passed.
ASV benchmark_regression: no significant change, as expected for a
messaging-only change.

ISSUES CLOSED: #82
CoreRasurae force-pushed feature/m2-tool-timeout-awareness from c04b7ba7eb to 4b354f5b2d 2026-07-30 18:30:12 +00:00 Compare
hurui200320 approved these changes 2026-07-31 06:10:57 +00:00
hurui200320 left a comment
Member

PR Review: !84 (Ticket #82)

Verdict: Approve

The implementation correctly surfaces the configurable timeout budget in the LLM-facing schemas for shell and http_request, and enriches both timeout error paths with the timeout config field name while preserving the existing message shape for non-timeout HTTP failures. Tests cover the new schema wording and both timeout error messages, plus the non-timeout HTTP failure regression guard. No critical or major correctness, security, or performance issues were found.

Critical Issues

None

Major Issues

None

Minor Issues

  • Coverage threshold documentation mismatch (noxfile.py:27, CONTRIBUTING.md:317-318, issue #82 acceptance criteria): The PR reports overall coverage of 96.8%, which passes the COVERAGE_THRESHOLD = 96.5 actually enforced by nox -s coverage_report, but falls below the 97% threshold stated in CONTRIBUTING.md and in the issue's acceptance criteria. This is a pre-existing project inconsistency, but it means the issue's stated coverage criterion is not technically met. Recommendation: reconcile the documented threshold (CONTRIBUTING.md, issue template) with the value in noxfile.py, or bring coverage to ≥97%.

Nits

None

Summary

A focused, well-tested change that extends the ADR-2030 precedent for schema hints and actionable error messages to the timeout config field. The timeout-awareness wording is accurate relative to Actor Configuration Standard §4.5, and the new asyncio.TimeoutError branch in _http_request_tool correctly distinguishes timeouts from other request failures without changing non-timeout behavior. Safe to merge after the minor coverage-threshold discrepancy is acknowledged or resolved.

## PR Review: !84 (Ticket #82) ### Verdict: Approve The implementation correctly surfaces the configurable `timeout` budget in the LLM-facing schemas for `shell` and `http_request`, and enriches both timeout error paths with the `timeout` config field name while preserving the existing message shape for non-timeout HTTP failures. Tests cover the new schema wording and both timeout error messages, plus the non-timeout HTTP failure regression guard. No critical or major correctness, security, or performance issues were found. ### Critical Issues None ### Major Issues None ### Minor Issues - **Coverage threshold documentation mismatch** (`noxfile.py:27`, `CONTRIBUTING.md:317-318`, issue #82 acceptance criteria): The PR reports overall coverage of 96.8%, which passes the `COVERAGE_THRESHOLD = 96.5` actually enforced by `nox -s coverage_report`, but falls below the 97% threshold stated in `CONTRIBUTING.md` and in the issue's acceptance criteria. This is a pre-existing project inconsistency, but it means the issue's stated coverage criterion is not technically met. Recommendation: reconcile the documented threshold (CONTRIBUTING.md, issue template) with the value in `noxfile.py`, or bring coverage to ≥97%. ### Nits None ### Summary A focused, well-tested change that extends the ADR-2030 precedent for schema hints and actionable error messages to the `timeout` config field. The timeout-awareness wording is accurate relative to Actor Configuration Standard §4.5, and the new `asyncio.TimeoutError` branch in `_http_request_tool` correctly distinguishes timeouts from other request failures without changing non-timeout behavior. Safe to merge after the minor coverage-threshold discrepancy is acknowledged or resolved.
hurui200320 approved these changes 2026-07-31 06:15:29 +00:00
CoreRasurae merged commit 4b354f5b2d into master 2026-07-31 08:31:16 +00:00
CoreRasurae deleted branch feature/m2-tool-timeout-awareness 2026-07-31 08:31:19 +00:00
Sign in to join this conversation.
No Reviewers
No Label
Type
Feature
2 Participants
Notifications
Due Date
No due date set.
Reference: cleveragents/cleveractors-core#84