feat(hermes): add memory flush setting

This commit is contained in:
晴天
2026-05-24 20:34:12 +08:00
parent 56e41dd512
commit d9fc9a8783
6 changed files with 54 additions and 1 deletions

View File

@@ -40,6 +40,7 @@ const MEMORY_DEFAULTS = {
memoryCharLimit: 2200,
userCharLimit: 1375,
nudgeInterval: 10,
flushMinTurns: 6,
}
const STREAMING_DEFAULTS = {
@@ -343,6 +344,10 @@ export function render() {
<span class="hm-field-label">${t('engine.hermesMemoryConfigNudgeInterval')}</span>
<input id="hm-memory-nudge-interval" class="hm-input" type="number" inputmode="numeric" min="0" max="1000" step="1" value="${esc(memoryValues.nudgeInterval)}" ${disabled ? 'disabled' : ''}>
</label>
<label class="hm-field">
<span class="hm-field-label">${t('engine.hermesMemoryConfigFlushMinTurns')}</span>
<input id="hm-memory-flush-min-turns" class="hm-input" type="number" inputmode="numeric" min="0" max="1000" step="1" value="${esc(memoryValues.flushMinTurns)}" ${disabled ? 'disabled' : ''}>
</label>
</div>
<div class="hm-channel-footnote">${t('engine.hermesMemoryConfigFootnote')}</div>
</div>
@@ -864,6 +869,7 @@ export function render() {
memoryCharLimit: el.querySelector('#hm-memory-char-limit')?.value || '2200',
userCharLimit: el.querySelector('#hm-memory-user-char-limit')?.value || '1375',
nudgeInterval: el.querySelector('#hm-memory-nudge-interval')?.value || '10',
flushMinTurns: el.querySelector('#hm-memory-flush-min-turns')?.value || '6',
}
memorySaving = true
memoryError = null