Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ All notable changes to DreamCoder will be documented in this file.
- A lead session that is resumed after a restart keeps using its team's task list (#216). The lead looked for tasks in a list named after its session, so `TaskList` returned nothing and new tasks went to a different list than the one the teammates read. The lead now goes back to the team it created when the session is resumed. Thanks @WhitePepperLambSoup.
- **Context usage no longer treats screenshot base64 as text** (#230). The estimate-only path and the Messages breakdown score images and documents as 2000 tokens instead of counting their base64 as text, so a session with many browser screenshots no longer shows a nearly full context bar when the provider still reports a modest input size. An @-mentioned image or PDF is estimated from the message the API receives, so that payload is no longer counted as text and the attachment line in `/context` stays in line with the total. Thanks @Oscar-Williams.

### Removed

- **The Diagnostics settings page, the `/doctor` command and the dry-run server Doctor.** Report a problem in the sidebar already collects the recent errors and exports the diagnostics bundle, and Doctor still appears where it is needed, on the crash screen and the startup error screen. The Diagnostics tab and the `/doctor` command opened a page whose warning count was mostly requests failing while the server was starting. The desktop Doctor now only clears the safe UI keys, `DoctorService` and the `/api/doctor` routes are gone, and a request that fails because the server never answered is no longer recorded as a diagnostic event; a request the server rejects still is.

## [0.8.0] — 2026-11-01

The first stable release of the Electron desktop app. These notes cover everything since 0.7.0, including 0.8.0-beta.1 and 0.8.0-beta.2.
Expand Down
219 changes: 0 additions & 219 deletions desktop/src/__tests__/diagnosticsSettings.test.tsx

This file was deleted.

4 changes: 1 addition & 3 deletions desktop/src/__tests__/generalSettings.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -688,12 +688,10 @@ describe('Settings > General tab', () => {
expect(screen.getByText('The storage change has been saved. Restart the app for the new data directory to take effect.')).toBeInTheDocument()
})

it('opens the Token usage tab from Settings navigation above Diagnostics', () => {
it('opens the Token usage tab from Settings navigation', () => {
render(<Settings />)

const usageTab = screen.getByText('Token usage')
const diagnosticsTab = screen.getByText('Diagnostics')
expect((usageTab.compareDocumentPosition(diagnosticsTab) & Node.DOCUMENT_POSITION_FOLLOWING) !== 0).toBe(true)

fireEvent.click(usageTab)

Expand Down
2 changes: 1 addition & 1 deletion desktop/src/__tests__/pages.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ describe('Content-only pages render without errors', () => {
expect(screen.getByText('Slash commands')).toBeInTheDocument()
expect(screen.getByText('/clear')).toBeInTheDocument()
expect(screen.getByText('/cost')).toBeInTheDocument()
expect(screen.getByText('14 more commands available. Type / to search the full command list.')).toBeInTheDocument()
expect(screen.getByText('13 more commands available. Type / to search the full command list.')).toBeInTheDocument()

resetPageStores()
})
Expand Down
9 changes: 9 additions & 0 deletions desktop/src/api/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@ describe('api diagnostics reporting', () => {
expect(JSON.stringify(body)).not.toContain('h5_super_secret')
})

it('does not record a request the server never answered', async () => {
const fetchMock = vi.spyOn(globalThis, 'fetch')
fetchMock.mockRejectedValueOnce(new TypeError('Failed to fetch'))

await expect(api.get('/api/status')).rejects.toThrow('Failed to fetch')

expect(fetchMock).toHaveBeenCalledTimes(1)
})

it('does not recursively report diagnostics endpoint failures', async () => {
const fetchMock = vi.spyOn(globalThis, 'fetch')
fetchMock.mockResolvedValueOnce(new Response(JSON.stringify({ message: 'diagnostics down' }), {
Expand Down
4 changes: 3 additions & 1 deletion desktop/src/api/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ async function request<T>(method: string, path: string, body?: unknown, options?
reportApiFailure(method, path, timeoutError, sensitiveValues)
throw timeoutError
}
reportApiFailure(method, path, err, sensitiveValues)
if (!(err instanceof TypeError)) {
reportApiFailure(method, path, err, sensitiveValues)
}
throw err
}
}
Expand Down
39 changes: 0 additions & 39 deletions desktop/src/api/diagnostics.ts
Original file line number Diff line number Diff line change
@@ -1,39 +1,5 @@
import { api } from './client'

export type DiagnosticSeverity = 'debug' | 'info' | 'warn' | 'error'

export type DiagnosticEvent = {
id: string
timestamp: string
type: string
severity: DiagnosticSeverity
summary: string
sessionId?: string
details?: unknown
}

export type DiagnosticEventInput = {
type: string
severity?: DiagnosticSeverity
summary: string
sessionId?: string
details?: unknown
}

export type DiagnosticsStatus = {
logDir: string
diagnosticsPath: string
cliDiagnosticsPath: string
runtimeErrorsPath: string
exportDir: string
retentionDays: number
maxBytes: number
totalBytes: number
eventCount: number
recentErrorCount: number
lastEventAt: string | null
}

export type DiagnosticsBundle = {
path: string
fileName: string
Expand All @@ -51,10 +17,5 @@ export type ProblemReport = {
export const diagnosticsApi = {
getProblemReport: () => api.get<ProblemReport>('/api/diagnostics/report'),
revealExport: (fileName: string) => api.post<{ ok: true }>('/api/diagnostics/reveal-export', { fileName }),
getStatus: () => api.get<DiagnosticsStatus>('/api/diagnostics/status'),
getEvents: (limit = 100) => api.get<{ events: DiagnosticEvent[] }>(`/api/diagnostics/events?limit=${limit}`),
recordEvent: (event: DiagnosticEventInput) => api.post<{ ok: true }>('/api/diagnostics/events', event, { timeout: 5_000 }),
exportBundle: () => api.post<{ bundle: DiagnosticsBundle }>('/api/diagnostics/export', undefined, { timeout: 60_000 }),
openLogDir: () => api.post<{ ok: true }>('/api/diagnostics/open-log-dir'),
clear: () => api.delete<{ ok: true }>('/api/diagnostics'),
}
Loading
Loading