Skip to content

Commit f657a5a

Browse files
committed
rip out smoosh for now, prep work for evals
1 parent b24df84 commit f657a5a

31 files changed

Lines changed: 19 additions & 2330 deletions

‎cli/src/components/config-panel.tsx‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { OverlayPanel, Indicator } from "./overlay-panel.js";
1919

2020
// ── Types ────────────────────────────────────────────────────
2121

22-
type FeatureKey = "subAgents" | "skills" | "debug" | "smoosh";
22+
type FeatureKey = "subAgents" | "skills" | "debug";
2323
type Section = "features" | "tools";
2424

2525
interface MenuItem {
@@ -33,10 +33,9 @@ const FEATURE_LABELS: Record<FeatureKey, string> = {
3333
subAgents: "Sub-agents",
3434
skills: "Skills",
3535
debug: "Debug introspection",
36-
smoosh: "Smoosh compression",
3736
};
3837

39-
const FEATURE_KEYS: FeatureKey[] = ["subAgents", "skills", "debug", "smoosh"];
38+
const FEATURE_KEYS: FeatureKey[] = ["subAgents", "skills", "debug"];
4039

4140
const SECTIONS: { key: Section; heading: string }[] = [
4241
{ key: "features", heading: "Features" },

‎cli/src/hooks/use-opal-commands.ts‎

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import { useHotkeys } from "./use-hotkeys.js";
1515
import { useCommands, type CommandRegistry } from "./use-commands.js";
1616
import { copyToClipboard, openPath } from "../lib/desktop.js";
1717
import type { Overlay } from "./use-overlay.js";
18-
import type { OpalConfigSetParams } from "../sdk/protocol.js";
1918

2019
export interface UseOpalCommandsReturn {
2120
readonly cmds: ReturnType<typeof useCommands>;
@@ -77,43 +76,6 @@ export function useOpalCommands(
7776
setOverlay("opal");
7877
},
7978
},
80-
smoosh: {
81-
description: "Toggle smoosh compression or show status",
82-
args: "[on|off]",
83-
execute: async ({ arg }) => {
84-
if (!session) return "No active session.";
85-
86-
if (arg === "on" || arg === "off") {
87-
const enabled = arg === "on";
88-
try {
89-
await session.config.setRuntime({
90-
features: { smoosh: enabled } as OpalConfigSetParams["features"],
91-
});
92-
pushStatus(`Smoosh ${enabled ? "enabled" : "disabled"}`, "success");
93-
} catch (e: unknown) {
94-
pushStatus(
95-
`Failed to toggle smoosh: ${e instanceof Error ? e.message : String(e)}`,
96-
"error",
97-
);
98-
}
99-
return;
100-
}
101-
102-
try {
103-
const config = await session.config.getRuntime();
104-
const enabled = config.features.smoosh;
105-
const hasKb = config.tools.enabled.includes("kb_search");
106-
const status = enabled ? "enabled" : "disabled";
107-
const kb = hasKb ? "active (kb_search available)" : "no indexed content";
108-
pushStatus(`Smoosh: ${status} · Knowledge base: ${kb}`, "info");
109-
} catch (e: unknown) {
110-
pushStatus(
111-
`Failed to get smoosh status: ${e instanceof Error ? e.message : String(e)}`,
112-
"error",
113-
);
114-
}
115-
},
116-
},
11779
}),
11880
// eslint-disable-next-line react-hooks/exhaustive-deps
11981
[session],

‎cli/src/sdk/protocol.ts‎

