refactor: codebase audit cleanup — dead code, dedup, module splits

Multi-agent audit + aggressive cleanup across server/web/coder/booterm,
delivered behind a DEFER discipline so none of the in-flight files were
touched. Removes dead code/deps/columns, dedups server + coder helpers,
and splits the oversized modules (tools.ts, opencode-server.ts,
sentinel-summaries, turn.ts, TerminalPane.tsx) behind stable contracts.
Adds 78 parity/unit tests (server 587, coder 323); fixes two latent bugs
(ChatPane queue keys, FileViewerOverlay blank-line parity).

Intended tag: v2.7.12-audit-cleanup.
This commit is contained in:
2026-06-02 21:10:06 +00:00
parent 6560398285
commit abe1a311d0
143 changed files with 6729 additions and 6087 deletions

View File

@@ -1,4 +1,4 @@
import { useEffect, useState } from 'react';
import { memo, useEffect, useMemo, useState } from 'react';
import type { ReactNode } from 'react';
import { ChevronDown, ChevronRight, Copy, RefreshCw, Check, Share2, RotateCw, GitFork, Trash2, Brain, History, AlertCircle } from 'lucide-react';
import { toast } from 'sonner';
@@ -708,7 +708,7 @@ function MistakeRecoverySentinel({ message }: { message: Message }) {
);
}
export function MessageBubble({
export const MessageBubble = memo(function MessageBubble({
message,
sessionChats,
capHitInfo,
@@ -717,7 +717,7 @@ export function MessageBubble({
hasCheckpoint,
restoreDisabled,
}: Props) {
const hiddenSet = new Set(hideActions ?? []);
const hiddenSet = useMemo(() => new Set(hideActions ?? []), [hideActions]);
// v1.11: anchored rolling summary row. Checked BEFORE the kind==='compact'
// branch because summary=true never coexists with kind='compact' (new
// compactions emit role='assistant' rows with kind='message'+summary=true).
@@ -846,4 +846,4 @@ export function MessageBubble({
)}
</div>
);
}
});