feat/fix: add regenerate button on failed message responses (#7844)

* fix: align KV cache default settings with actual runtime behavior

The documented defaults for cache_type_k and cache_type_v were f16, but
the extension's migrateKvCacheDefaults() function converts these to q8_0
on initialization. This commit updates the documented defaults to match
the actual runtime behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: add regenerate button on failed message responses

Show a "Regenerate" button when a message response errors out,
allowing users to retry without leaving the thread. Excludes
out-of-context-size errors which already have a dedicated button.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: revert lockfile changes from regenerate button commit

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
linuxid10t
2026-03-30 10:41:24 +08:00
committed by GitHub
parent ffd834c8e5
commit 7070f79aa1

View File

@@ -46,7 +46,7 @@ import { PromptProgress } from '@/components/PromptProgress'
import { useToolAvailable } from '@/hooks/useToolAvailable'
import { OUT_OF_CONTEXT_SIZE } from '@/utils/error'
import { Button } from '@/components/ui/button'
import { IconAlertCircle } from '@tabler/icons-react'
import { IconAlertCircle, IconRefresh } from '@tabler/icons-react'
import { useToolApproval } from '@/hooks/useToolApproval'
import DropdownModelProvider from '@/containers/DropdownModelProvider'
import { ExtensionTypeEnum, VectorDBExtension } from '@janhq/core'
@@ -1037,7 +1037,17 @@ function ThreadDetail() {
<IconAlertCircle className="size-4 mr-2" />
Increase Context Size
</Button>
) : null}
) : (
<Button
variant="outline"
size="sm"
className="mt-3"
onClick={() => handleRegenerate()}
>
<IconRefresh className="size-4 mr-2" />
Regenerate
</Button>
)}
</div>
</div>
</div>