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.

v2.5.0 polish: coding-chat UX — stop simple-question loop, collapse step-log, global scrollbar

purple93d28ba3c3f0
diff --git a/src/components/chat/CodexView.tsx b/src/components/chat/CodexView.tsx
index 1804ef99..f7f0e349 100644
--- a/src/components/chat/CodexView.tsx
+++ b/src/components/chat/CodexView.tsx
@@ -12,7 +12,7 @@ import { PluginsDropdown } from './PluginsDropdown'
import { TypingIndicator } from './TypingIndicator'
import { useSettingsStore } from '../../stores/settingsStore'
import { StagedChangesPanel } from './StagedChangesPanel'
-import { User, Code, Brain, Eye, GitBranch, Download, RefreshCw } from 'lucide-react'
+import { User, Code, Brain, Eye, GitBranch, Download, RefreshCw, ChevronRight } from 'lucide-react'
import { useEffect, useRef, useState } from 'react'
import { checkGitInstalled, openExternal, type GitStatus } from '../../api/backend'
@@ -24,6 +24,50 @@ function stripChannelTags(text: string): string {
.trim()
}
+/**
+ * Collapsible agent work-log (David 2026-06-02). The coding agent's
+ * step-by-step tasks + per-step commentary used to sprawl down the chat — and
+ * on weaker local models the same task/answer could repeat several times. Keep
+ * it ALWAYS collapsed by default into one small clean row (a preview of the
+ * final answer + a step count); click to expand the full task/answer log. The
+ * loop itself is curbed in useCodex's nudge guard; this just keeps the
+ * transcript tidy regardless of model/provider.
+ */
+function CollapsibleSteps({
+ toolCount,
+ preview,
+ children,
+}: {
+ toolCount: number
+ preview: string
+ children: React.ReactNode
+}) {
+ const [open, setOpen] = useState(false)
+ return (
+ <div>
+ <button
+ onClick={() => setOpen((o) => !o)}
+ className="flex items-center gap-1.5 w-full text-left px-1 py-0.5 rounded text-[0.7rem] select-none hover:bg-gray-100/50 dark:hover:bg-white/[0.03] transition-colors"
+ aria-expanded={open}
+ >
+ <ChevronRight
+ size={11}
+ className={`shrink-0 text-gray-400 transition-transform ${open ? 'rotate-90' : ''}`}
+ />
+ <span className="flex-1 min-w-0 truncate text-gray-700 dark:text-gray-300">
+ {preview || 'Coding steps'}
+ </span>
+ {toolCount > 0 && (
+ <span className="shrink-0 text-[0.6rem] text-gray-400 dark:text-gray-500">
+ {toolCount} {toolCount === 1 ? 'step' : 'steps'}
+ </span>
+ )}
+ </button>
+ {open && <div className="space-y-1 mt-1 pl-1">{children}</div>}
+ </div>
+ )
+}
+
export function CodexView() {
const { sendInstruction, stopCodex, isRunning } = useCodex()
const activeConversationId = useChatStore((s) => s.activeConversationId)
@@ -190,50 +234,58 @@ export function CodexView() {
tool_call blocks. */}
{msg.role === 'assistant' && msg.agentBlocks && msg.agentBlocks.length > 0
? (() => {
- const hasAnswerBlock = msg.agentBlocks!.some(
+ const blocks = msg.agentBlocks!
+ const toolCount = blocks.filter(
+ (b) => b.phase === 'tool_call' && b.toolCall,
+ ).length
+ const lastAns = [...blocks]
+ .reverse()
+ .find((b) => b.phase === 'answer' && b.content.trim())
+ const preview = lastAns
+ ? stripChannelTags(lastAns.content).replace(/\s+/g, ' ').slice(0, 90)
+ : ''
+ const hasAnswerBlock = blocks.some(
(b) => b.phase === 'answer' && b.content.trim(),
)
- if (hasAnswerBlock) {
- return (
- <div className="space-y-1">
- {[...msg.agentBlocks!]
- .filter(
- (b) =>
- (b.phase === 'tool_call' && b.toolCall) ||
- (b.phase === 'answer' && b.content.trim()),
- )
- .sort((a, b) => a.timestamp - b.timestamp)
- .map((block) => {
- if (block.phase === 'tool_call' && block.toolCall) {
- return (
- <ToolCallBlock key={block.id} toolCall={block.toolCall} />
- )
- }
- if (block.phase === 'answer' && block.content.trim()) {
- return (
- <div key={block.id} className="px-1 py-0.5">
- <div className="text-[0.75rem] leading-relaxed">
- <MarkdownRenderer
- content={stripChannelTags(block.content)}
- />
- </div>
+ const inner = hasAnswerBlock ? (
+ <div className="space-y-1">
+ {[...blocks]
+ .filter(
+ (b) =>
+ (b.phase === 'tool_call' && b.toolCall) ||
+ (b.phase === 'answer' && b.content.trim()),
+ )
+ .sort((a, b) => a.timestamp - b.timestamp)
+ .map((block) => {
+ if (block.phase === 'tool_call' && block.toolCall) {
+ return <ToolCallBlock key={block.id} toolCall={block.toolCall} />
+ }
+ if (block.phase === 'answer' && block.content.trim()) {
+ return (
+ <div key={block.id} className="px-1 py-0.5">
+ <div className="text-[0.75rem] leading-relaxed">
+ <MarkdownRenderer content={stripChannelTags(block.content)} />
</div>
- )
- }
- return null
- })}
- </div>
- )
- }
- return (
+ </div>
+ )
+ }
+ return null
+ })}
+ </div>
+ ) : (
<div className="space-y-0">
- {msg.agentBlocks!
+ {blocks
.filter((b) => b.phase === 'tool_call' && b.toolCall)
.map((block) => (
<ToolCallBlock key={block.id} toolCall={block.toolCall!} />
))}
</div>
)
+ return (
+ <CollapsibleSteps toolCount={toolCount} preview={preview}>
+ {inner}
+ </CollapsibleSteps>
+ )
})()
: null}
diff --git a/src/hooks/useCodex.ts b/src/hooks/useCodex.ts
index fcc914d5..94c11d27 100644
--- a/src/hooks/useCodex.ts
+++ b/src/hooks/useCodex.ts
@@ -794,8 +794,20 @@ export function useCodex() {
// (only strong "is complete / all tests pass / committed" phrases, not
// forward-looking "to complete the fix") so we err toward nudging.
if (toolCalls.length === 0) {
- const looksComplete = /\b(the (task|fix|change|work) is (now )?complete|task complete|all (the )?tests?(?: now)? pass(ed)?|i (?:have|'ve) (?:committed|fixed and committed)|successfully committed|committed the (?:fix|change|changes)|no (?:further|more) (?:changes|steps|action)s? (?:are )?(?:needed|required)|nothing (?:else|more) to do)\b/i.test(turnContent)
- if (!looksComplete && continueNudgesRemaining > 0) {
+ // Nudge ONLY when the model clearly STALLED mid-task — it narrated the
+ // next step ("I'm about to…", "let me…", "next I'll…", "I need to read…")
+ // or asked for info it could find itself ("please provide the path",
+ // "which file?"), or returned no text at all. A substantive ANSWER
+ // matches none of these, so simple Q&A ("2+2 is 4" / "Task completed.
+ // The answer is 4.") stops cleanly. The previous "nudge unless a
+ // completion keyword is present" version looped on already-answered
+ // questions (David 2026-06-02: coding agent "antwortet in loops" on a
+ // simple question — it called shell_execute 3× + repeated "Task
+ // completed" because "completed" never matched the completion regex).
+ const stalledNarration = /\b(i'?m about to|i will(?: now)?|i'?ll\b|let me\b|next,?\s*i\b|now i'?ll|going to|first,?\s*i\b|then i'?ll|i need to (?:read|open|check|look|run|see|find))\b/i.test(turnContent)
+ const asksForInfo = /\b(please provide|could you (?:please )?(?:provide|share|tell|give|specify)|what(?:'s| is) the (?:path|file|name|location)|which file|can you (?:provide|share|specify|tell)|provide (?:the|me) (?:the )?(?:path|file|details|more)|need (?:the|more) (?:path|info|details|context))\b/i.test(turnContent)
+ const emptyTurn = turnContent.trim().length === 0
+ if ((stalledNarration || asksForInfo || emptyTurn) && continueNudgesRemaining > 0) {
continueNudgesRemaining--
void diagLog('continue-nudge', { iter: i, remaining: continueNudgesRemaining, turnContentLen: turnContent.length })
messages.push({
diff --git a/src/index.css b/src/index.css
index 7b4cb720..1773ee1a 100644
--- a/src/index.css
+++ b/src/index.css
@@ -193,6 +193,38 @@ body {
background: transparent;
}
+/* Global scrollbar (David 2026-06-02): every scrollable surface — not only
+ .scrollbar-thin containers — gets the themed scrollbar so the bare white
+ Windows/WebView2 default never shows (it was visible on the coding file-tree
+ and other panes). .scrollbar-thin above still wins for the slim 6px variant. */
+::-webkit-scrollbar {
+ width: 10px;
+ height: 10px;
+}
+::-webkit-scrollbar-track {
+ background: transparent;
+}
+::-webkit-scrollbar-thumb {
+ background: rgba(0, 0, 0, 0.18);
+ border-radius: 5px;
+}
+.dark ::-webkit-scrollbar-thumb {
+ background: rgba(255, 255, 255, 0.12);
+}
+::-webkit-scrollbar-thumb:hover {
+ background: var(--color-violet-500);
+}
+::-webkit-scrollbar-button,
+::-webkit-scrollbar-button:start,
+::-webkit-scrollbar-button:end {
+ display: none;
+ width: 0;
+ height: 0;
+}
+::-webkit-scrollbar-corner {
+ background: transparent;
+}
+
/* Range slider */
input[type="range"] {
-webkit-appearance: none;