Lines changed: 4 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,7 @@ export type OpalConfigGetResult = {
104104
/** Erlang distribution info if active (node name and cookie), or null if not distributed. */
105105
distribution: { cookie: string; node: string } | null;
106106
/** Current runtime feature flags. */
107-
features: {
108-
debug: boolean;
109-
skills: boolean;
110-
smoosh: boolean;
111-
subAgents: boolean;
112-
};
107+
features: { debug: boolean; skills: boolean; subAgents: boolean };
113108
/** Tool availability for the session. */
114109
tools: { all: string[]; disabled: string[]; enabled: string[] };
115110
};
@@ -118,12 +113,7 @@ export type OpalConfigSetParams = {
118113
/** Start or stop Erlang distribution. Pass {name, cookie?} to start, null to stop. */
119114
distribution?: { cookie?: string; name: string } | null;
120115
/** Feature flags to update. */
121-
features?: {
122-
debug: boolean;
123-
skills: boolean;
124-
smoosh: boolean;
125-
subAgents: boolean;
126-
};
116+
features?: { debug: boolean; skills: boolean; subAgents: boolean };
127117
/** Target session ID. */
128118
sessionId: string;
129119
/** Exact list of enabled tool names. */
@@ -134,12 +124,7 @@ export type OpalConfigSetResult = {
134124
/** Erlang distribution info if active (node name and cookie), or null if not distributed. */
135125
distribution: { cookie: string; node: string } | null;
136126
/** Current runtime feature flags. */
137-
features: {
138-
debug: boolean;
139-
skills: boolean;
140-
smoosh: boolean;
141-
subAgents: boolean;
142-
};
127+
features: { debug: boolean; skills: boolean; subAgents: boolean };
143128
/** Tool availability for the session. */
144129
tools: { all: string[]; disabled: string[]; enabled: string[] };
145130
};
@@ -204,12 +189,7 @@ export type SessionListResult = {
204189

205190
export type SessionStartParams = {
206191
/** Boot-time feature toggles. */
207-
features?: {
208-
debug: boolean;
209-
skills: boolean;
210-
smoosh: boolean;
211-
subAgents: boolean;
212-
};
192+
features?: { debug: boolean; skills: boolean; subAgents: boolean };
213193
/** Model to use. Defaults to config default. */
214194
model?: { id: string; provider: string; thinkingLevel?: string };
215195
/** If true, enable session persistence. */
@@ -399,26 +379,6 @@ export type SkillLoadedEvent = {
399379
name: string;
400380
};
401381

402-
export type SmooshCompressEvent = {
403-
/** Event type discriminator. */
404-
readonly type: "smooshCompress";
405-
/** Compressed output size in bytes. */
406-
compressedBytes: number;
407-
/** Original output size in bytes. */
408-
rawBytes: number;
409-
/** Tool that produced the output. */
410-
tool: string;
411-
};
412-
413-
export type SmooshIndexEvent = {
414-
/** Event type discriminator. */
415-
readonly type: "smooshIndex";
416-
/** Original output size in bytes. */
417-
rawBytes: number;
418-
/** Tool that produced the output. */
419-
tool: string;
420-
};
421-
422382
export type StatusUpdateEvent = {
423383
/** Event type discriminator. */
424384
readonly type: "statusUpdate";
@@ -516,8 +476,6 @@ export type AgentEvent =
516476
| MessageQueuedEvent
517477
| MessageStartEvent
518478
| SkillLoadedEvent
519-
| SmooshCompressEvent
520-
| SmooshIndexEvent
521479
| StatusUpdateEvent
522480
| SubAgentEventEvent
523481
| ThinkingDeltaEvent

‎cli/src/sdk/session.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,6 @@ export async function createSession(opts: SessionOptions = {}): Promise<Session>
453453
skills: false,
454454
subAgents: false,
455455
debug: false,
456-
smoosh: true,
457456
...opts.features,
458457
},
459458
}

‎cli/src/state/timeline.ts‎

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ import type {
1818
AgentEvent,
1919
ToolExecutionStartEvent,
2020
ToolExecutionEndEvent,
21-
SmooshCompressEvent,
22-
SmooshIndexEvent,
2321
} from "../sdk/protocol.js";
2422
import type { TimelineEntry, ToolCall, AgentView, TokenUsage, StatusLevel } from "./types.js";
2523

@@ -128,11 +126,6 @@ function updateToolEntry(
128126

129127
// ── View-level reducer (shared across all agents) ────────────────
130128

131-
function formatBytes(bytes: number): string {
132-
if (bytes >= 1024) return `${(bytes / 1024).toFixed(1)} KB`;
133-
return `${bytes} B`;
134-
}
135-
136129
interface ViewFields {
137130
entries: readonly TimelineEntry[];
138131
thinking: string | null;
@@ -240,39 +233,6 @@ function reduceView(view: ViewFields, event: Record<string, unknown>): ViewField
240233
case "statusUpdate":
241234
return { ...view, statusMessage: (event.message as string) ?? null };
242235

243-
case "smooshCompress": {
244-
const e = event as unknown as SmooshCompressEvent;
245-
const ratio = ((1 - e.compressedBytes / e.rawBytes) * 100).toFixed(0);
246-
return {
247-
...view,
248-
statusMessage: null,
249-
entries: [
250-
...view.entries,
251-
{
252-
kind: "status",
253-
text: `Compressed ${e.tool} output (${formatBytes(e.rawBytes)} → ${formatBytes(e.compressedBytes)}, ${ratio}% reduction)`,
254-
level: "info" as StatusLevel,
255-
},
256-
],
257-
};
258-
}
259-
260-
case "smooshIndex": {
261-
const e = event as unknown as SmooshIndexEvent;
262-
return {
263-
...view,
264-
statusMessage: null,
265-
entries: [
266-
...view.entries,
267-
{
268-
kind: "status",
269-
text: `Indexed ${e.tool} output (${formatBytes(e.rawBytes)}) into knowledge base`,
270-
level: "info" as StatusLevel,
271-
},
272-
],
273-
};
274-
}
275-
276236
default:
277237
return view;
278238
}
@@ -318,8 +278,6 @@ export function applyEvent(state: TimelineSnapshot, event: AgentEvent): Timeline
318278
case "toolExecutionEnd":
319279
case "toolOutput":
320280
case "statusUpdate":
321-
case "smooshCompress":
322-
case "smooshIndex":
323281
return {
324282
...state,
325283
agents: reduceAgentView(

‎docs/research/references.md‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,6 @@ Compiled from `## References` sections across docs, plus README and ongoing rese
5656

5757
---
5858

59-
## Context & Token Efficiency
60-
61-
- [Context Mode](https://mksg.lu/blog/context-mode) — Mert Köseoğlu, 2026. MCP server that compresses tool outputs before they enter the context window, achieving 98% reduction. Reference implementation for Smoosh Knowledge Base: dual FTS5 tables (Porter + trigram), BM25 ranking, 3-layer fallback search, chunking strategies. Source: [github.com/mksglu/claude-context-mode](https://github.com/mksglu/claude-context-mode). ([smoosh](../smoosh.md))
62-
- [exqlite](https://github.com/elixir-sqlite/exqlite) — Direct SQLite3 NIF driver for Elixir. Used by KnowledgeBase for FTS5/BM25 without Ecto. Requires `SQLITE_ENABLE_FTS5=1` compile flag. ([smoosh](../smoosh.md))
63-
- [SQLite FTS5 Extension](https://sqlite.org/fts5.html) — Official SQLite docs for FTS5 virtual tables, `bm25()` ranking function, `highlight()`, and tokenizer configuration (`porter`, `unicode61`, `trigram`). ([smoosh](../smoosh.md))
64-
6559
## TODO
6660

6761
Papers and resources to review and potentially integrate:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Smoosh!
22

3-
> **Status**: Implemented
3+
> **Status**: Idea (rolled back — not yet implemented)
44
> **Scope**: `Opal.Agent.Smoosh.*`, `Opal.Tool.KbSearch`, `Opal.Agent.ToolRunner`
55
66
## The Algorithm at a Glance

‎opal/config/config.exs‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ import Config
33
# Logger must use stderr — stdout is reserved for JSON-RPC over stdio.
44
config :logger, :default_handler, config: %{type: :standard_error}
55

6-
# exqlite: enable FTS5 for Smoosh knowledge base
7-
config :exqlite,
8-
force_build: true,
9-
make_env: %{"EXQLITE_SYSTEM_CFLAGS" => "-DSQLITE_ENABLE_FTS5=1"}
10-
116
config :opal,
127
# data_dir: "~/.opal", # nil = platform default (Unix: ~/.opal, Windows: %APPDATA%/opal)
138
# shell: :sh, # nil = auto-detect per platform

0 commit comments

Comments
 (0)