Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

fix(release): the banner, the note and a retry that had nothing to drop

Daviddeae78e82584
diff --git a/CHANGELOG.md b/CHANGELOG.md
index bc6ddefa..372dbe38 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -44,8 +44,8 @@ what it is doing.
restart now, which matters because installing an update is a restart: work
waiting for your yes is no longer thrown away by the thing meant to rescue
it.
-- **A refused tool call ends the run at once and says why**, instead of the
- agent carrying on as if it had permission.
+- **A request the model server refuses ends the run at once with the reason**,
+ instead of being retried twice while the run still looks alive.
- **The trainer repairs its own environment** instead of refusing to start,
and FramePack gets back the VAE it was trained with, so image-to-video
stops producing mush.
diff --git a/scripts/mark-old-releases.mjs b/scripts/mark-old-releases.mjs
index 8ebb3540..c6ac4c13 100644
--- a/scripts/mark-old-releases.mjs
+++ b/scripts/mark-old-releases.mjs
@@ -14,14 +14,7 @@
* re-run or a manual dispatch is free.
*/
-const MARKER = '<!-- lu-old-release-banner -->'
-const BANNER =
- MARKER +
- '\n> **This is an old release.** Get the current version from the ' +
- '[latest release](https://github.com/PurpleDoubleD/locally-uncensored/releases/latest), ' +
- 'or download the Windows installer straight from ' +
- '[lu-labs.ai](https://lu-labs.ai/api/download/windows). ' +
- 'Older builds miss fixes and features, and some of them predate the Cloud.\n\n'
+import { MARKER, BANNER, withoutBanner, shouldCarryBanner } from './release-banner-rules.mjs'
const repo = process.env.GITHUB_REPOSITORY ?? 'PurpleDoubleD/locally-uncensored'
const token = process.env.GITHUB_TOKEN ?? process.env.GH_TOKEN
@@ -44,14 +37,6 @@ const api = async (path, init = {}) => {
return res.json()
}
-/** Strips a banner wherever it sits, so re-running never stacks them. */
-const withoutBanner = (body) => {
- const at = (body ?? '').indexOf(MARKER)
- if (at < 0) return body ?? ''
- const end = (body ?? '').indexOf('\n\n', at)
- return end < 0 ? '' : (body ?? '').slice(0, at) + (body ?? '').slice(end + 2)
-}
-
const releases = []
for (let page = 1; ; page++) {
const batch = await api(`/releases?per_page=100&page=${page}`)
@@ -67,17 +52,17 @@ console.log(`${releases.length} releases, current is ${latest.tag_name}`)
let added = 0
let removed = 0
for (const rel of releases) {
- const isCurrent = rel.id === latest.id
+ const wants = shouldCarryBanner(rel, latest)
const has = (rel.body ?? '').includes(MARKER)
- if (isCurrent === !has) continue // already in the right state
+ if (wants === has) continue // already in the right state
- const body = isCurrent ? withoutBanner(rel.body) : BANNER + withoutBanner(rel.body)
+ const body = wants ? BANNER + withoutBanner(rel.body) : withoutBanner(rel.body)
await api(`/releases/${rel.id}`, {
method: 'PATCH',
body: JSON.stringify({ body }),
})
- isCurrent ? removed++ : added++
- console.log(` ${isCurrent ? 'cleared' : 'banner '} ${rel.tag_name}`)
+ wants ? added++ : removed++
+ console.log(` ${wants ? 'banner ' : 'cleared'} ${rel.tag_name}`)
}
console.log(`done: ${added} banner added, ${removed} cleared`)
diff --git a/scripts/release-banner-rules.d.mts b/scripts/release-banner-rules.d.mts
new file mode 100644
index 00000000..a2a85c68
--- /dev/null
+++ b/scripts/release-banner-rules.d.mts
@@ -0,0 +1,21 @@
+/** Types for the plain-node rule module. The script itself runs in CI without
+ * a build step, so the implementation stays .mjs and the types live here. */
+
+export declare const MARKER: string
+export declare const BANNER: string
+
+export interface GitHubRelease {
+ id: number
+ tag_name?: string
+ prerelease?: boolean
+ draft?: boolean
+ published_at?: string | null
+ created_at?: string | null
+ body?: string | null
+}
+
+export declare function withoutBanner(body: string | null | undefined): string
+export declare function shouldCarryBanner(
+ rel: GitHubRelease,
+ latest: GitHubRelease | null | undefined,
+): boolean
diff --git a/scripts/release-banner-rules.mjs b/scripts/release-banner-rules.mjs
new file mode 100644
index 00000000..172bb95c
--- /dev/null
+++ b/scripts/release-banner-rules.mjs
@@ -0,0 +1,48 @@
+/**
+ * Which releases carry the "old release" banner.
+ *
+ * Pulled out of mark-old-releases.mjs so the rule can be tested without a
+ * GitHub token. The script itself is a top-level-await program that talks to
+ * the API on import, and the rule is the only part that can be wrong quietly.
+ */
+
+export const MARKER = '<!-- lu-old-release-banner -->'
+
+export const BANNER =
+ MARKER +
+ '\n> **This is an old release.** Get the current version from the ' +
+ '[latest release](https://github.com/PurpleDoubleD/locally-uncensored/releases/latest), ' +
+ 'or download the Windows installer straight from ' +
+ '[lu-labs.ai](https://lu-labs.ai/api/download/windows). ' +
+ 'Older builds miss fixes and features, and some of them predate the Cloud.\n\n'
+
+/** Strips a banner wherever it sits, so re-running never stacks them. */
+export function withoutBanner(body) {
+ const at = (body ?? '').indexOf(MARKER)
+ if (at < 0) return body ?? ''
+ const end = (body ?? '').indexOf('\n\n', at)
+ return end < 0 ? '' : (body ?? '').slice(0, at) + (body ?? '').slice(end + 2)
+}
+
+const stamp = (rel) => Date.parse(rel?.published_at ?? rel?.created_at ?? '') || 0
+
+/**
+ * True when this release should carry the banner.
+ *
+ * `/releases/latest` is the release flagged Latest, which is a deliberate
+ * choice (we publish as a prerelease and flip it once verified), not simply the
+ * newest. So "not Latest" is NOT the same as "old": a release we published
+ * five minutes ago is not Latest yet either, and the old rule stamped it "This
+ * is an old release" the moment it appeared. The Discord announcement then
+ * quotes that body, so the release everyone was waiting for announced itself as
+ * obsolete (review 2026-08-14).
+ *
+ * A prerelease or draft that is at least as new as the current Latest is the
+ * upcoming one and stays clean. Everything older still gets the banner,
+ * including a prerelease that was superseded, because that one really is old.
+ */
+export function shouldCarryBanner(rel, latest) {
+ if (!latest || rel.id === latest.id) return false
+ const upcoming = (rel.prerelease === true || rel.draft === true) && stamp(rel) >= stamp(latest)
+ return !upcoming
+}
diff --git a/src/hooks/__tests__/agent-think-downgrade.test.ts b/src/hooks/__tests__/agent-think-downgrade.test.ts
new file mode 100644
index 00000000..cd12bc0d
--- /dev/null
+++ b/src/hooks/__tests__/agent-think-downgrade.test.ts
@@ -0,0 +1,48 @@
+/**
+ * The thinking downgrade must have something to drop.
+ *
+ * Both agent branches answer a 400 by resending without `thinking`. When the
+ * turn never asked for thinking in the first place, that resend is byte for
+ * byte the request that just failed: a second refusal, a second charge on the
+ * cloud path, and a second wait for the user. useChat has guarded this since
+ * it was written (`useThinking !== undefined`, useChat.ts:560); the agent path
+ * never did (review 2026-08-14).
+ *
+ * Run: npx vitest run src/hooks/__tests__/agent-think-downgrade.test.ts
+ */
+import { describe, it, expect } from 'vitest'
+import { readFileSync } from 'node:fs'
+import { fileURLToPath } from 'node:url'
+import { dirname, resolve } from 'node:path'
+
+const src = readFileSync(
+ resolve(dirname(fileURLToPath(import.meta.url)), '../useAgentChat.ts'), 'utf8',
+)
+
+describe('both branches check before they resend', () => {
+ it('the ollama branch guards on the value it would drop', () => {
+ expect(src).toContain(
+ "if (chatOptions.thinking !== undefined\n" +
+ " && (thinkErr?.message?.includes('does not support thinking')",
+ )
+ })
+
+ it('the provider branch guards on its own', () => {
+ expect(src).toContain(
+ "if (streamOpts.thinking !== undefined\n" +
+ " && (thinkErr?.message?.includes('does not support thinking')",
+ )
+ })
+
+ it('no unguarded downgrade is left anywhere in the file', () => {
+ const unguarded = src.match(
+ /(?<!undefined\s*\n\s*&& \()if \(thinkErr\?\.message\?\.includes\('does not support thinking'\)/g,
+ )
+ expect(unguarded).toBeNull()
+ })
+
+ it('the guard names why, so nobody removes it as noise', () => {
+ expect(src).toContain('Only worth a second attempt if there is something to drop')
+ expect(src).toContain('useChat.ts:560')
+ })
+})
diff --git a/src/hooks/useAgentChat.ts b/src/hooks/useAgentChat.ts
index 8e344001..9ef14ade 100644
--- a/src/hooks/useAgentChat.ts
+++ b/src/hooks/useAgentChat.ts
@@ -833,7 +833,13 @@ export function useAgentChat() {
log.warn('agent.vision_feedback_healed', { model: modelToUse })
continue
}
- if (thinkErr?.message?.includes('does not support thinking') || httpStatusOf(thinkErr) === 400) {
+ // Only worth a second attempt if there is something to drop.
+ // useChat guards the same downgrade with `useThinking !==
+ // undefined` (useChat.ts:560); without it the agent path
+ // resent a byte-identical request and charged the user for a
+ // 400 twice (review 2026-08-14).
+ if (chatOptions.thinking !== undefined
+ && (thinkErr?.message?.includes('does not support thinking') || httpStatusOf(thinkErr) === 400)) {
turn = await streamOllamaChatWithTools(
modelToUse,
agentMessages,
@@ -916,7 +922,13 @@ export function useAgentChat() {
log.warn('agent.vision_feedback_healed', { model: modelToUse, provider: providerId })
continue
}
- if (thinkErr?.message?.includes('does not support thinking') || httpStatusOf(thinkErr) === 400) {
+ // Only worth a second attempt if there is something to drop.
+ // useChat guards the same downgrade with `useThinking !==
+ // undefined` (useChat.ts:560); without it the agent path
+ // resent a byte-identical request and charged the user for a
+ // 400 twice (review 2026-08-14).
+ if (streamOpts.thinking !== undefined
+ && (thinkErr?.message?.includes('does not support thinking') || httpStatusOf(thinkErr) === 400)) {
turn = await streamProviderTurn(provider, modelToUse, agentMessages, { ...streamOpts, thinking: undefined as unknown as boolean }, onLiveContent, () => {})
break
}
diff --git a/src/lib/__tests__/release-banner-rules.test.ts b/src/lib/__tests__/release-banner-rules.test.ts
new file mode 100644
index 00000000..7b95cc3b
--- /dev/null
+++ b/src/lib/__tests__/release-banner-rules.test.ts
@@ -0,0 +1,85 @@
+/**
+ * The release everyone is waiting for must not announce itself as obsolete.
+ *
+ * Found by the review of the D1 prerelease fix (2026-08-14). `/releases/latest`
+ * returns the release flagged Latest, and we publish as a prerelease and flip
+ * that flag only after verifying the build. So on the day 2.6.5 goes out it is
+ * NOT latest, the old rule read that as "old", and the brand-new release got
+ * "This is an old release" stamped on it within a minute of appearing. The
+ * Discord announcement quotes the release body, so the banner would have gone
+ * out with the announcement.
+ *
+ * Run: npx vitest run src/lib/__tests__/release-banner-rules.test.ts
+ */
+import { describe, it, expect } from 'vitest'
+import { shouldCarryBanner, withoutBanner, BANNER, MARKER } from '../../../scripts/release-banner-rules.mjs'
+
+const rel = (over: Record<string, unknown> = {}) => ({
+ id: 1, tag_name: 'v1', prerelease: false, draft: false,
+ published_at: '2026-08-01T00:00:00Z', body: '', ...over,
+})
+
+const latest = rel({ id: 100, tag_name: 'v2.6.4', published_at: '2026-08-10T00:00:00Z' })
+
+describe('what counts as an old release', () => {
+ it('the one flagged Latest never carries it', () => {
+ expect(shouldCarryBanner(latest, latest)).toBe(false)
+ })
+
+ it('a shipped older release carries it', () => {
+ const old = rel({ id: 2, tag_name: 'v2.5.10', published_at: '2026-07-01T00:00:00Z' })
+ expect(shouldCarryBanner(old, latest)).toBe(true)
+ })
+
+ it('THE case: a fresh prerelease published after Latest stays clean', () => {
+ const fresh = rel({
+ id: 3, tag_name: 'v2.6.5', prerelease: true, published_at: '2026-08-14T09:00:00Z',
+ })
+ expect(shouldCarryBanner(fresh, latest)).toBe(false)
+ })
+
+ it('a draft published after Latest stays clean too', () => {
+ const draft = rel({
+ id: 4, tag_name: 'v2.6.6', draft: true, published_at: '2026-08-14T09:00:00Z',
+ })
+ expect(shouldCarryBanner(draft, latest)).toBe(false)
+ })
+
+ it('a prerelease that was superseded really is old and carries it', () => {
+ const stale = rel({
+ id: 5, tag_name: 'v2.6.2-rc', prerelease: true, published_at: '2026-07-20T00:00:00Z',
+ })
+ expect(shouldCarryBanner(stale, latest)).toBe(true)
+ })
+
+ it('a prerelease published the same instant as Latest counts as upcoming', () => {
+ const tie = rel({ id: 6, prerelease: true, published_at: latest.published_at })
+ expect(shouldCarryBanner(tie, latest)).toBe(false)
+ })
+
+ it('a missing date does not silently stamp the newest release', () => {
+ // Date.parse of undefined is NaN, which would compare false against
+ // everything. A release with no usable date is treated as old, which is
+ // the safe direction for a shipped build, and the fresh one keeps its
+ // published_at anyway.
+ const undated = rel({ id: 7, prerelease: true, published_at: null, created_at: null })
+ expect(shouldCarryBanner(undated, latest)).toBe(true)
+ })
+})
+
+describe('the banner text itself', () => {
+ it('stripping is idempotent, so a re-run never stacks two', () => {
+ const body = BANNER + 'real notes\n'
+ expect(withoutBanner(body)).toBe('real notes\n')
+ expect(withoutBanner(withoutBanner(body))).toBe('real notes\n')
+ })
+
+ it('a body without one is returned untouched', () => {
+ expect(withoutBanner('just notes')).toBe('just notes')
+ expect(withoutBanner(undefined)).toBe('')
+ })
+
+ it('carries the marker the script looks for', () => {
+ expect(BANNER.startsWith(MARKER)).toBe(true)
+ })
+})
diff --git a/src/lib/release-notes.ts b/src/lib/release-notes.ts
index d139f7ea..e95d8d2f 100644
--- a/src/lib/release-notes.ts
+++ b/src/lib/release-notes.ts
@@ -46,7 +46,7 @@ export const RELEASE_NOTES: ReleaseNote[] = [
items: [
'The installer shuts our engine down before writing, instead of rolling the update back at a locked llama-server.exe.',
'An approved change lands, or names the conflict. Changes waiting for approval are kept across a restart, and the plan bar no longer claims to be finished while writes are still queued.',
- 'A refused tool call ends the run at once and says why, instead of the agent carrying on as if it had permission.',
+ 'A request the model server refuses ends the run at once with the reason, instead of being retried twice while the run looks alive.',
'Dragging files onto the Character Studio board, the chat composer or the RAG panel works again on Windows.',
'Download and install waits for ComfyUI to actually list the new model, counts the seconds, restarts the engine once if the scan stalls, and explains itself if that still does not help.',
'Character training repairs its own environment instead of refusing to start, and FramePack got back the VAE it was trained with.',
diff --git a/src/stores/__tests__/releaseNotesStore.test.ts b/src/stores/__tests__/releaseNotesStore.test.ts
index 530c96a5..e4382de2 100644
--- a/src/stores/__tests__/releaseNotesStore.test.ts
+++ b/src/stores/__tests__/releaseNotesStore.test.ts
@@ -137,3 +137,28 @@ describe('the fresh-install sequence end to end', () => {
expect(shouldShowReleaseNotes(KNOWN, useReleaseNotesStore.getState().lastNotesVersion, true)).toBe(false)
})
})
+
+describe('the notes describe what actually shipped', () => {
+ // The 2.6.5 sheet claimed "A refused tool call ends the run at once and says
+ // why, instead of the agent carrying on as if it had permission." The commit
+ // it was written for (7110df26) changes how an HTTP 4xx from the MODEL
+ // SERVER is classified. Nothing in the release touches tool permissions, so
+ // the one line most likely to be read as a fix for the approval flow
+ // promised something that is not in the build (review 2026-08-14).
+ const notesSrc = readFileSync(
+ resolve(dirname(fileURLToPath(import.meta.url)), '../../lib/release-notes.ts'), 'utf8',
+ )
+ const changelog = readFileSync(
+ resolve(dirname(fileURLToPath(import.meta.url)), '../../../CHANGELOG.md'), 'utf8',
+ )
+
+ it('does not promise a tool-permission fix this release does not contain', () => {
+ expect(notesSrc).not.toContain('as if it had permission')
+ expect(changelog).not.toContain('as if it had permission')
+ })
+
+ it('says what the 4xx change really does, in both places', () => {
+ expect(notesSrc).toContain('A request the model server refuses ends the run at once')
+ expect(changelog).toContain('A request the model server refuses ends the run at once')
+ })
+})