mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-16 13:00:55 +00:00
* 🧷 fix: Mark a Failed Compaction So Its Rerun Controls Stay Withheld A manual compaction that failed with an error part carried no marker: the server stamped `initiatedBy: 'user'` only on a summary that produced text and returned early once an error part existed. On a branch ending in a user message, the resulting turn had no marker and a user parent, so the hover row kept Edit, Regenerate and Continue — and using one answered that user message instead of retrying the compaction. `markCompactionOutcome` now marks whichever part carries the outcome, summary or error, and `isUserInitiatedCompaction` reads both. The marking moved from `api/server/controllers/agents/client.js` into `packages/api`, where the behavior belongs; the controller keeps the call. * 🏷️ refactor: Type the compaction spec helpers with SummaryContentPart * 🧯 fix: Record a Marked Failure When a Compaction Produces Nothing A compaction run that produced neither a summary nor an error part threw COMPACTION_FAILED out of `sendCompletion`. The turn was then saved by `saveErrorTurn`, which writes only top-level `text`/`error` and no content, so the row carried no compaction marker: on a user leaf the hover row kept Regenerate, and using it answered that user message. `markCompactionOutcome` now records the typed failure as a marked error content part instead, so the turn streams and persists like every other failed compaction. A cancelled run still fails as a typed error, leaving the abort path to own the turn. `saveErrorTurn` marks the compaction rows it still writes for failures that are rethrown rather than recorded as content. Verified end to end by two new mock scenarios that run Compact context against a summarizer returning nothing, live and after a reload. * 🧪 test: Run the Empty-Compaction Scenarios Against a Real Compaction * 🧱 refactor: Resolve Failed-Turn Compaction Content in packages/api `saveErrorTurn` decided in CJS whether a failed row carries compaction identity. The decision moves to `resolveFailedTurnContent` in `packages/api`, which returns the content fields a failed turn is persisted with — the marked failure for a compaction, nothing for any other turn — and `request.js` spreads the result. * 🧹 fix: Keep an Unusable Summary Out of a Failed Compaction's Turn History loading accepts any nonempty summary as the conversation's checkpoint (`BaseClient.findSummaryContentBlock` ignores `failed`), so a compaction that streamed partial text before failing would have persisted that truncated text beside its recorded failure and replaced the history it failed to summarize. The fallback now drops the unusable summary, leaving the typed failure as the turn's whole outcome. The empty-summarizer scenarios switch the shared fixture summarizer to blank output, so the reset moves to `afterEach` and runs even when the helper throws before its caller's `finally`. |
||
|---|---|---|
| .. | ||
| authenticate.ts | ||
| cleanupUser.ts | ||
| dynamic-mcp-tools.js | ||
| env.ts | ||
| fake-assistants-server.js | ||
| fake-code-server.js | ||
| fake-label-server.js | ||
| fake-mcp-dynamic-network-server.js | ||
| fake-mcp-http-server.js | ||
| fake-mcp-oauth-server.js | ||
| fake-mcp-server.js | ||
| fake-model.js | ||
| fake-rag-server.js | ||
| global-setup.local.ts | ||
| global-setup.ts | ||
| global-teardown.local.ts | ||
| global-teardown.mock.ts | ||
| global-teardown.ts | ||
| model-replay.js | ||
| record-model.js | ||
| record.js | ||
| run-files-lifecycle-model.js | ||
| run-files-model.js | ||
| runtimeEnv.ts | ||
| start-server-cluster.js | ||
| start-server.js | ||
| tool-approval-hook.js | ||
| user.ts | ||
| users.mock.ts | ||