mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#6209
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4025
Author: @SpicyMarinara
Created: 7/24/2026
Status: ✅ Merged
Merged: 7/24/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/3958-agent-call-timeout-env📝 Commits (4)
9ba3a89feat(agents): make the agent LLM call timeout configurable via AGENT_CALL_TIMEOUT_MSa4db679fix: address CodeRabbit review on AGENT_CALL_TIMEOUT_MS PR3e4f462Merge branch 'staging' into fix/3958-agent-call-timeout-envdf77ce6docs(env): order AGENT_CALL_TIMEOUT_MS first in the timeouts group📊 Changes
5 files changed (+56 additions, -7 deletions)
View changed files
📝
.env.example(+5 -0)📝
CHANGELOG.md(+2 -0)📝
docs/CONFIGURATION.md(+2 -1)📝
packages/server/src/config/runtime-config.ts(+35 -0)📝
packages/server/src/services/agents/agent-executor.ts(+12 -6)📄 Description
Why
Fixes the root cause reported in #3958 (and its follow-up comment): local LLMs running as agents are cancelled mid-generation and then fail JSON validation on truncated output, even when actively streaming.
The reporter set
CHAT_GENERATION_TIMEOUT_MS=3600000and still saw failures. That's because agent LLM calls never consulted that setting. Every agent call (trackers, HTML reformatter, etc.) was bounded by a hardcoded constant:turned into
AbortSignal.timeout(300_000)inagentCallSignal(). Two consequences:cancel tasklog in the issue.This also explains the reporter's "mysterious 600s second pass": when the first agent pass is cut at 300s, the truncated output fails JSON validation and the executor automatically retries once with a fresh 300s signal — so from the wall clock the second cancel lands at ~600s. It was 300 + 300, not a different timeout.
What changed
runtime-config.ts: newgetAgentCallTimeoutMs()readingAGENT_CALL_TIMEOUT_MS(valid range 10000–3600000, default 300000), hot-reloaded per run and validated/warned exactly likeCHAT_GENERATION_TIMEOUT_MS.agent-executor.ts:agentCallSignal()now uses the configured value; the illustrator keeps at least its built-in 30-minute budget viaMath.max. The hardcodedDEFAULT_AGENT_CALL_TIMEOUT_MSconstant is removed (the default now lives in runtime-config)..env.exampleanddocs/CONFIGURATION.md: document the new knob next toCHAT_GENERATION_TIMEOUT_MS, noting it is a total-duration cap applied even while streaming.CHANGELOG.md: Unreleased → Added.The automatic invalid-JSON retry behavior is unchanged — but with a correctly-sized budget the first pass should now complete, so the double-timeout stops happening.
Test plan
AGENT_CALL_TIMEOUT_MS=1800000.AGENT_CALL_TIMEOUT_MS(e.g.abc,5,99999999) logs the range warning once and falls back to 300000..envwithout a server restart (likeCHAT_GENERATION_TIMEOUT_MS).pnpm checkpasses. (It passed in the authoring session; re-verify locally.)Closes #3958.
Summary by CodeRabbit
New Features
AGENT_CALL_TIMEOUT_MSsetting for controlling the maximum duration of individual agent calls, including streaming.Documentation
Bug Fixes
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.