Skip to content

fix: bound unset LLM request timeout (600s) instead of litellm's 6000s default - #5972

Merged
praisonai-triage-agent[bot] merged 2 commits into
mainfrom
claude/issue-5968-20261024
Oct 24, 2026
Merged

praisonai-triage-agent[bot] merged 2 commits into
mainfrom
claude/issue-5968-20261024

Conversation

@praisonai-triage-agent

Copy link
Copy Markdown
Contributor

Fixes #5968

What

LLM(timeout=...) defaulted to None, so no timeout went to litellm and its 6000 s (100 min) request_timeout ceiling applied. A provider that accepts the connection and never answers held the turn that long on every attempt.

This PR uses a sentinel default, so an unset timeout now resolves to 600 s. That matches the OpenAI SDK default the bare-model-name path (llm="gpt-4o-mini") already uses, so both routes now have the same bound. For streams it limits the gap between reads, so a slow stream that keeps sending data is not cut off.

  • timeout=None or 0 passed explicitly → same as before: no timeout sent, unbounded (llm={"model": ..., "timeout": None}).
  • timeout=N → forwarded unchanged.
  • No new params, exports or dependencies. agent.py is untouched.

Why 600 s and not 120 s

A non-streaming call gets no bytes back until the model finishes. High-effort reasoning models often take more than 2 minutes, so 120 s would break working setups. 600 s still cuts the stall from 100 min to 10 min.

Out of scope (deliberately)

I left the ToolConfig.timeout default at None. A finite default would abandon tools that legitimately run long or block, such as human-input/approval prompts, long shell/code runs and crawls. Abandoning a thread also doesn't stop it, so the worker stays pinned anyway. Per-tool ToolConfig(timeout=...) is still available.

Tests

  • New: tests/unit/llm/test_default_request_timeout.py. Covers the default, explicit None/0 opt-out and explicit values, for both the completion and Responses param builders.
  • tests/unit: 12278 passed. The 27 failures are all pre-existing on main (missing optional deps fastapi, starlette and chonkie, plus timing-sensitive tests); I checked by re-running them with this change stashed.

🤖 Generated with Claude Code

