feat: component wiring integration — orphan cleanup, Memory page, WS handlers
Memory page: Added REST endpoints (routes/memory.ts, 3 GETs: list/daily/dreams), React route in App.tsx, nav link in ProjectSidebar (Brain icon). Orphan components wired: KeyboardShortcutsDialog (? key in AppShell), McpResponseDisplay (MCP tool results in ToolCallLine), CacheShapeBadge (StatsLine in MessageBubble). MessageBoundary + MessageListErrorBoundary confirmed already wired in MarkdownRenderer/MessageList. Dead code cleanup: useDraftPersistence integrated into ChatInput (localStorage draft save/restore/clear on send). message-parts barrel made canonical — MessageBubble imports from it; StatsLine updated with CacheShapeBadge parity. api.settings.inference typed wrapper added; InferenceSettings raw fetch replaced. WS frame handlers: reasoning_delta (accumulates like delta), tool_trace_start, tool_trace_finish, collision_warning, agent_message acknowledged in useSessionStream. CollisionWarningEvent + AgentMessageEvent added to sessionEvents union. Forwarding in useCoderUserEvents. reasoning_delta + collision_warning added to web WsFrame type. useSidebar default case fixes pre-existing fallthrough error. Workflow engine: services/workflow/index.ts documented as experimental; coder flow-runner (apps/coder/src/services/flow-runner.ts) is canonical. Verification: web type-check clean, server build clean, 627 tests pass.
This commit is contained in:
@@ -2,6 +2,7 @@ import { useEffect, useState } from 'react';
|
||||
import { toast } from 'sonner';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Database, Zap, Clock, BarChart3, Folder } from 'lucide-react';
|
||||
import { api } from '@/api/client';
|
||||
|
||||
interface InferenceConfig {
|
||||
cache_type_k: string;
|
||||
@@ -58,9 +59,8 @@ export function InferenceSettings() {
|
||||
const [saving, setSaving] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
fetch('/api/settings/inference')
|
||||
.then((r) => (r.ok ? r.json() : Promise.reject()))
|
||||
.then((data) => setConfig(data as InferenceConfig))
|
||||
api.settings.inference.get()
|
||||
.then((data) => setConfig(data as unknown as InferenceConfig))
|
||||
.catch(() => {
|
||||
setConfig({ ...DEFAULTS });
|
||||
toast.error('Could not load inference config — loading defaults');
|
||||
@@ -76,14 +76,8 @@ export function InferenceSettings() {
|
||||
if (!config || saving) return;
|
||||
setSaving(true);
|
||||
try {
|
||||
const res = await fetch('/api/settings/inference', {
|
||||
method: 'PATCH',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(config),
|
||||
});
|
||||
if (!res.ok) throw new Error('Save failed');
|
||||
const updated = (await res.json()) as InferenceConfig;
|
||||
setConfig(updated);
|
||||
const updated = await api.settings.inference.patch(config as unknown as Record<string, unknown>);
|
||||
setConfig(updated as unknown as InferenceConfig);
|
||||
toast.success('Inference settings saved');
|
||||
} catch (err) {
|
||||
toast.error(err instanceof Error ? err.message : 'Save failed');
|
||||
|
||||
Reference in New Issue
Block a user