mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #5092] [GUI] Offer /compact in the chat's command menu #5305
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#5305
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/Niko1221/Strata/pull/5092
Author: @storm-ace
Created: 11/3/2026
Status: 🔄 Open
Base:
main← Head:fix/host-compact-menu📝 Commits (1)
1b37ba8fix(host): offer /compact in the chat's command menu📊 Changes
11 files changed (+31 additions, -9 deletions)
View changed files
📝
apps/host/src/locales/fix-de.json(+2 -1)📝
apps/host/src/locales/fix-en.json(+2 -1)📝
apps/host/src/locales/fix-es.json(+2 -1)📝
apps/host/src/locales/fix-fr.json(+2 -1)📝
apps/host/src/locales/fix-ja.json(+2 -1)📝
apps/host/src/locales/fix-ko.json(+2 -1)📝
apps/host/src/locales/fix-pt.json(+2 -1)📝
apps/host/src/locales/fix-ru.json(+2 -1)📝
apps/host/src/locales/fix-zh.json(+2 -1)📝
apps/host/src/screens/Chat.tsx(+1 -0)📝
apps/host/tests/context-ui.test.mjs(+12 -0)📄 Description
Addresses part of #5091: the missing
/compactentry in the slash menu. The warning before the automatic summary that #5091 also asks for is not in this PR. Related: #4847 makes the summary threshold a setting.Problem
The host already handles
/compact: it summarises the older messages of a chat (apps/host/server/index.mjs,compactCommand). The chat's command menu did not list it. Typing/compactshowed "No command matches “/compact”", so the command looked like it did not exist.This matters for speed. Decode slows as a chat grows, because every token reads the whole K/V cache. The automatic summary only starts near the end of the window (at most 80% of it), so a long chat that still fits is never made smaller by itself.
/compactis how a person makes it smaller sooner.Result
The menu lists
/compact, with the hint "Summarize the older messages so the chat is faster and has room again". Picking it (click, Enter or Tab) clears the draft and sends/compactat once. Nothing else changes.Approach
apps/host/src/screens/Chat.tsx: one entry inuseSlashCommands. It sends withsendMessage('/compact'), the same call the "Summarize and continue" button already makes.apps/host/src/locales/fix-*.json: the hint asfx86in all nine languages.apps/host/tests/context-ui.test.mjs: a test for the menu entry and that the hint is translated.Validation
Passed
node --test tests/context-ui.test.mjs tests/locale-gaps.test.mjs tests/french-catalog.test.mjs: 15 of 15, the new test included.STRATA_PORT=8795, its ownSTRATA_HOME, simulated engine, a build of this branch): typing/coshows/compactwith its hint; Enter clears the draft and sends it. With no model loaded the page says "No model is loaded", as for any message.Failed
npm teston Windows 11: 1,342 passed, 7 failed, 108 skipped. None of the seven touches these files. Six are host process and gateway tests. The seventh (#4783inui-do.test.mjs) expects LF line endings insrc/lib/store.tsand the checkout has CRLF. I did not check whether they also fail without this change.Not run
/compactpath. The server tests for it inagent-context.test.mjswere skipped in this environment.Limits
/compactand pressing Enter behaved the same before this change.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.