LibreChat/api/server/controllers/agents
Marco Beretta 2cf1007f3c
🧺 feat: Preserve Partial Work at Tool Call Limits (#15486)
* feat: Handle reaching the agent tool-call limit gracefully

When the graph exhausts its per-turn step budget, persist the turn as
unfinished with finish_reason tool_call_limit instead of a red error.
Warn the model as the budget runs low, and offer Keep going or Answer now.

* docs: Add screenshots of the tool-call-limit notice

Light and dark captures of the unfinished-turn card for the PR description.

* style: Tighten the tool-call-limit notice card

Pin dismiss to the top-right with uniform rounding, use a slightly
smaller hit target, and round the card to xl. Refresh the PR screenshots.

* fix: Address Copilot review findings on the step-budget path

Skip empty and subagent-scoped PostToolBatch events when counting
rounds. Drop the double-cast in the notice test helper and coerce the
tool-call-limit finish reason in the Continue-gate spec.

* fix: Address Codex review findings on budget and dismiss

Pass the resolved recursion limit into the OpenAI-compatible
processStream path so the step-budget hook matches the graph.
Reset the notice dismiss state when the displayed message id changes.

* fix: Unblock CI typecheck and import sorting

Declare recursion_limit on the OpenAI service agent type, sort that
file's local imports, and route the notice test context through unknown
so tsc accepts the partial ChatContext fixture.

* fix: Sort remaining PR imports for static checks

* chore: Remove tool-call-limit notice screenshots

* fix: Keep recovery actions from consuming composer drafts

Pass empty file, skill, and quote overrides on Keep going and Answer
now so a staged compose is not attached or drained.
2026-09-01 21:38:02 -04:00
..
__tests__ 🧺 feat: Preserve Partial Work at Tool Call Limits (#15486) 2026-09-01 21:38:02 -04:00
callbacks.background.spec.js 🛂 feat: Filter Model-Bound Content by Source (#14425) 2026-08-21 22:43:32 -04:00
callbacks.js 🛫 feat: Enable Self-Service Code Worker Pairing (#15367) 2026-09-01 18:46:33 -04:00
client.imageDetail.spec.js 🖍️ fix: Honor Agent Image Detail Settings (#15407) 2026-08-31 08:34:05 -04:00
client.js 🧺 feat: Preserve Partial Work at Tool Call Limits (#15486) 2026-09-01 21:38:02 -04:00
client.test.js 🧺 feat: Preserve Partial Work at Tool Call Limits (#15486) 2026-09-01 21:38:02 -04:00
errors.js 🧾 fix: Honor Disabled Transactions on the Assistants Usage Path (#15100) 2026-08-25 08:30:12 -04:00
filterAuthorizedTools.spec.js 🔗 fix: Resolve MCP Tool-Key Boundary Against Configured Server Names (#14448) 2026-07-27 14:45:38 -04:00
openai.js 🧶 fix: Preserve Multi-Agent Tool Call History (#15468) 2026-09-01 18:37:45 -04:00
protocol.js 🛫 refactor: Promote Generation Protocol V2 Automatically (#15324) 2026-08-28 17:17:09 -04:00
queuedTurns.js 📬 feat: Move Agent Queued Turns Server-Side (#15370) 2026-08-30 21:53:58 -04:00
recordCollectedUsage.spec.js 🪢 chore: Consolidate Pricing and Tx Imports After tx.js Module Removal (#12086) 2026-03-21 14:28:53 -04:00
request.js 🧺 feat: Preserve Partial Work at Tool Call Limits (#15486) 2026-09-01 21:38:02 -04:00
responses.js 🧺 feat: Preserve Partial Work at Tool Call Limits (#15486) 2026-09-01 21:38:02 -04:00
resume.js 🧺 feat: Preserve Partial Work at Tool Call Limits (#15486) 2026-09-01 21:38:02 -04:00
steer.js 📬 feat: Move Agent Queued Turns Server-Side (#15370) 2026-08-30 21:53:58 -04:00
v1.js 🛞 feat: Manage Personal Code Environment Lifecycles (#15369) 2026-09-01 21:10:05 -04:00
v1.spec.js 🛫 feat: Enable Self-Service Code Worker Pairing (#15367) 2026-09-01 18:46:33 -04:00