…0s (fixes #5968)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f275b14f-b8e0-4a5c-b5e2-ac0978ce895d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@MervinPraison

Copy link
Copy Markdown
Owner

@coderabbitai review

@MervinPraison

Copy link
Copy Markdown
Owner

/review

@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@MervinPraison MervinPraison added pipeline/blocked:ci Blocked: CI not green on HEAD pipeline/blocked:no-final Blocked: no FINAL @claude trigger yet pipeline/final-claude-pending Reviews done; waiting for FINAL @claude labels Oct 24, 2026
@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review skipped.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@greptile-apps

greptile-apps Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The changes appear safe to merge; no blocking issues were found.

Summary

Unset LLM.timeout now resolves to 600 seconds. Explicit values retain their existing behavior.

  • Python LLM requests now default to a 600-second timeout.

Reviews (2) · Last reviewed commit: "fix: waive LLM.__init__.timeout signatur..." · Reviewed by Greptile

@MervinPraison

Copy link
Copy Markdown
Owner

@claude You are the FINAL architecture reviewer. If the branch is under MervinPraison/PraisonAI (not a fork), you are able to make modifications to this branch and push directly. SCOPE: Review changes in this PR. Python SDK: praisonaiagents, praisonai. TypeScript SDK: src/praisonai-ts/. Do NOT modify src/praisonai-rust. Read ALL comments above from Gemini, Qodo, CodeRabbit, and Copilot carefully before responding.

MANDATORY READ (before reviewing):

  • Always read src/praisonai-agents/AGENTS.md
  • If this PR touches src/praisonai-ts/, also read src/praisonai-ts/AGENTS.md §2.1.2 (TS triage + PR review checklist)

Phase 1: Review per AGENTS.md

  1. Protocol-driven: check heavy implementations vs core SDK
  2. Backward compatible: ensure zero feature regressions
  3. Performance: no hot-path regressions
  4. SDK value: review in depth whether the change genuinely adds value to the SDK — never add features for the sake of adding them. It must strengthen the SDK (simpler, more user-friendly, robust, world-class, secure). If it does not clearly add value, request changes or recommend rejecting/closing rather than merging scope creep
  5. Do not bloat the Agent class with additional params — only if absolutely required; we already support many params.
  6. Repo routing: agent-callable tools → PraisonAI-Tools; lifecycle plugins → PraisonAI-Plugins; optional sandbox backends → PraisonAI-Plugins (praisonai.sandbox entry point) — request changes if wrongly added to praisonaiagents/
    6b. External tool examples (examples/tools/external/**): If the diff is confined to that path, mark SDK value ❌ for monorepo merge — redirect the contributor to PraisonAI-Tools; do not Approve for merge unless the PR has the maintainer-accept-example label.
    6c. New vendor *_tools.py in core (src/praisonai-agents/praisonaiagents/tools/): If the PR adds a new *_tools.py for a third-party API/SaaS/dataset (e.g. FXMacroData), mark Repo routing ❌ and SDK value ❌ — redirect to MervinPraison/PraisonAI-Tools. Do not Approve because legacy bundled tools (Tavily/Exa/You.com/etc.) already in core are not precedent for new vendor modules. Request changes or recommend closing unless the PR has maintainer-accept-core-tools.

MANDATORY COMMENT FORMAT — include this Phase 1 table in your review comment:

Phase 1 — AGENTS.md review

Check Result
Protocol-driven / no heavy impl in core ✅ or ❌ + one-line rationale
Backward compatible ✅ or ❌ + one-line rationale
Performance (hot path) ✅ or ❌ + one-line rationale
SDK value ✅ or ❌ + one-line rationale (explicitly judge whether the change strengthens the SDK)
No Agent param bloat ✅ or ❌ + one-line rationale
Repo routing ✅ or ❌ + one-line rationale

For TypeScript PRs (src/praisonai-ts/), also add:
| TS types / parity / tests | ✅ or ❌ + one-line rationale (npm run build && npm test) |

Phase 2: FIX Valid Issues
7. For any VALID bugs or architectural flaws found by Gemini, CodeRabbit, Qodo, Copilot, or any other reviewer: implement the fix
8. Also independently identify and fix any gaps or issues you find in the changed code — do not rely only on prior reviewer feedback
9. Push all code fixes directly to THIS branch (do NOT create a new PR)
10. Comment a summary of exact files modified and what you skipped

Phase 3: Final Verdict
11. Never Approve or write “Approve for merge” if any Phase 1 row is ❌, if rule 6b/6c applies, or if the change belongs in PraisonAI-Tools/PraisonAI-Plugins. Use Request changes, redirect to the external repo, and recommend closing the monorepo PR when routing is wrong.
12. Approve only when every Phase 1 row is ✅ (including Repo routing and SDK value) and blocking issues are resolved; otherwise request changes with clear action items

@MervinPraison MervinPraison added pipeline/awaiting-merge-gate FINAL done; waiting for merge gate / CI pipeline/blocked:cooldown Blocked: post-push or @claude cooldown pipeline/blocked:stale-final Blocked: FINAL stale after new commits and removed pipeline/final-claude-pending Reviews done; waiting for FINAL @claude pipeline/blocked:no-final Blocked: no FINAL @claude trigger yet labels Oct 24, 2026
…SDK's 600s default)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@praisonai-triage-agent

Copy link
Copy Markdown
Contributor Author

Final architecture review — PR #5972

Phase 1 — AGENTS.md review

Check Result
Protocol-driven / no heavy impl in core ✅ Changes one constant and one line in __init__ in llm/llm.py; no new module
Backward compatible ✅ An explicit timeout=N is still forwarded, and timeout=None/0 still omits the parameter. Only the unset case changes: 6000s → 600s
Performance (hot path) ✅ One sentinel comparison at construction time
SDK value ✅ Fixes a real robustness bug: a provider that accepts the connection and never answers no longer blocks a turn for about 100 minutes per attempt. 600s matches the OpenAI SDK default
No Agent param bloat ✅ No new parameters, on Agent or LLM
Repo routing ✅ The core LLM request path belongs in praisonaiagents

Phase 2 — Fixes pushed (commit 46ebf06)

Prior reviewers (Greptile 5/5, CodeRabbit, Qodo) raised no actionable findings. Qodo's review is paused for billing.

The one blocking issue was the failed signatures CI check: LLM.__init__: parameter timeout default differs: python=_TIMEOUT_UNSET typescript=undefined.

  • Modified: src/praisonai/praisonai/_dev/parity/signatures/waivers.yaml — added the LLM.__init__.timeout waiver. The behaviour is the same on both sides: TS leaves timeout undefined, and the OpenAI Node SDK then applies timeout: options.timeout ?? 600000 /* 10 minutes */, which I checked in node_modules/openai/index.js. Porting a literal default to TS would add nothing.
  • Skipped: no TS change, since behaviour already matches. I also didn't regenerate SIGNATURE_PARITY.md/signature-parity.json, because main regenerates them on push.

Verification

  • python -m praisonai._dev.parity.signatures --check → signature parity: OK
  • tests/unit/llm → 951 passed, 3 skipped
  • tests/unit → 12278 passed and 27 failed. Every failure is either a missing optional dependency in this environment (fastapi, typer, starlette, chonkie) or comes from tests/unit/test_placement.py. That file fails 9 tests identically with the pre-PR llm.py, so the PR doesn't cause them.

Phase 3 — Verdict

✅ Approve. Every Phase 1 row passes and the blocking CI failure is resolved.

@MervinPraison MervinPraison removed pipeline/blocked:cooldown Blocked: post-push or @claude cooldown pipeline/blocked:stale-final Blocked: FINAL stale after new commits labels Oct 24, 2026
@praisonai-triage-agent

Copy link
Copy Markdown
Contributor Author

Merge gate scan — eligible for assessment. Claude merge gate will assess and may auto-merge on an APPROVE verdict.

@praisonai-triage-agent praisonai-triage-agent Bot added pipeline/merge-ready Eligible for merge gate auto-merge claude-merge-gate-active pipeline/awaiting-merge-gate FINAL done; waiting for merge gate / CI and removed pipeline/awaiting-merge-gate FINAL done; waiting for merge gate / CI pipeline/blocked:ci Blocked: CI not green on HEAD pipeline/merge-ready Eligible for merge gate auto-merge labels Oct 24, 2026
@praisonai-triage-agent

Copy link
Copy Markdown
Contributor Author

MERGE_GATE_VERDICT: APPROVE

Rationale (HEAD 46ebf06):

  • Scope: 3 files, +48/-2. llm/llm.py gets a sentinel default, so an unset timeout now resolves to 600s instead of litellm's 6000s ceiling. An explicit None/0/N behaves exactly as before. The PR adds a unit test (tests/unit/llm/test_default_request_timeout.py) and a signature-parity waiver in _dev/parity/signatures/waivers.yaml.
  • SDK value: fixes a real problem where a provider that never answers could stall a turn for up to 100 minutes. No new params, exports, modules or dependencies, so no scope creep.
  • Agent bloat: agent.py is untouched and there are no new Agent/LLM __init__ params.
  • Repo routing: this is the core LLM request path, so it belongs in praisonaiagents. No tools, plugins or sandbox backends added, and no new *_tools.py.
  • Final architecture review ran with the Phase 1 table. Every row is ✅, including SDK value, and its verdict was Approve. Greptile gave 5/5 with no findings.
  • No CHANGES_REQUESTED reviews. Labels: no security, breaking-change, needs-manual-review or release label. Sensitive paths: no workflows, auth or pyproject.toml touched. No secrets in the diff.
  • Author: praisonai-triage-agent[bot], which is on the allowlist. Not a fork.
  • CI: the earlier signatures parity failure was fixed by the waiver commit at this HEAD. I did not see any failed check on this HEAD.
  • Note: I could not read AGENTS.md through the tools in this run. The review is based on the gate checklist rules.

@praisonai-triage-agent
praisonai-triage-agent Bot merged commit 49b2164 into main Oct 24, 2026
44 checks passed
@praisonai-triage-agent

Copy link
Copy Markdown
Contributor Author

Merged by Claude PR merge gate (claude-merge-gate.yml).
Verdict: MERGE_GATE_VERDICT: APPROVE
SHA: 46ebf06
Method: merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merged-by-gate pipeline/awaiting-merge-gate FINAL done; waiting for merge gate / CI

Projects

None yet

1 participant