The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
refactor: remove super context\n\n
Steven Enamakel2e9002420a83
diff --git a/README.md b/README.mdindex 3bcee6d36e..31c3f50cdc 100644--- a/README.md+++ b/README.md@@ -81,7 +81,6 @@ OpenHuman is three things most assistants aren't: **a brain** that builds a pers### 🔬 The deep researcher & doer-- **[SuperContext](https://tinyhumans.gitbook.io/openhuman/features/super-context)**: a research scout sweeps your memory and files before the model reads your first message. No cold starts.- **Batteries included**: managed [web search](https://tinyhumans.gitbook.io/openhuman/features/native-tools/web-search), powered by [Exa](https://exa.ai), is included with your OpenHuman subscription and needs no API key; bring your own Exa key to search directly on your own Exa account and billing. Plus scraper, coder toolset, a real [browser](https://tinyhumans.gitbook.io/openhuman/features/native-tools/browser-and-computer), and [native voice](gitbooks/features/native-tools/voice.md) with in-process Whisper. [Model routing](https://tinyhumans.gitbook.io/openhuman/features/model-routing) picks the right LLM per workload on one subscription. That subscription is a default, not a lock-in: point any workload at [your own provider key or a fully local Ollama model](https://tinyhumans.gitbook.io/openhuman/features/model-routing/local-and-byok-models), and mix the three however you like.- **[Meeting agents](https://tinyhumans.gitbook.io/openhuman/features/mascot/meeting-agents)**: joins **Meet, Zoom, Teams, and Webex** with a face and a voice. It auto-joins from your calendar, streams a live transcript, answers by name, and files a summary with action items.- **[Image & video generation](https://tinyhumans.gitbook.io/openhuman/features/native-tools)**: Seedream/SeedEdit images and Seedance/Veo video, straight into your workspace on the same subscription.diff --git a/app/scripts/e2e-web-session.sh b/app/scripts/e2e-web-session.shindex 4e4889c798..2330bf27af 100755--- a/app/scripts/e2e-web-session.sh+++ b/app/scripts/e2e-web-session.sh@@ -104,9 +104,6 @@ enabled = false[context]# Deterministic e2e specs script the mock-LLM call sequence exactly; the-# default-on first-turn "super context" scout adds an extra agentic call that-# would perturb those sequences. No spec exercises super context, so disable it.-super_context_enabled = false[[cloud_providers]]id = "p_e2e_mock"diff --git a/app/src/agentworld/pages/WorldSection.tsx b/app/src/agentworld/pages/WorldSection.tsxindex 811bdc1ef4..dd6d5c56df 100644--- a/app/src/agentworld/pages/WorldSection.tsx+++ b/app/src/agentworld/pages/WorldSection.tsx@@ -163,8 +163,8 @@ export default function WorldSection() {The parent card is `pointer-events-none`, so the badge opts back inwith `pointer-events-auto` to stay hoverable/focusable. It uses the- project's self-contained wrapping tooltip pattern (see- SuperContextToggle) rather than the shared <Tooltip>, which is+ project's self-contained wrapping tooltip pattern rather than the+ shared <Tooltip>, which issingle-line nowrap and can't fit this sentence, and rather than abare `title` (unreachable under `pointer-events-none`). */}<span className="group pointer-events-auto relative mt-2 inline-flex">diff --git a/app/src/components/chat/SuperContextToggle.tsx b/app/src/components/chat/SuperContextToggle.tsxdeleted file mode 100644index 03badfd402..0000000000--- a/app/src/components/chat/SuperContextToggle.tsx+++ /dev/null@@ -1,138 +0,0 @@-import debugFactory from 'debug';-import { useCallback, useEffect, useState } from 'react';--import { useT } from '../../lib/i18n/I18nContext';-import { isTauri } from '../../utils/tauriCommands/common';-import { openhumanSetSuperContextEnabled } from '../../utils/tauriCommands/config';-import SettingsSwitch from '../settings/controls/SettingsSwitch';-import { trackSuperContextWrite } from './superContextWrite';--const log = debugFactory('chat:super-context-toggle');--/**- * "Super context" toggle, rendered directly below the chat composer on a fresh- * thread. When on, the harness runs a read-only context-collection pass on the- * **first turn of a new thread** — before the orchestrator LLM runs — and folds- * the result into the user message. This is harness-driven (deterministic),- * unlike the `agent_prepare_context` tool the model may call on its own.- *- * Super context is OFF by default on **every new chat** and is NOT inherited- * from the persisted `context.super_context_enabled` config: opening a new chat- * resets the core flag to false, so a leftover "on" from an earlier chat can- * never silently run the context pass. Enabling it applies to the current chat- * only (the harness reads the flag at thread construction, i.e. on first send).- */-const SuperContextToggle = () => {- const { t } = useT();- const [enabled, setEnabled] = useState(false);- // Outside Tauri (Storybook/web preview) there's no core to reset against, so- // treat the control as loaded immediately in its default-off state. In Tauri- // it stays disabled until the reset write settles so a stray click can't race- // the reset.- const [loaded, setLoaded] = useState(() => !isTauri());- const [busy, setBusy] = useState(false);-- useEffect(() => {- if (!isTauri()) {- return;- }- let cancelled = false;- // A new chat always starts with super context OFF (the initial state),- // regardless of the persisted flag. Reset the core flag to false on mount- // and register the write so a reset-then-immediately-Send awaits it before- // the new thread's session reads the flag — otherwise a stale "on" would run- // the context pass on this first turn.- const write = openhumanSetSuperContextEnabled(false);- trackSuperContextWrite(write);- void (async () => {- try {- await write;- log('reset super_context_enabled=false on new chat');- } catch (err) {- // Best-effort: a write failure leaves the toggle in its default-off- // state. The user can still flip it; the write path surfaces errors.- log('failed to reset super_context_enabled: %o', err);- } finally {- if (!cancelled) setLoaded(true);- }- })();- return () => {- cancelled = true;- };- }, []);-- const handleChange = useCallback(- (next: boolean) => {- if (busy) return;- const previous = enabled;- // Optimistic: reflect the choice immediately, roll back on failure.- setEnabled(next);- setBusy(true);- log('set super_context_enabled -> %o', next);- const write = openhumanSetSuperContextEnabled(next);- // Register the write so a flip-then-immediately-Send awaits it before the- // new thread's session reads the persisted flag (avoids a stale first turn).- trackSuperContextWrite(write);- void (async () => {- try {- const res = await write;- setEnabled(Boolean(res.result));- } catch (err) {- log('failed to persist super_context_enabled, rolling back: %o', err);- setEnabled(previous);- } finally {- setBusy(false);- }- })();- },- [busy, enabled]- );-- return (- <div className="flex h-7 flex-shrink-0 items-center gap-1.5 text-xs text-content-muted">- <SettingsSwitch- id="super-context-toggle"- checked={enabled}- onCheckedChange={handleChange}- disabled={!loaded || busy}- aria-label={t('chat.superContext.label')}- data-testid="super-context-toggle"- />- <span className="font-medium text-content-secondary">{t('chat.superContext.label')}</span>- {/* Self-contained wrapping tooltip (the shared <Tooltip> is single-line- nowrap and can't fit this paragraph). Anchored bottom-full + right-0- so it grows up-and-left into the app interior — the toggle only shows- on a fresh thread, where that space is empty, so it never clips. */}- <span className="group relative inline-flex">- <button- type="button"- aria-describedby="super-context-tooltip"- aria-label={t('chat.superContext.label')}- data-testid="super-context-info"- className="flex h-4 w-4 items-center justify-center rounded-full text-content-faint transition-colors hover:text-content-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500">- <svg- className="h-3.5 w-3.5"- fill="none"- stroke="currentColor"- viewBox="0 0 24 24"- aria-hidden="true">- <path- strokeLinecap="round"- strokeLinejoin="round"- strokeWidth={1.8}- d="M12 16v-4m0-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"- />- </svg>- </button>- <span- id="super-context-tooltip"- role="tooltip"- className="pointer-events-none absolute bottom-full right-0 z-[9999] mb-2 w-72 rounded-lg bg-stone-800 px-3 py-2 text-xs font-normal leading-snug text-white opacity-0 shadow-lg transition-opacity duration-150 group-hover:opacity-100 group-focus-within:opacity-100 dark:bg-neutral-700">- {t('chat.superContext.hint')}- </span>- </span>- </div>- );-};--export default SuperContextToggle;diff --git a/app/src/components/chat/__tests__/SuperContextToggle.test.tsx b/app/src/components/chat/__tests__/SuperContextToggle.test.tsxdeleted file mode 100644index 0c9151793c..0000000000--- a/app/src/components/chat/__tests__/SuperContextToggle.test.tsx+++ /dev/null@@ -1,79 +0,0 @@-import { fireEvent, render, screen, waitFor } from '@testing-library/react';-import { beforeEach, describe, expect, it, vi } from 'vitest';--import SuperContextToggle from '../SuperContextToggle';--// `vi.mock` factories are hoisted above the static imports, so any module-level-// mock fns they reference must be created with `vi.hoisted` (hoisted alongside-// them) — a plain `const` would be in the TDZ when the factory runs and could-// throw on import. See CodeRabbit/Codex review on PR #4085.-const { isTauriMock, setMock } = vi.hoisted(() => ({- isTauriMock: vi.fn(() => true),- setMock: vi.fn(),-}));--vi.mock('../../../lib/i18n/I18nContext', () => ({ useT: () => ({ t: (k: string) => k }) }));-vi.mock('../../../utils/tauriCommands/common', () => ({ isTauri: () => isTauriMock() }));-vi.mock('../../../utils/tauriCommands/config', () => ({- openhumanSetSuperContextEnabled: (value: boolean) => setMock(value),-}));--beforeEach(() => {- isTauriMock.mockReturnValue(true);- setMock.mockReset();- // Echo the written value back so the component reflects it on success.- setMock.mockImplementation((v: boolean) => Promise.resolve({ result: v, logs: [] }));-});--describe('<SuperContextToggle />', () => {- it('resets super context to off on mount, ignoring any persisted value', async () => {- render(<SuperContextToggle />);-- const sw = screen.getByTestId('super-context-toggle');- await waitFor(() => expect(sw).not.toBeDisabled());- // New chat always starts off, and the core flag is reset to false.- expect(sw).toHaveAttribute('aria-checked', 'false');- expect(setMock).toHaveBeenCalledWith(false);- });-- it('persists the new value and optimistically updates on toggle', async () => {- render(<SuperContextToggle />);- const sw = screen.getByTestId('super-context-toggle');- // Wait for the reset write to settle and enable the switch.- await waitFor(() => expect(sw).not.toBeDisabled());-- fireEvent.click(sw);-- // Optimistic flip is immediate; persistence is called with the new value.- await waitFor(() => expect(sw).toHaveAttribute('aria-checked', 'true'));- expect(setMock).toHaveBeenCalledWith(true);- });-- it('rolls back the optimistic flip when persistence fails', async () => {- // Reset write (false) succeeds; the toggle write (true) then fails.- setMock- .mockResolvedValueOnce({ result: false, logs: [] })- .mockRejectedValueOnce(new Error('rpc down'));-- render(<SuperContextToggle />);- const sw = screen.getByTestId('super-context-toggle');- await waitFor(() => expect(sw).not.toBeDisabled());-- fireEvent.click(sw);-- // Ends back at false after the rejected write.- await waitFor(() => expect(sw).toHaveAttribute('aria-checked', 'false'));- expect(setMock).toHaveBeenCalledWith(true);- });-- it('does not call the core RPC when running outside Tauri', () => {- isTauriMock.mockReturnValue(false);-- render(<SuperContextToggle />);-- expect(setMock).not.toHaveBeenCalled();- const sw = screen.getByTestId('super-context-toggle');- // Treated as loaded (enabled) immediately, default-off.- expect(sw).toHaveAttribute('aria-checked', 'false');- });-});diff --git a/app/src/components/chat/__tests__/superContextWrite.test.ts b/app/src/components/chat/__tests__/superContextWrite.test.tsdeleted file mode 100644index 9fa5355a9b..0000000000--- a/app/src/components/chat/__tests__/superContextWrite.test.ts+++ /dev/null@@ -1,30 +0,0 @@-import { describe, expect, it } from 'vitest';--import { trackSuperContextWrite, whenSuperContextWriteSettled } from '../superContextWrite';--describe('superContextWrite gate', () => {- it('resolves immediately when nothing is pending', async () => {- // Completing the await without throwing is the assertion.- await whenSuperContextWriteSettled();- });-- it('waits for a tracked write to settle before resolving', async () => {- let settled = false;- const write = new Promise(resolve =>- setTimeout(() => {- settled = true;- resolve('ok');- }, 5)- );- trackSuperContextWrite(write);-- await whenSuperContextWriteSettled();- expect(settled).toBe(true);- });-- it('still settles when a tracked write rejects', async () => {- trackSuperContextWrite(Promise.reject(new Error('rpc down')));- // Must not throw — the send path only needs the write to have settled.- await whenSuperContextWriteSettled();- });-});diff --git a/app/src/components/chat/superContextWrite.ts b/app/src/components/chat/superContextWrite.tsdeleted file mode 100644index f35df1b998..0000000000--- a/app/src/components/chat/superContextWrite.ts+++ /dev/null@@ -1,25 +0,0 @@-// Tracks the most recent in-flight "super context" config write so the chat-// send path can await it before a new thread's session is built.-//-// The flag is read by the core when the chat task constructs its session, so a-// flip-then-immediately-Send could otherwise race: the fire-and-forget write-// from the composer toggle may still be in flight, and the first turn would run-// with the *previous* persisted value while the UI already shows the new one.-// `SuperContextToggle` registers its write here; `handleSendMessage` awaits-// `whenSuperContextWriteSettled()` before sending.--let pending: Promise<unknown> = Promise.resolve();--/** Register an in-flight super-context write. Failures are swallowed — the- * send path only needs the write to have *settled*, not to have succeeded. */-export function trackSuperContextWrite(write: Promise<unknown>): void {- // Chain so concurrent flips all settle before the gate resolves.- const prior = pending;- pending = Promise.allSettled([prior, write]);-}--/** Resolves once every registered super-context write has settled. Cheap to- * await when nothing is pending (resolved promise). */-export function whenSuperContextWriteSettled(): Promise<unknown> {- return pending;-}diff --git a/app/src/components/orchestration/AgentChatPanel.tsx b/app/src/components/orchestration/AgentChatPanel.tsxindex b1b08c4666..18c4f422bc 100644--- a/app/src/components/orchestration/AgentChatPanel.tsx+++ b/app/src/components/orchestration/AgentChatPanel.tsx@@ -12,8 +12,7 @@* list or an inline "needs you" card, it takes over the whole pane (not a* side drawer) so the session's chat renders full-size, with a back link.*- * Conscious/Subconscious is a bottom toggle in the composer footer (where the- * generic chat's super-context / quick-reasoning controls sit).+ * Conscious/Subconscious is a bottom toggle in the composer footer.*/import debugFactory from 'debug';import {@@ -491,8 +490,7 @@ export default function AgentChatPanel({const loading = sessionsState.status === 'loading' || messagesState.status === 'loading';const errored = sessionsState.status === 'error' || messagesState.status === 'error';- // The Conscious/Subconscious toggle — sits in the composer footer slot where- // the generic chat's super-context / quick-reasoning controls live.+ // The Conscious/Subconscious toggle sits in the composer footer.const modeToggle = (<divclassName="inline-flex h-7 items-center rounded-full border border-line bg-surface-subtle p-0.5"diff --git a/app/src/features/conversations/Conversations.tsx b/app/src/features/conversations/Conversations.tsxindex bdfe7f49f1..bfcce9ba6b 100644--- a/app/src/features/conversations/Conversations.tsx+++ b/app/src/features/conversations/Conversations.tsx@@ -15,8 +15,6 @@ import ComposerTokenStats from '../../components/chat/ComposerTokenStats';import { FlowApprovalRequestCard } from '../../components/chat/FlowApprovalRequestCard';import IntegrationConnectCard from '../../components/chat/IntegrationConnectCard';import QueuedFollowups from '../../components/chat/QueuedFollowups';-import SuperContextToggle from '../../components/chat/SuperContextToggle';-import { whenSuperContextWriteSettled } from '../../components/chat/superContextWrite';import WorkflowProposalCard from '../../components/chat/WorkflowProposalCard';import { ConfirmationModal } from '../../components/intelligence/ConfirmationModal';import PanelHeader from '../../components/layout/PanelHeader';@@ -1066,12 +1064,6 @@ const Conversations = ({if (!sendingThreadId) return;pendingSendsRef.current.add(sendingThreadId);addPendingSendingThread(sendingThreadId);- // If the user just flipped the Super Context toggle, make sure that config- // write has landed before the core builds this thread's session (which- // reads `context.super_context_enabled`). Done AFTER the duplicate-send- // guard above is set so this await can't open a check→add race for rapid- // repeat clicks. Resolves instantly when nothing is pending.- await whenSuperContextWriteSettled();const pendingAttachments = attachments.slice();const modelOverride =agentProfiles.find(p => p.id === selectedAgentProfileId)?.modelOverride ?? CHAT_MODEL_HINT;@@ -2495,14 +2487,6 @@ const Conversations = ({{t('chat.agentProfile.reasoning')}</button></div>- {/* Super context is read at thread construction, so it only- affects NEW threads. Hide the toggle once the thread has ANY- activity — use the raw `messages` (not `hasVisibleMessages`,- which ignores hidden transcript entries) so an already-started- thread never looks "fresh" here. */}- {/* Key by thread so switching to another empty chat remounts the- toggle and re-runs its off-by-default reset (PR #4874 review). */}- {messages.length === 0 && <SuperContextToggle key={selectedThreadId ?? 'new-chat'} />}{selectedThreadId && (<buttontype="button"diff --git a/app/src/lib/i18n/ar.ts b/app/src/lib/i18n/ar.tsindex 6c22f6dc67..2ba9208419 100644--- a/app/src/lib/i18n/ar.ts+++ b/app/src/lib/i18n/ar.ts@@ -2649,9 +2649,6 @@ const messages: TranslationMap = {'chat.left': 'متبقٍ','chat.setup': 'إعداد','chat.switchToText': 'التبديل إلى النص',- 'chat.superContext.label': 'سياق فائق',- 'chat.superContext.hint':- 'يتيح «سياق فائق» لـ OpenHuman جمع وتحضير السياق من جميع البيانات التي يمكنه الوصول إليها لتقديم إجابة وثيقة الصلة للغاية. «سياق فائق» في مرحلة تجريبية مبكرة.','chat.transcribing': 'جارٍ النسخ...','chat.stopAndSend': 'إيقاف وإرسال','chat.startTalking': 'ابدأ الحديث',diff --git a/app/src/lib/i18n/bn.ts b/app/src/lib/i18n/bn.tsindex 60c5f6481b..60fb36e631 100644--- a/app/src/lib/i18n/bn.ts+++ b/app/src/lib/i18n/bn.ts@@ -2712,9 +2712,6 @@ const messages: TranslationMap = {'chat.left': 'বাকি','chat.setup': 'সেটআপ করুন','chat.switchToText': 'টেক্সটে পরিবর্তন করুন',- 'chat.superContext.label': 'সুপার কনটেক্সট',- 'chat.superContext.hint':- 'সুপার কনটেক্সট OpenHuman-কে তার অ্যাক্সেসযোগ্য সমস্ত ডেটা থেকে প্রসঙ্গ সংগ্রহ ও প্রস্তুত করতে দেয় যাতে এটি অত্যন্ত প্রাসঙ্গিক উত্তর দিতে পারে। সুপার কনটেক্সট প্রাথমিক বিটা পর্যায়ে রয়েছে।','chat.transcribing': 'ট্রান্সক্রাইব হচ্ছে...','chat.stopAndSend': 'থামুন ও পাঠান','chat.startTalking': 'কথা বলা শুরু করুন',diff --git a/app/src/lib/i18n/de.ts b/app/src/lib/i18n/de.tsindex d9bf467201..e04674102d 100644--- a/app/src/lib/i18n/de.ts+++ b/app/src/lib/i18n/de.ts@@ -2791,9 +2791,6 @@ const messages: TranslationMap = {'chat.left': 'links','chat.setup': 'Einrichten','chat.switchToText': 'Wechsle zu Text',- 'chat.superContext.label': 'Super-Kontext',- 'chat.superContext.hint':- 'Super-Kontext ermöglicht OpenHuman, Kontext aus allen verfügbaren Daten zu sammeln und aufzubereiten, um eine hochrelevante Antwort zu liefern. Super-Kontext befindet sich in einer frühen Beta-Phase.','chat.transcribing': 'Transkribieren...','chat.stopAndSend': 'Stoppen und senden','chat.startTalking': 'Sprich los',diff --git a/app/src/lib/i18n/en.ts b/app/src/lib/i18n/en.tsindex 6cdfd2b859..126ec3cbf9 100644--- a/app/src/lib/i18n/en.ts+++ b/app/src/lib/i18n/en.ts@@ -2850,9 +2850,6 @@ const en: TranslationMap = {'chat.left': 'left','chat.setup': 'Set up','chat.switchToText': 'Switch to text',- 'chat.superContext.label': 'Super Context',- 'chat.superContext.hint':- 'Super Context allows OpenHuman to gather and prepare context from all the data it has access to so that it can deliver a highly relevant answer. Super Context is in early beta.','chat.transcribing': 'Transcribing...','chat.stopAndSend': 'Stop and send','chat.startTalking': 'Start talking',diff --git a/app/src/lib/i18n/es.ts b/app/src/lib/i18n/es.tsindex eb97e929e9..8146b03aa0 100644--- a/app/src/lib/i18n/es.ts+++ b/app/src/lib/i18n/es.ts@@ -2763,9 +2763,6 @@ const messages: TranslationMap = {'chat.left': 'restante','chat.setup': 'Configurar','chat.switchToText': 'Cambiar a texto',- 'chat.superContext.label': 'Súper contexto',- 'chat.superContext.hint':- 'Súper contexto permite a OpenHuman reunir y preparar contexto a partir de todos los datos a los que tiene acceso para ofrecer una respuesta muy relevante. Súper contexto está en fase beta inicial.','chat.transcribing': 'Transcribiendo...','chat.stopAndSend': 'Detener y enviar','chat.startTalking': 'Empieza a hablar',diff --git a/app/src/lib/i18n/fr.ts b/app/src/lib/i18n/fr.tsindex 758d1fbf9c..53539838e2 100644--- a/app/src/lib/i18n/fr.ts+++ b/app/src/lib/i18n/fr.ts@@ -2785,9 +2785,6 @@ const messages: TranslationMap = {'chat.left': 'restant','chat.setup': 'Configurer','chat.switchToText': 'Passer au texte',- 'chat.superContext.label': 'Super contexte',- 'chat.superContext.hint':- 'Super contexte permet à OpenHuman de rassembler et de préparer le contexte à partir de toutes les données auxquelles il a accès afin de fournir une réponse très pertinente. Super contexte est en bêta précoce.','chat.transcribing': 'Transcription…','chat.stopAndSend': 'Arrêter et envoyer','chat.startTalking': 'Commence à parler',diff --git a/app/src/lib/i18n/hi.ts b/app/src/lib/i18n/hi.tsindex 440f084d80..1d5224b67c 100644--- a/app/src/lib/i18n/hi.ts+++ b/app/src/lib/i18n/hi.ts@@ -2709,9 +2709,6 @@ const messages: TranslationMap = {'chat.left': 'बचा हुआ','chat.setup': 'सेट अप करें','chat.switchToText': 'टेक्स्ट पर स्विच करें',- 'chat.superContext.label': 'सुपर कॉन्टेक्स्ट',- 'chat.superContext.hint':- 'सुपर कॉन्टेक्स्ट OpenHuman को उन सभी डेटा से संदर्भ इकट्ठा और तैयार करने देता है जिन तक उसकी पहुँच है, ताकि वह अत्यधिक प्रासंगिक उत्तर दे सके। सुपर कॉन्टेक्स्ट प्रारंभिक बीटा में है।','chat.transcribing': 'ट्रांसक्राइब हो रहा है...','chat.stopAndSend': 'रोकें और भेजें','chat.startTalking': 'बोलना शुरू करें',diff --git a/app/src/lib/i18n/id.ts b/app/src/lib/i18n/id.tsindex 798a8db567..e31c976418 100644--- a/app/src/lib/i18n/id.ts+++ b/app/src/lib/i18n/id.ts@@ -2721,9 +2721,6 @@ const messages: TranslationMap = {'chat.left': 'tersisa','chat.setup': 'Atur','chat.switchToText': 'Beralih ke teks',- 'chat.superContext.label': 'Super konteks',- 'chat.superContext.hint':- 'Super konteks memungkinkan OpenHuman mengumpulkan dan menyiapkan konteks dari semua data yang dapat diaksesnya agar dapat memberikan jawaban yang sangat relevan. Super konteks masih dalam tahap beta awal.','chat.transcribing': 'Mentranskripsi...','chat.stopAndSend': 'Berhenti dan kirim','chat.startTalking': 'Mulai bicara',diff --git a/app/src/lib/i18n/it.ts b/app/src/lib/i18n/it.tsindex 5c60959b47..bbcbfe068a 100644--- a/app/src/lib/i18n/it.ts+++ b/app/src/lib/i18n/it.ts@@ -2759,9 +2759,6 @@ const messages: TranslationMap = {'chat.left': 'rimasti','chat.setup': 'Configura','chat.switchToText': 'Passa al testo',- 'chat.superContext.label': 'Super contesto',- 'chat.superContext.hint':- 'Super contesto consente a OpenHuman di raccogliere e preparare il contesto da tutti i dati a cui ha accesso per fornire una risposta altamente pertinente. Super contesto è in beta iniziale.','chat.transcribing': 'Trascrizione...','chat.stopAndSend': 'Ferma e invia','chat.startTalking': 'Inizia a parlare',diff --git a/app/src/lib/i18n/ko.ts b/app/src/lib/i18n/ko.tsindex 86d453381f..ed9ebab29b 100644--- a/app/src/lib/i18n/ko.ts+++ b/app/src/lib/i18n/ko.ts@@ -2679,9 +2679,6 @@ const messages: TranslationMap = {'chat.left': '남음','chat.setup': '설정','chat.switchToText': '텍스트로 전환',- 'chat.superContext.label': '슈퍼 컨텍스트',- 'chat.superContext.hint':- '슈퍼 컨텍스트를 사용하면 OpenHuman이 접근할 수 있는 모든 데이터에서 컨텍스트를 수집하고 준비하여 매우 관련성 높은 답변을 제공할 수 있습니다. 슈퍼 컨텍스트는 초기 베타 단계입니다.','chat.transcribing': '전사 중...','chat.stopAndSend': '중지하고 보내기','chat.startTalking': '말하기 시작',diff --git a/app/src/lib/i18n/pl.ts b/app/src/lib/i18n/pl.tsindex 7b424f3182..8f1a497c9a 100644--- a/app/src/lib/i18n/pl.ts+++ b/app/src/lib/i18n/pl.ts@@ -2743,9 +2743,6 @@ const messages: TranslationMap = {'chat.left': 'pozostało','chat.setup': 'Skonfiguruj','chat.switchToText': 'Przełącz na tekst',- 'chat.superContext.label': 'Superkontekst',- 'chat.superContext.hint':- 'Superkontekst pozwala OpenHuman zebrać i przygotować kontekst ze wszystkich dostępnych danych, aby udzielić wysoce trafnej odpowiedzi. Superkontekst jest we wczesnej wersji beta.','chat.transcribing': 'Transkrypcja...','chat.stopAndSend': 'Zatrzymaj i wyślij','chat.startTalking': 'Zacznij mówić',diff --git a/app/src/lib/i18n/pt.ts b/app/src/lib/i18n/pt.tsindex 1b648255e6..10a7efb92f 100644--- a/app/src/lib/i18n/pt.ts+++ b/app/src/lib/i18n/pt.ts@@ -2758,9 +2758,6 @@ const messages: TranslationMap = {'chat.left': 'restante','chat.setup': 'Configurar','chat.switchToText': 'Mudar para texto',- 'chat.superContext.label': 'Supercontexto',- 'chat.superContext.hint':- 'O Supercontexto permite que o OpenHuman reúna e prepare contexto a partir de todos os dados a que tem acesso para oferecer uma resposta altamente relevante. O Supercontexto está em beta inicial.','chat.transcribing': 'Transcrevendo...','chat.stopAndSend': 'Parar e enviar','chat.startTalking': 'Comece a falar',diff --git a/app/src/lib/i18n/ru.ts b/app/src/lib/i18n/ru.tsindex 41acd80179..84a50451fe 100644--- a/app/src/lib/i18n/ru.ts+++ b/app/src/lib/i18n/ru.ts@@ -2732,9 +2732,6 @@ const messages: TranslationMap = {'chat.left': 'осталось','chat.setup': 'Настроить','chat.switchToText': 'Переключиться на текст',- 'chat.superContext.label': 'Супер-контекст',- 'chat.superContext.hint':- 'Супер-контекст позволяет OpenHuman собирать и подготавливать контекст из всех доступных ему данных, чтобы давать максимально релевантный ответ. Супер-контекст находится на стадии раннего бета-тестирования.','chat.transcribing': 'Транскрипция...','chat.stopAndSend': 'Остановить и отправить','chat.startTalking': 'Начни говорить',diff --git a/app/src/lib/i18n/zh-CN.ts b/app/src/lib/i18n/zh-CN.tsindex c599b97317..0d37052c8a 100644--- a/app/src/lib/i18n/zh-CN.ts+++ b/app/src/lib/i18n/zh-CN.ts@@ -2560,9 +2560,6 @@ const messages: TranslationMap = {'chat.left': '剩余','chat.setup': '设置','chat.switchToText': '切换到文本',- 'chat.superContext.label': '超级上下文',- 'chat.superContext.hint':- '超级上下文让 OpenHuman 能够从其可访问的所有数据中收集并准备上下文,从而给出高度相关的回答。超级上下文目前处于早期测试阶段。','chat.transcribing': '转录中...','chat.stopAndSend': '停止并发送','chat.startTalking': '开始说话',diff --git a/app/src/services/rpcMethods.ts b/app/src/services/rpcMethods.tsindex 5f57cd299d..87306d3f63 100644--- a/app/src/services/rpcMethods.ts+++ b/app/src/services/rpcMethods.ts@@ -11,9 +11,7 @@ export const CORE_RPC_METHODS = {configGetPrivacyMode: 'openhuman.config_get_privacy_mode',configGetSandboxSettings: 'openhuman.config_get_sandbox_settings',configGetSearchSettings: 'openhuman.config_get_search_settings',- configGetSuperContextEnabled: 'openhuman.config_get_super_context_enabled',configSetPrivacyMode: 'openhuman.config_set_privacy_mode',- configSetSuperContextEnabled: 'openhuman.config_set_super_context_enabled',configUpdateSearchSettings: 'openhuman.config_update_search_settings',configSetBrowserAllowAll: 'openhuman.config_set_browser_allow_all',configUpdateAgentPaths: 'openhuman.config_update_agent_paths',diff --git a/app/src/utils/tauriCommands/config.ts b/app/src/utils/tauriCommands/config.tsindex 9d7d238722..d0681fa8f8 100644--- a/app/src/utils/tauriCommands/config.ts+++ b/app/src/utils/tauriCommands/config.ts@@ -559,40 +559,6 @@ export async function openhumanUpdateAutonomySettings(});}-// ── "Super context" toggle ───────────────────────────────────────────────────--/**- * Reads the "super context" flag (`context.super_context_enabled`). When on,- * the harness runs a read-only context-collection pass on the first turn of a- * new thread — before the orchestrator LLM runs — and folds the result into the- * user message. Surfaced as the toggle below the chat composer.- */-export async function openhumanGetSuperContextEnabled(): Promise<CommandResponse<boolean>> {- if (!isTauri()) {- throw new Error('Not running in Tauri');- }- return await callCoreRpc<CommandResponse<boolean>>({- method: CORE_RPC_METHODS.configGetSuperContextEnabled,- });-}--/**- * Enables or disables "super context". Takes effect for threads started after- * the change (the value is baked into the frozen turn-1 prefix), so toggling it- * mid-conversation only affects the next new thread.- */-export async function openhumanSetSuperContextEnabled(- value: boolean-): Promise<CommandResponse<boolean>> {- if (!isTauri()) {- throw new Error('Not running in Tauri');- }- return await callCoreRpc<CommandResponse<boolean>>({- method: CORE_RPC_METHODS.configSetSuperContextEnabled,- params: { value },- });-}-// ── Sandbox execution backend settings ───────────────────────────────────────export type SandboxBackendId = 'auto' | 'docker' | 'landlock' | 'firejail' | 'bubblewrap' | 'none';diff --git a/app/test/e2e/specs/chat-harness-subagent.spec.ts b/app/test/e2e/specs/chat-harness-subagent.spec.tsindex c31d8da11a..87e83d5ddd 100644--- a/app/test/e2e/specs/chat-harness-subagent.spec.ts+++ b/app/test/e2e/specs/chat-harness-subagent.spec.ts@@ -153,14 +153,6 @@ describe('Chat harness — orchestrator → subagent flow', () => {// clean signed-in state rather than a polluted one (the source of the// intermittent "final canary never arrives" failures).await resetApp(USER_ID, { clearAuthSession: true });- const superContext = await callOpenhumanRpc('openhuman.config_set_super_context_enabled', {- value: false,- });- expect(superContext.ok).toBe(true);- console.log(- '[chat-harness-subagent] Disabled super context for deterministic scripted LLM calls'- );-setMockBehavior('llmKeywordRules', JSON.stringify(KEYWORD_RULES));// Faster streaming for non-tool-call responses so this spec doesn't// need 30s of patience for three full streams.diff --git a/app/test/e2e/specs/chat-harness-wallet-flow.spec.ts b/app/test/e2e/specs/chat-harness-wallet-flow.spec.tsindex 81a57fb1c3..6e7e0b0841 100644--- a/app/test/e2e/specs/chat-harness-wallet-flow.spec.ts+++ b/app/test/e2e/specs/chat-harness-wallet-flow.spec.ts@@ -121,13 +121,6 @@ describe('Chat harness — wallet flow', () => {// so the crypto sub-agent run starts from a clean signed-in state (a// polluted session was the source of the intermittent quote-store failures).await resetApp(USER_ID, { clearAuthSession: true });- const superContext = await callOpenhumanRpc('openhuman.config_set_super_context_enabled', {- value: false,- });- expect(superContext.ok).toBe(true);- console.log(- '[chat-harness-wallet-flow] Disabled super context for deterministic scripted LLM calls'- );});after(async () => {diff --git a/app/test/e2e/specs/harness-channel-bridge-flow.spec.ts b/app/test/e2e/specs/harness-channel-bridge-flow.spec.tsindex a8a2036133..f331b10e88 100644--- a/app/test/e2e/specs/harness-channel-bridge-flow.spec.ts+++ b/app/test/e2e/specs/harness-channel-bridge-flow.spec.ts@@ -212,11 +212,6 @@ describe('Harness — Cross-channel bridge flow', () => {await startMockServer();await waitForApp();await resetApp(USER_ID);- const superContext = await callOpenhumanRpc('openhuman.config_set_super_context_enabled', {- value: false,- });- expect(superContext.ok).toBe(true);-// Configure Telegram mock defaults.setMockBehavior('telegramBotUsername', TEST_BOT_USERNAME);setMockBehavior('telegramPollDelayMs', '0');diff --git a/app/test/e2e/specs/harness-composio-tool-flow.spec.ts b/app/test/e2e/specs/harness-composio-tool-flow.spec.tsindex afd929c780..d846ab431f 100644--- a/app/test/e2e/specs/harness-composio-tool-flow.spec.ts+++ b/app/test/e2e/specs/harness-composio-tool-flow.spec.ts@@ -135,10 +135,6 @@ describe('Harness — Composio tool-call prompt flow', () => {await startMockServer();await waitForApp();await resetApp(USER_ID);- const superContext = await callOpenhumanRpc('openhuman.config_set_super_context_enabled', {- value: false,- });- expect(superContext.ok).toBe(true);console.log(`${LOG_PREFIX} Suite setup complete`);});diff --git a/app/test/e2e/specs/harness-cron-prompt-flow.spec.ts b/app/test/e2e/specs/harness-cron-prompt-flow.spec.tsindex a96e47210c..9d14aed164 100644--- a/app/test/e2e/specs/harness-cron-prompt-flow.spec.ts+++ b/app/test/e2e/specs/harness-cron-prompt-flow.spec.ts@@ -164,10 +164,6 @@ describe('Harness — Cron prompt-flow', () => {await startMockServer();await waitForApp();await resetApp(USER_ID);- const superContext = await callOpenhumanRpc('openhuman.config_set_super_context_enabled', {- value: false,- });- expect(superContext.ok).toBe(true);console.log(`${LOG_PREFIX} Suite setup complete`);});diff --git a/app/test/e2e/specs/harness-search-tool-flow.spec.ts b/app/test/e2e/specs/harness-search-tool-flow.spec.tsindex dfe1afa654..cb330d4c79 100644--- a/app/test/e2e/specs/harness-search-tool-flow.spec.ts+++ b/app/test/e2e/specs/harness-search-tool-flow.spec.ts@@ -126,10 +126,6 @@ describe('Harness — Search tool-flow', () => {await startMockServer();await waitForApp();await resetApp(USER_ID);- const superContext = await callOpenhumanRpc('openhuman.config_set_super_context_enabled', {- value: false,- });- expect(superContext.ok).toBe(true);console.log(`${LOG_PREFIX} Suite setup complete`);});diff --git a/app/test/e2e/specs/user-journey-full-task.spec.ts b/app/test/e2e/specs/user-journey-full-task.spec.tsindex 160b4e9b92..6d6f2f4241 100644--- a/app/test/e2e/specs/user-journey-full-task.spec.ts+++ b/app/test/e2e/specs/user-journey-full-task.spec.ts@@ -61,12 +61,6 @@ describe('User journey — full research task', () => {await startMockServer();await waitForApp();await resetApp(USER_ID);- const superContext = await callOpenhumanRpc('openhuman.config_set_super_context_enabled', {- value: false,- });- expect(superContext.ok).toBe(true);- console.log(`${LOG_PREFIX} Disabled super context for deterministic scripted LLM calls`);-setMockBehavior('llmForcedResponses', JSON.stringify(FORCED_RESPONSES));setMockBehavior('llmStreamChunkDelayMs', '10');clearRequestLog();diff --git a/app/test/playwright/specs/navigation-smoothness.spec.ts b/app/test/playwright/specs/navigation-smoothness.spec.tsindex 13f3fe5c3d..f299d0d4ef 100644--- a/app/test/playwright/specs/navigation-smoothness.spec.ts+++ b/app/test/playwright/specs/navigation-smoothness.spec.ts@@ -8,7 +8,7 @@ interface RouteCheck {}const routes: RouteCheck[] = [- { hash: '/chat', markers: ['Your assistant is ready', 'Reasoning', 'Super Context'] },+ { hash: '/chat', markers: ['Your assistant is ready', 'Reasoning'] },{ hash: '/connections', markers: ['Composio', 'Channels', 'MCP Servers', 'Skills'] },// Home folded into the unified chat surface — /home redirects to /chat.{ hash: '/home', markers: ['Your assistant is ready', 'Reasoning'] },diff --git a/app/test/playwright/specs/top-level-functional-flows.spec.ts b/app/test/playwright/specs/top-level-functional-flows.spec.tsindex 811b1fb43a..dc455b0b35 100644--- a/app/test/playwright/specs/top-level-functional-flows.spec.ts+++ b/app/test/playwright/specs/top-level-functional-flows.spec.ts@@ -100,7 +100,7 @@ test.describe('Top-level functional flows', () => {// Home folded into the unified chat surface — /home redirects to /chat.['/home', /Your assistant is ready|Reasoning/],['/connections', /Composio Integrations|Composio|Channels|MCP Servers/],- ['/chat', /Your assistant is ready|Reasoning|Super Context/],+ ['/chat', /Your assistant is ready|Reasoning/],['/settings/notifications-hub', /Notifications/],['/notifications', /Notifications|System Events/],['/rewards', /Rewards|Referrals|Redeem/],diff --git a/app/test/playwright/specs/user-journey-settings-round-trip.spec.ts b/app/test/playwright/specs/user-journey-settings-round-trip.spec.tsindex 4dc441defc..4c3217002a 100644--- a/app/test/playwright/specs/user-journey-settings-round-trip.spec.ts+++ b/app/test/playwright/specs/user-journey-settings-round-trip.spec.ts@@ -20,7 +20,7 @@ const panels: PanelCheck[] = [// Home folded into the unified chat surface — /home redirects to /chat.{ hash: '/home', markers: ['Your assistant is ready', 'Reasoning'] },// /chat is the Assistant surface (thread list + agent chat header).- { hash: '/chat', markers: ['Your assistant is ready', 'Reasoning', 'Super Context'] },+ { hash: '/chat', markers: ['Your assistant is ready', 'Reasoning'] },];async function waitForPanelLoad(page: Parameters<typeof test>[0]['page']) {diff --git a/docs/README.de.md b/docs/README.de.mdindex 950b057c0b..724d5e4a65 100644--- a/docs/README.de.md+++ b/docs/README.de.md@@ -78,7 +78,6 @@ OpenHuman ist drei Dinge, die die meisten Assistenten nicht sind: **ein Gehirn**### 🔬 Der Deep Researcher & Macher-- **[SuperContext](https://tinyhumans.gitbook.io/openhuman/features/super-context)**: ein Research-Scout durchkämmt dein Gedächtnis und deine Dateien, bevor das Modell deine erste Nachricht liest. Keine Kaltstarts.- **Alles eingebaut**: Web-Suche, Scraper, Coder-Toolset, ein echter [Browser](https://tinyhumans.gitbook.io/openhuman/features/native-tools/browser-and-computer), [native Sprache](../gitbooks/features/native-tools/voice.md) mit In-Process-Whisper. Dazu [Model-Routing](https://tinyhumans.gitbook.io/openhuman/features/model-routing), das das passende LLM pro Workload auswählt, ein Abo, [lokale KI optional](https://tinyhumans.gitbook.io/openhuman/features/model-routing/local-ai).- **[Meeting-Agenten](https://tinyhumans.gitbook.io/openhuman/features/mascot/meeting-agents)**: nimmt an **Meet, Zoom, Teams und Webex** teil, mit Gesicht und Stimme. Tritt automatisch aus deinem Kalender bei, streamt ein Live-Transkript, antwortet auf seinen Namen und legt Zusammenfassung + Action Items ab.- **[Bild- & Videogenerierung](https://tinyhumans.gitbook.io/openhuman/features/native-tools)**: Seedream/SeedEdit-Bilder und Seedance/Veo-Video, direkt in deinen Workspace im selben Abo.diff --git a/docs/README.ja-JP.md b/docs/README.ja-JP.mdindex 0bcd7f73aa..afc34971b6 100644--- a/docs/README.ja-JP.md+++ b/docs/README.ja-JP.md@@ -78,7 +78,6 @@ OpenHuman は、ほとんどのアシスタントが持っていない 3 つの### 🔬 ディープリサーチャー & 実行者-- **[SuperContext](https://tinyhumans.gitbook.io/openhuman/features/super-context)**: モデルがあなたの最初のメッセージを読む前に、リサーチスカウトがメモリとファイルを走査します。コールドスタートはありません。- **電池同梱(Batteries included)**: ウェブ検索、スクレイパー、コーダーツールセット、本物の[ブラウザ](https://tinyhumans.gitbook.io/openhuman/features/native-tools/browser-and-computer)、インプロセス Whisper による[ネイティブ音声](../gitbooks/features/native-tools/voice.md)、さらにワークロードごとに適切な LLM を選ぶ[モデルルーティング](https://tinyhumans.gitbook.io/openhuman/features/model-routing)。1 つのサブスクリプションで、[ローカル AI はオプション](https://tinyhumans.gitbook.io/openhuman/features/model-routing/local-ai)です。- **[会議エージェント](https://tinyhumans.gitbook.io/openhuman/features/mascot/meeting-agents)**: 顔と声を持って **Meet、Zoom、Teams、Webex** に参加します。カレンダーから自動参加し、ライブ文字起こしをストリーミングし、名前で呼ばれると答え、要約とアクションアイテムを保存します。- **[画像・動画生成](https://tinyhumans.gitbook.io/openhuman/features/native-tools)**: Seedream/SeedEdit の画像と Seedance/Veo の動画を、同じサブスクリプションでワークスペースに直接生成します。diff --git a/docs/README.ko.md b/docs/README.ko.mdindex 348340772c..84f0302391 100644--- a/docs/README.ko.md+++ b/docs/README.ko.md@@ -78,7 +78,6 @@ OpenHuman은 대부분의 어시스턴트가 갖지 못한 세 가지입니다:### 🔬 깊이 있는 리서처이자 실행가-- **[SuperContext](https://tinyhumans.gitbook.io/openhuman/features/super-context)**: 모델이 첫 메시지를 읽기 전에 리서치 스카우트가 당신의 메모리와 파일을 훑습니다. 콜드 스타트가 없습니다.- **모든 것이 포함됨(Batteries included)**: 웹 검색, 스크레이퍼, 코더 툴셋, 실제 [브라우저](https://tinyhumans.gitbook.io/openhuman/features/native-tools/browser-and-computer), 인프로세스 Whisper를 갖춘 [네이티브 음성](../gitbooks/features/native-tools/voice.md), 그리고 워크로드별로 적합한 LLM을 선택하는 [모델 라우팅](https://tinyhumans.gitbook.io/openhuman/features/model-routing)까지. 하나의 구독으로, [로컬 AI는 선택 사항](https://tinyhumans.gitbook.io/openhuman/features/model-routing/local-ai)입니다.- **[미팅 에이전트](https://tinyhumans.gitbook.io/openhuman/features/mascot/meeting-agents)**: 얼굴과 목소리를 가지고 **Meet, Zoom, Teams, Webex**에 참여합니다. 캘린더에서 자동으로 참여하고, 실시간 자막을 스트리밍하며, 이름이 불리면 대답하고, 요약과 액션 아이템을 정리합니다.- **[이미지 및 비디오 생성](https://tinyhumans.gitbook.io/openhuman/features/native-tools)**: Seedream/SeedEdit 이미지와 Seedance/Veo 비디오가 동일한 구독으로 워크스페이스에 바로 생성됩니다.diff --git a/docs/README.ur-pk.md b/docs/README.ur-pk.mdindex 20fbfe6ac8..96755dae35 100644--- a/docs/README.ur-pk.md+++ b/docs/README.ur-pk.md@@ -92,7 +92,6 @@ OpenHuman تین چیزیں ہے جو زیادہ تر اسسٹنٹس نہیں ہ### 🔬 گہرا محقق اور کام کرنے والا-- **[SuperContext](https://tinyhumans.gitbook.io/openhuman/features/super-context)**: ایک ریسرچ اسکاؤٹ ماڈل کے آپ کا پہلا پیغام پڑھنے سے پہلے آپ کی یادداشت اور فائلوں کا جائزہ لے لیتا ہے۔ کوئی سرد آغاز نہیں۔- **سب کچھ شامل ہے**: ویب سرچ، سکریپر، کوڈر ٹول سیٹ، ایک حقیقی [براؤزر](https://tinyhumans.gitbook.io/openhuman/features/native-tools/browser-and-computer)، ان پروسیس Whisper کے ساتھ [مقامی آواز](../gitbooks/features/native-tools/voice.md)، اور ساتھ [ماڈل روٹنگ](https://tinyhumans.gitbook.io/openhuman/features/model-routing) جو ہر ورک لوڈ کے لیے صحیح LLM چنتی ہے، ایک سبسکرپشن، [مقامی AI اختیاری](https://tinyhumans.gitbook.io/openhuman/features/model-routing/local-ai)۔- **[میٹنگ ایجنٹس](https://tinyhumans.gitbook.io/openhuman/features/mascot/meeting-agents)**: چہرے اور آواز کے ساتھ **Meet، Zoom، Teams، اور Webex** میں شامل ہوتا ہے۔ کیلنڈر سے خود بخود شامل ہوتا ہے، لائیو ٹرانسکرپٹ اسٹریم کرتا ہے، نام سے جواب دیتا ہے، خلاصہ + ایکشن آئٹمز محفوظ کرتا ہے۔- **[تصویر اور ویڈیو جنریشن](https://tinyhumans.gitbook.io/openhuman/features/native-tools)**: Seedream/SeedEdit تصاویر اور Seedance/Veo ویڈیو، براہ راست آپ کے ورک اسپیس میں، اسی سبسکرپشن پر۔diff --git a/docs/README.zh-CN.md b/docs/README.zh-CN.mdindex 55c0eb95d8..901259c84b 100644--- a/docs/README.zh-CN.md+++ b/docs/README.zh-CN.md@@ -78,7 +78,6 @@ OpenHuman 是大多数助手所不具备的三样东西的集合:**一颗大### 🔬 深度研究员与实干家-- **[SuperContext](https://tinyhumans.gitbook.io/openhuman/features/super-context)**:在模型读取你的第一条消息之前,一个研究侦察器会先扫描你的记忆和文件。没有冷启动。- **开箱即用**:网络搜索、抓取器、编码工具集、真正的[浏览器](https://tinyhumans.gitbook.io/openhuman/features/native-tools/browser-and-computer)、带进程内 Whisper 的[原生语音](../gitbooks/features/native-tools/voice.md),以及为每个工作负载挑选合适 LLM 的[模型路由](https://tinyhumans.gitbook.io/openhuman/features/model-routing)。一个订阅搞定,[本地 AI 可选](https://tinyhumans.gitbook.io/openhuman/features/model-routing/local-ai)。- **[会议智能体](https://tinyhumans.gitbook.io/openhuman/features/mascot/meeting-agents)**:带着一张脸和一副嗓音加入 **Meet、Zoom、Teams 和 Webex**:根据日历自动入会、实时输出转写字幕、被点名时回答、归档摘要和行动项。- **[图像与视频生成](https://tinyhumans.gitbook.io/openhuman/features/native-tools)**:Seedream/SeedEdit 图像和 Seedance/Veo 视频,直接输出到你的工作区,同一份订阅。diff --git a/docs/specs/2026-07-28-agent-session-transcript-to-tinyagents-design.md b/docs/specs/2026-07-28-agent-session-transcript-to-tinyagents-design.mdindex 3bd0882de9..931763bfb6 100644--- a/docs/specs/2026-07-28-agent-session-transcript-to-tinyagents-design.md+++ b/docs/specs/2026-07-28-agent-session-transcript-to-tinyagents-design.md@@ -225,8 +225,6 @@ calls the TinyAgents session path" — it contains no turn engine. Reading itconfirms that: `impl Agent` starts at line 432, and everything above it isproduct gating. What `turn()` actually does before delegating:-- super-context gating hard-wired to `orchestrator` + `context_scout`, with an- explicit carve-out so background/cron/specialist turns don't spawn it;- agent-experience retrieval and `prepend_experience_block`;- memory recall citation collection;- integration / MCP / skill announcement + retraction notes.@@ -263,8 +261,8 @@ input, and the durable `to_provider_messages` serialization.The productive question is not *"which file moves down"* but *"which extensionpoint is missing upstream"*. `factory.rs` and `turn/core.rs` are large becausethe crate offers registries and middleware but no typed **turn-preparation**-seam — so every product enrichment (experience, citations, announcements,-super-context) is hand-written into one `turn()` body instead of registered.+seam — so every product enrichment (experience, citations, and announcements)+is hand-written into one `turn()` body instead of registered.If the crate grew a `ContextEnricher` / `TurnPreparation` pipeline —ordered, fallible, each returning prompt fragments plus metadata — OpenHuman's@@ -598,8 +596,8 @@ transcript decision.`TurnPreparation` pipeline — ordered, fallible, returning prompt fragments +metadata — so product enrichment registers instead of being hand-written into`turn()`. This is a **crate roadmap proposal, not a refactor**: write the- design, get it accepted upstream, then migrate OpenHuman's four enrichers- (super-context, agent-experience, recall citations, announcements) onto it.+ design, get it accepted upstream, then migrate OpenHuman's enrichers+ (agent experience, recall citations, and announcements) onto it.Do not start by moving code.4. **Continue adopting crate types field-by-field on `Agent`**, following the`workspace_descriptor: tinyagents::harness::workspace::WorkspaceDescriptor`@@ -671,4 +669,3 @@ Recorded so a later audit does not re-litigate:| `builder/factory.rs` re-check (§3.5.1) | stays — builds `Agent` (40+ fields of product session state), not `AgentHarness` (6 fields of execution config); one real carve-out: dispatcher selection duplicates crate `with_native_tool_calling` || `turn/core.rs` re-check (§3.5.2) | stays — the engine left in WP-3; residue is product enrichment. ~150 LOC of message-list helpers are upstreamable || The generalizable ask | the missing artifact is a crate **turn-preparation seam** (S6.3), not a relocated file — move the shape down, keep the wiring up |-diff --git a/docs/tinyagents-drift-ledger.md b/docs/tinyagents-drift-ledger.mdindex f080c49b26..1a23d18387 100644--- a/docs/tinyagents-drift-ledger.md+++ b/docs/tinyagents-drift-ledger.md@@ -114,7 +114,6 @@ crate replacement and host cutover are both verified.| `TranscriptSnapshotMiddleware` | **HOST-OWNED** | Mirrors partial crate transcripts into OpenHuman's persisted `ChatMessage` DTO so failed sub-agent runs remain ingestible. || `OpenHumanToolExposureShadowMiddleware` | **TRANSITIONAL / PARITY-GATED** | Exercises crate allowlist/contextual selection in shadow against the host registry. Delete with the host precompute only after divergence telemetry proves parity; do not flip from this audit alone. || `HandoffMiddleware` | **HOST-OWNED** | Implements integrations-agent progressive disclosure through OpenHuman's `ResultHandoffCache` and `extract_from_result` contract. |-| `SuperContextMiddleware` | **HOST-OWNED** | Runs OpenHuman first-turn context collection and injects product-formatted context. || `PromptCacheSegmentMiddleware` | **HOST SEAM** | Projects OpenHuman's stable system/tool-cache boundaries and SHA-256 identity into the crate `PromptCacheGuardMiddleware`; the actual drift guard is crate-owned. || `ToolOutputMiddleware` | **HOST-OWNED** | Applies host artifact persistence, TokenJuice compaction, byte caps, and the OpenHuman payload summarizer. || `ApprovalSecurityMiddleware` | **HOST-OWNED** | Calls the global OpenHuman approval gate, redacts args, and records product audit rows. Generic crate approval cannot replace this product/security decision. |diff --git a/gitbooks/SUMMARY.md b/gitbooks/SUMMARY.mdindex 6a07551e77..4712879673 100644--- a/gitbooks/SUMMARY.md+++ b/gitbooks/SUMMARY.md@@ -37,7 +37,6 @@- [The Orchestrator](features/orchestration.md)- [Workflows](features/workflows.md)- [Messaging Channels](features/channels.md)-- [SuperContext](features/super-context.md)- [Goals & Todos](features/goals-and-todos.md)- [Personalization & Self-Learning](features/personalization.md)- [Themes & Theme Studio](features/theming.md)diff --git a/gitbooks/developing/architecture/agent-harness.md b/gitbooks/developing/architecture/agent-harness.mdindex d33284da0d..be0e613333 100644--- a/gitbooks/developing/architecture/agent-harness.md+++ b/gitbooks/developing/architecture/agent-harness.md@@ -550,7 +550,7 @@ The remaining store cutover runs on **shadow scaffolding** (product behavior unc## Workload routes and the burst tier-`tinyagents/routes.rs` is the declarative TinyAgents `ModelRouter` for the OpenHuman tiers `chat`, `reasoning`, `agentic`, `coding`, `burst`, `summarization`, and `vision`. It owns fallback chains and capability gates; `inference::provider::factory` resolves each selected tier to its configured native `ChatModel`. The **`burst-v1`** tier serves low-context, high-fanout workers (e.g. the SuperContext scout) on a fast/cheap model.+`tinyagents/routes.rs` is the declarative TinyAgents `ModelRouter` for the OpenHuman tiers `chat`, `reasoning`, `agentic`, `coding`, `burst`, `summarization`, and `vision`. It owns fallback chains and capability gates; `inference::provider::factory` resolves each selected tier to its configured native `ChatModel`. The **`burst-v1`** tier serves low-context, high-fanout workers on a fast/cheap model.## See alsodiff --git a/gitbooks/features/goals-and-todos.md b/gitbooks/features/goals-and-todos.mdindex 25a4c0d4fa..5b3679892a 100644--- a/gitbooks/features/goals-and-todos.md+++ b/gitbooks/features/goals-and-todos.md@@ -76,4 +76,3 @@ RPC surface: `openhuman.todos_list` / `_add` / `_edit` / `_update_status` / `_se- [Subconscious Loop](subconscious.md): the background loop that powers idle continuation and task evaluation.- [Memory Tree](obsidian-wiki/memory-tree.md): what goal reflection reads from.-- [SuperContext](super-context.md): first-turn grounding that complements goal-driven work.diff --git a/gitbooks/features/model-routing/README.md b/gitbooks/features/model-routing/README.mdindex e824867daa..880ddcef7e 100644--- a/gitbooks/features/model-routing/README.md+++ b/gitbooks/features/model-routing/README.md@@ -39,7 +39,7 @@ The router wraps several pre-created providers (Anthropic, OpenAI, Google, Groq,| `hint:vision` | A vision-capable model | Screenshots, image attachments, OCR || `hint:summarize` | A model good at compression | Memory tree summary builders || `hint:code` | A code-tuned model | Native coder turns |-| `hint:burst` | A high-throughput, low-cost model | Cheap, latency-tolerant pre-flight sweeps, e.g. the SuperContext scout |+| `hint:burst` | A high-throughput, low-cost model | Cheap, latency-tolerant work for high-fanout agents |The exact mappings are configurable; the defaults ship sensible per-provider routes.diff --git a/gitbooks/features/super-context.md b/gitbooks/features/super-context.mddeleted file mode 100644index 7d9f0def48..0000000000--- a/gitbooks/features/super-context.md+++ /dev/null@@ -1,72 +0,0 @@-----description: >-- Deterministic, harness-driven context preparation on the first turn of every- new conversation - so the agent never starts cold.-icon: sparkles------# SuperContext--A fresh chat shouldn't start cold. **SuperContext** makes the agent gather relevant background _before_ it reads your first message. It happens automatically, on every new thread, without you asking and without waiting on a tool call.--Most agents start a conversation blank and only fetch context if the model decides to call a "look things up" tool. That adds a round-trip, costs tokens, and depends on the model choosing well. SuperContext flips it: the harness itself prepares context up front, deterministically, so the very first reply already knows the relevant memories, files, and connected data.-------## How it works--On the **first turn of a new thread**, if SuperContext is enabled, the harness:--1. Spawns a read-only `context_scout` sub-agent.-2. The scout sweeps your available data (the [Memory Tree](obsidian-wiki/memory-tree.md), workspace files, and connected integrations) and assembles a bounded **context bundle**.-3. The bundle is validated, then prepended to your message under a `Prepared context (super context)` header before the orchestrator model ever sees the turn.-4. The model answers your message already grounded in that context.--```text-New thread, first message- │- ▼-┌──────────────────────────────┐-│ Harness gate (deterministic) │-│ super_context_enabled? │-└───────────────┬──────────────┘- │ yes- ▼- context_scout (read-only)- sweeps memory + files + data- │- ▼- [context_bundle] … [/context_bundle]- │ validated & extracted- ▼- Prepended to your message → orchestrator-```--Because the scout is **read-only**, it can never take an action on a fresh thread. It only reads and summarizes. And because it runs in the harness rather than as an optional tool, the redundant `agent_prepare_context` tool is suppressed for that turn, so the agent doesn't do the work twice.--The scout runs on the **`burst` tier** (`hint = "burst"` → `burst-v1` on the managed backend), a cheap, high-throughput, non-reasoning model. The sweep is a latency-tolerant pre-flight pass, so raw throughput on a fast model is a better fit than the pricier agentic/reasoning tiers. See [Automatic Model Routing](model-routing/README.md).-------## Safety and robustness--The scout returns its findings wrapped in `[context_bundle] … [/context_bundle]` tags. Only the bracketed envelope is ever injected. Any surrounding prose the model emits ("sure, here's what I found…") is stripped out. If the bundle is missing, malformed (unterminated, reversed, or duplicated tags), or empty, the turn proceeds **gracefully without augmentation** rather than injecting garbage. A cold start is always preferable to a broken one.-------## Turning it on or off--SuperContext is **on by default**.--- **From the composer.** A **Super Context** toggle appears below the chat input on a fresh thread. The flag is read when a thread is constructed, so toggling it affects **newly started threads**, not the one you're already in.-- **Config.** `context.super_context_enabled` (boolean, default `true`).-- **Environment.** `OPENHUMAN_SUPER_CONTEXT` (or `OPENHUMAN_CONTEXT_SUPER_CONTEXT_ENABLED`).-- **RPC.** `get_super_context_enabled()` reads the flag; `set_super_context_enabled(value)` sets and persists it.-------## See also--- [Memory Tree](obsidian-wiki/memory-tree.md): the primary source the scout reads from.-- [Auto-fetch from Integrations](obsidian-wiki/auto-fetch.md): keeps that source fresh between conversations.-- [Subconscious Loop](subconscious.md): the other side of "keeps thinking when you've stopped typing."diff --git a/scripts/debug/agent-prepare-context-audit.mjs b/scripts/debug/agent-prepare-context-audit.mjsindex 2bd5fc18b4..0d5b6a83c8 100644--- a/scripts/debug/agent-prepare-context-audit.mjs+++ b/scripts/debug/agent-prepare-context-audit.mjs@@ -656,7 +656,7 @@ function printCase(opts, caseInfo, scout, root, ms) {" ⚠ no context_scout transcript found — prepared context did not run.",);console.log(- " (Is the core built from this branch? Is super context enabled?)",+ " (Is the core built from this branch?)",);return;}diff --git a/src/openhuman/agent/context/manager.rs b/src/openhuman/agent/context/manager.rsindex 1f454f8878..17cd59e7bd 100644--- a/src/openhuman/agent/context/manager.rs+++ b/src/openhuman/agent/context/manager.rs@@ -81,11 +81,6 @@ pub struct ContextManager {/// middleware; `0` when microcompact is disabled. Read by the tinyagents/// turn to configure `MicrocompactMiddleware`.microcompact_keep_recent: usize,- /// When `true`, the harness runs a mandatory first-turn context- /// collection pass before the orchestrator LLM runs. Read once at- /// session construction so it only affects newly started threads.- /// See [`ContextConfig::super_context_enabled`].- super_context_enabled: bool,/// When `true`, the tinyagents turn installs the LLM summarization step/// (`ContextCompressionMiddleware`). Gated by both `[context].enabled` and/// `[context].autocompact_enabled` so a diagnostic/test opt-out doesn't spend@@ -121,7 +116,6 @@ impl ContextManager {} else {0},- super_context_enabled: config.super_context_enabled,// Summarization is off when the whole context system is disabled OR// autocompaction specifically is turned off.autocompact_enabled: config.enabled && config.autocompact_enabled,@@ -154,14 +148,6 @@ impl ContextManager {self.compaction_enabled}- /// Whether "super context" is enabled — i.e. whether the harness- /// should run a mandatory read-only context-collection pass on the- /// first turn of a new thread before the orchestrator LLM runs.- /// Read by `Agent::turn`. See [`ContextConfig::super_context_enabled`].- pub fn super_context_enabled(&self) -> bool {- self.super_context_enabled- }-/// Whether the tinyagents turn should install the LLM summarization step./// `false` when `[context].enabled = false` or `autocompact_enabled = false`/// — the diagnostic/test opt-outs the legacy reducer honored before@@ -171,14 +157,6 @@ impl ContextManager {self.autocompact_enabled}- /// Force-disable the first-turn super-context pass for this session,- /// regardless of the config default. Used by non-interactive orchestrator- /// builds (e.g. read-only model-council jurors) where a scout pass would add- /// an unexpected LLM call and perturb deterministic call sequences.- pub fn set_super_context_enabled(&mut self, enabled: bool) {- self.super_context_enabled = enabled;- }-// ─── Budget tracking ──────────────────────────────────────────/// Feed the latest provider [`UsageInfo`] into utilisation stats and thediff --git a/src/openhuman/agent/context/manager_tests.rs b/src/openhuman/agent/context/manager_tests.rsindex 3becce0d29..efe9087161 100644--- a/src/openhuman/agent/context/manager_tests.rs+++ b/src/openhuman/agent/context/manager_tests.rs@@ -79,19 +79,6 @@ fn autocompact_enabled_requires_both_master_and_autocompact_flags() {assert!(!manager_with_config(&no_autocompact).autocompact_enabled());}-#[test]-fn super_context_enabled_reflects_config() {- // Default config: off (it's an expensive opt-in pass).- let off = default_manager();- assert!(!off.super_context_enabled());-- // Explicitly enabled in config → getter reports on.- let mut config = ContextConfig::default();- config.super_context_enabled = true;- let on = manager_with_config(&config);- assert!(on.super_context_enabled());-}-#[test]fn session_memory_lifecycle_changes_should_extract_state() {let mut manager = default_manager();diff --git a/src/openhuman/agent/cost.rs b/src/openhuman/agent/cost.rsindex bbf0e85700..5f67ecedc0 100644--- a/src/openhuman/agent/cost.rs+++ b/src/openhuman/agent/cost.rs@@ -102,8 +102,8 @@ const PRICING_TABLE: &[ModelPricing] = &[output_per_mtok_usd: 0.87,},// Burst tier — high-throughput, low-cost model; flat rate both directions,- // no prompt cache (so cached rate mirrors the input rate). Used by the- // SuperContext scout.+ // no prompt cache (so cached rate mirrors the input rate). Used by fast,+ // high-fanout workers.ModelPricing {model: "burst-v1",input_per_mtok_usd: 0.208,@@ -272,9 +272,8 @@ mod tests {#[test]fn lookup_pricing_has_a_burst_row() {- // The burst tier (SuperContext scout) must price from its own row —- // NOT via the $3/$15 fallback, which would inflate first-turn scout cost- // and could trip budget gates.+ // The burst tier must price from its own row, not via the $3/$15+ // fallback, which would inflate worker cost and could trip budget gates.let p = lookup_pricing("burst-v1");assert_eq!(p.model, "burst-v1");assert_eq!(p.input_per_mtok_usd, 0.208);diff --git a/src/openhuman/agent/harness/fork_context.rs b/src/openhuman/agent/harness/fork_context.rsindex 5d8899b6a4..212a25027a 100644--- a/src/openhuman/agent/harness/fork_context.rs+++ b/src/openhuman/agent/harness/fork_context.rs@@ -166,12 +166,7 @@ tokio::task_local! {/// Tools such as `agent_prepare_context` use this to avoid spawning a/// second context scout after the harness has already prepared context.///- /// Behind an `Arc<Mutex<…>>` (not a plain `Arc<Vec<…>>`) so a source can be- /// **appended live** mid-turn — the graph's `SuperContextMiddleware` runs its- /// scout during the harness run (after the initial list is scoped) and- /// registers its source via [`push_agent_context_prepared_source`] so a later- /// `agent_prepare_context` call in the same turn still self-suppresses.- pub static AGENT_CONTEXT_PREPARED_SOURCES: Arc<std::sync::Mutex<Vec<AgentContextPreparedSource>>>;+ pub static AGENT_CONTEXT_PREPARED_SOURCES: Arc<Vec<AgentContextPreparedSource>>;}/// Returns a clone of the current parent execution context, if one is set.@@ -197,27 +192,12 @@ where/// the current parent turn (a snapshot of the live list).pub fn current_agent_context_prepared_sources() -> Vec<AgentContextPreparedSource> {AGENT_CONTEXT_PREPARED_SOURCES- .try_with(|sources| sources.lock().map(|s| s.clone()).unwrap_or_default())+ .try_with(|sources| sources.as_ref().clone()).unwrap_or_default()}-/// Append a source to the current turn's prepared-context list, live.-///-/// Used by the graph's `SuperContextMiddleware`, which prepares context *during*-/// the harness run (after [`with_agent_context_prepared_sources`] scoped the-/// initial list) so a later `agent_prepare_context` tool call in the same turn-/// observes it and self-suppresses. No-op outside an agent turn.-pub fn push_agent_context_prepared_source(source: AgentContextPreparedSource) {- let _ = AGENT_CONTEXT_PREPARED_SOURCES.try_with(|sources| {- if let Ok(mut guard) = sources.lock() {- guard.push(source);- }- });-}-/// Run `future` with the current turn's already-prepared context sources-/// installed. The list is appendable mid-turn via-/// [`push_agent_context_prepared_source`].+/// installed.pub async fn with_agent_context_prepared_sources<F, R>(sources: Vec<AgentContextPreparedSource>,future: F,@@ -229,6 +209,6 @@ where// rather than the whole nested turn generator — see the measurements on// `with_turn_collector` in `turn_subagent_usage.rs`.AGENT_CONTEXT_PREPARED_SOURCES- .scope(Arc::new(std::sync::Mutex::new(sources)), Box::pin(future))+ .scope(Arc::new(sources), Box::pin(future)).await}diff --git a/src/openhuman/agent/harness/mod.rs b/src/openhuman/agent/harness/mod.rsindex a8e719cb56..dd57b57502 100644--- a/src/openhuman/agent/harness/mod.rs+++ b/src/openhuman/agent/harness/mod.rs@@ -56,9 +56,8 @@ pub use definition::{SandboxMode, ToolScope, TriggerMemoryAgent,};pub use fork_context::{- current_agent_context_prepared_sources, current_parent, push_agent_context_prepared_source,- with_agent_context_prepared_sources, with_parent_context, AgentContextPreparedSource,- ParentExecutionContext,+ current_agent_context_prepared_sources, current_parent, with_agent_context_prepared_sources,+ with_parent_context, AgentContextPreparedSource, ParentExecutionContext,};pub use sandbox_context::{current_sandbox_mode, with_current_sandbox_mode};pub(crate) use spawn_depth_context::{current_spawn_depth, with_spawn_depth, MAX_SPAWN_DEPTH};diff --git a/src/openhuman/agent/harness/session/turn/core.rs b/src/openhuman/agent/harness/session/turn/core.rsindex 9a439270d2..e6d0083873 100644--- a/src/openhuman/agent/harness/session/turn/core.rs+++ b/src/openhuman/agent/harness/session/turn/core.rs@@ -22,278 +22,6 @@ use crate::openhuman::util::truncate_with_ellipsis;use anyhow::Result;use std::hash::{Hash, Hasher};-/// Decide whether the harness-driven "super context" collection pass should-/// run this turn.-///-/// It runs only on the first turn of a **genuinely new** thread driven by the-/// **user-facing orchestrator**:-/// - `is_orchestrator` — the turn belongs to the `orchestrator` agent (the-/// interactive chat path surfaced by the composer toggle). `Agent::turn` is-/// shared with `run_single()` background/automated flows (goals enrichment,-/// cron/task agents, specialist sub-agents); without this gate those first-/// turns would spawn `context_scout` and prepend a prepared-context block,-/// adding unexpected LLM/tool work and changing automated outputs; AND-/// - `first_turn` — the agent's `history` is empty at turn start; AND-/// - `!has_prior_conversation` — the seeded `cached_transcript_messages`-/// prefix contains no prior **assistant** reply. A thread resumed cold-/// (web-chat task rebuilt for an existing conversation, or a transcript-/// loaded from disk) also has an empty `history`, so the seeded prefix is-/// what distinguishes a *new* thread from a *resumed* one. We key on a prior-/// assistant message rather than "any cached prefix" because an-/// attachment-first new thread can seed a single just-persisted *user* row-/// (the expanded `[IMAGE:…]`/`[FILE:…]` send payload doesn't exact-match the-/// persisted `content`, so `seed_resume_from_messages` can't drop it) — that-/// is still a brand-new conversation and should get super context; AND-/// - `enabled` — the `context.super_context_enabled` config flag is on.-/// - `user_message` — the request is not an obvious context-free greeting or-/// simple local action. Super context is useful when prior memory, profile,-/// integrations, or web facts can change the answer; it is counterproductive-/// for "hi"/"ciao" and straightforward local filesystem commands, where an-/// auto-run scout only adds tool noise before the orchestrator sees intent.-/// - `native_tool_calling` — provider-aware guardrail for #4361. Local-/// providers (Ollama / LM Studio / MLX / llama.cpp) force-/// `native_tool_calling=false`, so the harness serializes the **entire tool +-/// integration catalog as prose** into the system prompt (the-/// `PFormatToolDispatcher` path, `should_send_tool_specs()==false`). A weak-/// local model then over-selects from that text menu and mis-routes a-/// greeting into `composio_list_connections` or a local folder op into the-/// calendar path (the reported v0.58 regression). For these providers we only-/// auto-run the scout when the user *explicitly* asks for prior context or a-/// connected integration; otherwise the extra scout just enlarges the surface-/// the model can trip over. Native-tool-calling providers keep the broader-/// behavior — structured tool specs make spurious tool-routing far rarer.-///-/// Pulled out as a pure function so the gate (in particular the resume and-/// orchestrator guards) is unit-testable without a full agent turn harness.-fn super_context_skip_reason(- user_message: &str,- native_tool_calling: bool,-) -> Option<&'static str> {- let normalized = user_message- .split_whitespace()- .collect::<Vec<_>>()- .join(" ")- .trim_matches(|c: char| c.is_ascii_punctuation())- .to_ascii_lowercase();-- if normalized.is_empty() {- return Some("empty_message");- }-- if matches!(- normalized.as_str(),- "hi" | "hello"- | "hey"- | "yo"- | "ciao"- | "hola"- | "bonjour"- | "thanks"- | "thank you"- | "ok"- | "okay"- | "good morning"- | "good afternoon"- | "good evening"- | "good night"- ) {- return Some("context_free_greeting");- }-- let local_action_candidate = strip_local_folder_action_lead_in(&normalized);- let starts_like_local_folder_action = [- // English- "create a folder ",- "create folder ",- "make a folder ",- "make folder ",- "create a directory ",- "create directory ",- "make a directory ",- "make directory ",- "mkdir ",- // Italian (#4361 repro: "Crea una cartella sul Desktop e chiamala- // PROVA"). Gemma-class local models mis-route the Italian phrasing into- // Calendar/Connections exactly as they do the English one, so the same- // folder-op suppression must be language-aware for the reported locale.- "crea una cartella ",- "crea la cartella ",- "crea cartella ",- "creare una cartella ",- "creare cartella ",- "crea una directory ",- "crea directory ",- "fai una cartella ",- "fammi una cartella ",- "nuova cartella ",- ]- .iter()- .any(|prefix| local_action_candidate.starts_with(prefix));-- if starts_like_local_folder_action {- let context_hints = [- "discussed",- "mentioned",- "previous",- "earlier",- "last time",- "email",- "gmail",- "calendar",- "slack",- "notion",- "github",- "drive",- // Italian cues, mirroring the Italian folder-op detection above so a- // folder request that *does* reference prior context or an- // integration still earns a scout (#4361).- "discusso",- "parlato",- "calendario",- "precedente",- ];- if !context_hints.iter().any(|hint| normalized.contains(hint)) {- return Some("simple_local_filesystem_action");- }- }-- // Provider-aware guardrail (#4361). On providers without native tool calling- // the whole tool/integration catalog is injected as prose, so an unrequested- // first-turn scout is exactly what tips a small local model into spurious- // integration tool-calls. Suppress super context for these providers unless- // the prompt explicitly references prior context or a connected integration- // (e.g. "show my connections", "schedule a meeting tomorrow at 3"), where the- // scout genuinely helps. Native-tool-calling providers are unaffected.- if !native_tool_calling && !mentions_context_or_integration(&normalized) {- return Some("non_native_provider_no_explicit_intent");- }-- None-}--/// True when a first-turn prompt explicitly references prior conversation-/// context or a connected integration — the cases where a context scout earns-/// its cost. Used to keep super context ON for these prompts even on local-/// (non-native-tool-calling) providers, where it is otherwise suppressed to-/// avoid tipping weak models into spurious integration tool-calls (#4361).-///-/// `normalized` must already be whitespace-collapsed, punctuation-trimmed, and-/// lowercased by `super_context_skip_reason`.-fn mentions_context_or_integration(normalized: &str) -> bool {- const INTENT_HINTS: [&str; 37] = [- // prior-conversation / memory cues- "discussed",- "mentioned",- "previous",- "earlier",- "last time",- "remember",- "we talked",- "you said",- "my profile",- // connection / integration cues- "connection",- "connections",- "integration",- "integrations",- "connected",- // calendar / scheduling- "calendar",- "schedule",- "meeting",- "reminder",- "remind me",- "event",- "email",- "gmail",- "inbox",- // common connected apps- "slack",- "notion",- "github",- "drive",- "linkedin",- "whatsapp",- "telegram",- // Italian cues (#4361) — keep super context ON for an explicit- // context/integration ask in the reported locale. "calendario"/"email"/- // "gmail" already match via substring, so only the non-overlapping stems- // are listed here. Additive only: these can never *cause* a skip.- "connessione", // connection- "connessioni", // connections- "integrazione", // integration- "riunione", // meeting- "promemoria", // reminder- "ricordami", // remind me- "agenda", // agenda / calendar- ];- INTENT_HINTS.iter().any(|hint| normalized.contains(hint))-}--fn strip_local_folder_action_lead_in(message: &str) -> &str {- let mut candidate = message;- for _ in 0..3 {- let trimmed = candidate.trim_start();- let next = [- // English- "can you please ",- "could you please ",- "would you please ",- "can you ",- "could you ",- "would you ",- "please ",- "hey ",- "hello ",- "hi ",- // Italian (#4361)- "puoi per favore ",- "potresti per favore ",- "puoi per piacere ",- "puoi ",- "potresti ",- "per favore ",- "per piacere ",- "ciao ",- "ehi ",- ]- .iter()- .find_map(|lead_in| trimmed.strip_prefix(lead_in));-- match next {- Some(rest) => candidate = rest,- None => return trimmed,- }- }- candidate.trim_start()-}--fn super_context_base_gate(- is_orchestrator: bool,- first_turn: bool,- has_prior_conversation: bool,- enabled: bool,-) -> bool {- is_orchestrator && first_turn && !has_prior_conversation && enabled-}--fn should_run_super_context(- is_orchestrator: bool,- first_turn: bool,- has_prior_conversation: bool,- enabled: bool,- native_tool_calling: bool,- user_message: &str,-) -> bool {- super_context_base_gate(is_orchestrator, first_turn, has_prior_conversation, enabled)- && super_context_skip_reason(user_message, native_tool_calling).is_none()-}--// `parse_context_bundle_has_enough_context` moved to-// `tinyagents::middleware` alongside the `SuperContextMiddleware` graph node-// that now owns the first-turn context-collection pass (#4249).-/// Flatten the assistant tool calls a turn produced into [`ToolCallRecord`]s for/// post-turn hooks + the deterministic cap checkpoint. Per-call success +/// sanitized output summary are recovered from the turn's captured@@ -451,10 +179,6 @@ impl Agent {/// 6. **Background Tasks**: Triggers episodic memory indexing and facts/// extraction asynchronously.pub async fn turn(&mut self, user_message: &str) -> Result<String> {- // Capture before any system-prompt push mutates `history`: this is the- // signal that gates first-turn-only work (system prompt build, and the- // "super context" harness-driven context-collection pass below).- let first_turn = self.history.is_empty();self.emit_progress(AgentProgress::TurnStarted).await;log::info!("[agent] turn started — awaiting user message processing");log::info!(@@ -942,78 +666,6 @@ impl Agent {});}- // ── "Super context": harness-driven first-turn context collection ──- // When enabled (config `context.super_context_enabled`, surfaced as the- // composer toggle), run the read-only `context_scout` BEFORE the- // orchestrator LLM gets the turn, and fold its bounded- // `[context_bundle]` into the user message. This is the harness driving- // the collection deterministically — unlike the `agent_prepare_context`- // tool, which the model chooses to call. If this path succeeds, the- // turn prompt and task-local marker tell `agent_prepare_context` not- // to run another generic scout pass in the same turn.- //- // Gate on the **first turn of a genuinely new thread**: `first_turn`- // (empty `history`) is necessary but NOT sufficient, because a thread- // resumed cold (e.g. a web-chat task rebuilt for an existing- // conversation after an app restart) seeds prior messages into- // `cached_transcript_messages` via `seed_resume_from_messages` /- // `try_load_session_transcript` WITHOUT populating `history`. Without- // the `cached_transcript_messages.is_none()` guard, super context would- // re-fire on every cold-started existing conversation, surprising the- // user with extra scout/tool calls and a stray prepared-context block.- //- // Runs inside the parent-context scope because `run_context_scout`- // reads the parent's visible tool catalogue and runs the scout against- // the parent's provider via the PARENT_CONTEXT task-local. Best-effort:- // any failure (scout error, no bundle) leaves the turn to proceed with- // the un-augmented message rather than blocking the user.- // A genuinely new thread has no prior assistant reply in its seeded- // transcript prefix; a cold-resumed thread does. (An attachment-first- // new thread may seed a lone user row — see `should_run_super_context`.)- let has_prior_conversation = self- .cached_transcript_messages- .as_ref()- .is_some_and(|msgs| msgs.iter().any(|m| m.role == "assistant"));- // `should_send_tool_specs()` is true only when the provider receives a- // structured tool schema (native tool calling). For local providers it- // is false — the whole tool/integration catalog is prose in the prompt,- // which is the surface a weak model mis-routes on (#4361).- let native_tool_calling = self.tool_dispatcher.should_send_tool_specs();- let skip_reason_for_logging = super_context_skip_reason(user_message, native_tool_calling);- let base_gate = super_context_base_gate(- self.agent_definition_id == "orchestrator",- first_turn,- has_prior_conversation,- self.context.super_context_enabled(),- );- if base_gate {- if let Some(reason) = skip_reason_for_logging {- log::info!(- "[agent_loop] super_context skipped for context-free first turn reason={reason} native_tool_calling={native_tool_calling}"- );- }- }- // The scout no longer runs here imperatively: super context is now a- // before_model **graph node** (`SuperContextMiddleware`, installed via- // `context_mw.super_context` below). It runs the read-only `context_scout`- // on the first model call, folds the `[context_bundle]` into the user- // message, and registers its prepared-context source live so a later- // `agent_prepare_context` call self-suppresses. We only decide *whether*- // to enable the node here (the gate is unchanged).- let run_super_context = should_run_super_context(- self.agent_definition_id == "orchestrator",- first_turn,- has_prior_conversation,- self.context.super_context_enabled(),- native_tool_calling,- user_message,- );- if run_super_context {- log::info!(- "[agent_loop] super_context enabled — installing the SuperContextMiddleware graph node (new thread, first turn)"- );- }-let enriched = if agent_context_prepared_sources.is_empty() {enriched} else {@@ -1071,7 +723,6 @@ impl Agent {&effective_model,temperature,max_iterations,- run_super_context,artifact_store,)).await@@ -1190,10 +841,6 @@ impl Agent {effective_model: &str,temperature: f64,max_iterations: usize,- // Whether the super-context graph node should run this turn (gate decided- // by `should_run_super_context` in `turn()`, before the user row was- // pushed to history — so it can't be recomputed here).- run_super_context: bool,artifact_store: Option<crate::openhuman::agent::harness::tool_result_artifacts::ToolResultArtifactStore,>,@@ -1290,14 +937,6 @@ impl Agent {// the summarization middleware is not installed (no summarizer tokens,// no history rewrite).autocompact_enabled: self.context.autocompact_enabled(),- // Super context (first-turn read-only context collection) as a graph- // node — enabled only when its gate passed above. The node runs the- // scout on the first model call and folds the bundle into the message.- super_context: run_super_context.then(|| {- crate::openhuman::agent::tinyagents::SuperContextConfig {- user_message: user_message.to_string(),- }- }),// Progressive-disclosure handoff is a sub-agent (integrations_agent)// concern; the top-level chat turn never sets it.handoff: None,@@ -1842,393 +1481,3 @@ impl Agent {}}}--#[cfg(test)]-mod super_context_gate_tests {- use super::{- mentions_context_or_integration, render_agent_context_status_note,- should_run_super_context, super_context_skip_reason,- };- use crate::openhuman::agent::harness::AgentContextPreparedSource;-- // Provider-aware convenience: `native_tool_calling` (5th arg) is `true` for- // these tests unless a case is specifically exercising the local- // (non-native-tool-calling) provider path (#4361). Native providers keep the- // original #4361/#4403 gate semantics.- const NATIVE: bool = true;- const LOCAL: bool = false;-- #[test]- fn runs_only_on_first_turn_of_a_new_orchestrator_thread_when_enabled() {- // Orchestrator, new thread, first turn, flag on → run.- assert!(should_run_super_context(- true,- true,- false,- true,- NATIVE,- "find the project we discussed yesterday"- ));- }-- #[test]- fn skips_when_flag_disabled() {- assert!(!should_run_super_context(- true,- true,- false,- false,- NATIVE,- "find the project we discussed yesterday"- ));- }-- #[test]- fn skips_on_later_turns() {- // history non-empty → not the first turn.- assert!(!should_run_super_context(- true,- false,- false,- true,- NATIVE,- "find the project we discussed yesterday"- ));- }-- #[test]- fn skips_on_cold_resumed_thread_even_on_first_turn() {- // Regression: a thread resumed cold has an empty `history` (so- // `first_turn` is true) but a seeded prefix that includes a prior- // assistant reply. Super context must NOT re-fire on these existing- // conversations.- assert!(!should_run_super_context(- true,- true,- true,- true,- NATIVE,- "find the project we discussed yesterday"- ));- }-- #[test]- fn runs_for_attachment_first_new_thread_with_lone_seeded_user_row() {- // Regression: an attachment-first new thread can seed a single just-- // persisted *user* row (no assistant reply), so `has_prior_conversation`- // is false. That is still a brand-new conversation — super context- // should run.- assert!(should_run_super_context(- true,- true,- false,- true,- NATIVE,- "[IMAGE: screenshot.png]\nwhat is this?"- ));- }-- #[test]- fn skips_for_non_orchestrator_agents() {- // Regression: `Agent::turn` is shared with background/automated- // `run_single()` flows (goals enrichment, cron/task agents,- // specialist sub-agents). Even on a fresh first turn with the flag on,- // super context must only run for the user-facing orchestrator.- assert!(!should_run_super_context(- false,- true,- false,- true,- NATIVE,- "find the project we discussed yesterday"- ));- }-- #[test]- fn skips_context_free_greeting() {- // #4361 case: a bare greeting must never trigger a scout — on any- // provider. "Ciao" is the exact prompt from the issue report.- for native in [NATIVE, LOCAL] {- assert!(!should_run_super_context(- true, true, false, true, native, "Ciao"- ));- assert!(!should_run_super_context(- true, true, false, true, native, "hello!"- ));- assert_eq!(- super_context_skip_reason("Ciao", native),- Some("context_free_greeting")- );- }- }-- #[test]- fn skips_simple_local_folder_creation() {- // #4361 case: "create a folder on Desktop called test" must not browse- // Calendar/Connections — on any provider.- for native in [NATIVE, LOCAL] {- assert!(- !should_run_super_context(- true,- true,- false,- true,- native,- "Create a folder on Desktop called test"- ),- "expected skip for local folder creation (native={native})"- );- assert!(!should_run_super_context(- true,- true,- false,- true,- native,- "Create a folder on Desktop named PROVA"- ));- }- }-- #[test]- fn skips_simple_local_folder_creation_with_polite_lead_in() {- for message in [- "Please create a folder on Desktop named PROVA",- "Can you make a directory named invoices",- "Hey please create folder screenshots",- ] {- assert!(- !should_run_super_context(true, true, false, true, NATIVE, message),- "expected super context to skip for {message:?}"- );- }- }-- #[test]- fn keeps_super_context_for_local_action_with_context_hint() {- assert!(should_run_super_context(- true,- true,- false,- true,- NATIVE,- "Create a folder for the project we discussed yesterday"- ));- assert!(should_run_super_context(- true,- true,- false,- true,- NATIVE,- "Please create a folder for the project we discussed yesterday"- ));- }-- #[test]- fn skips_italian_local_folder_creation() {- // #4361 exact repro: the Italian folder op must be recognized as a- // simple local filesystem action and NOT trigger a Calendar/Connections- // scout — on any provider. This is the string from the issue report.- for native in [NATIVE, LOCAL] {- assert!(- !should_run_super_context(- true,- true,- false,- true,- native,- "Crea una cartella sul Desktop e chiamala PROVA"- ),- "expected skip for Italian folder creation (native={native})"- );- // The reason must be the language-agnostic filesystem classification,- // not the provider fallback — so it holds even for native providers.- assert_eq!(- super_context_skip_reason("Crea una cartella sul Desktop e chiamala PROVA", NATIVE),- Some("simple_local_filesystem_action")- );- }- }-- #[test]- fn skips_italian_local_folder_creation_variants_and_polite_lead_ins() {- for message in [- "Crea una cartella chiamata PROVA",- "Crea cartella screenshots",- "Creare una cartella sul desktop",- "Fai una cartella per le fatture",- "Nuova cartella documenti",- "Puoi creare una cartella chiamata PROVA",- "Per favore crea una cartella sul Desktop",- "Ciao puoi creare una cartella chiamata test",- ] {- assert_eq!(- super_context_skip_reason(message, NATIVE),- Some("simple_local_filesystem_action"),- "expected filesystem skip for {message:?}"- );- }- }-- #[test]- fn keeps_super_context_for_italian_local_action_with_context_hint() {- // An Italian folder op that references prior context / an integration- // should still earn a scout — the filesystem shortcut must not swallow- // it. Verified on a native provider (local providers add the separate- // provider gate, exercised elsewhere).- assert!(should_run_super_context(- true,- true,- false,- true,- NATIVE,- "Crea una cartella per il progetto di cui abbiamo parlato"- ));- assert_eq!(- super_context_skip_reason("Crea una cartella per la riunione in calendario", NATIVE),- None- );- }-- // ── Provider-aware guardrail (#4361) ────────────────────────────────────- // On providers without native tool calling (Ollama / LM Studio / MLX /- // llama.cpp) the whole tool + integration catalog is injected as prose, so- // an unrequested first-turn scout is what tips weak models into spurious- // integration tool-calls. For these providers super context runs ONLY when- // the prompt explicitly references prior context or a connected integration.-- #[test]- fn local_provider_skips_super_context_for_generic_prompt() {- // A generic first-turn ask with no context/integration cue: a native- // provider still scouts (broad behavior preserved), but a local provider- // suppresses it to keep the prose tool menu from mis-routing.- let msg = "write me a short poem about the sea";- assert!(should_run_super_context(- true, true, false, true, NATIVE, msg- ));- assert!(!should_run_super_context(- true, true, false, true, LOCAL, msg- ));- assert_eq!(- super_context_skip_reason(msg, LOCAL),- Some("non_native_provider_no_explicit_intent")- );- assert_eq!(super_context_skip_reason(msg, NATIVE), None);- }-- #[test]- fn keeps_super_context_for_explicit_connection_intent() {- // #4361 case: "show my connections" is an explicit integration ask →- // super context is allowed on BOTH provider kinds.- let msg = "show my connections";- assert!(should_run_super_context(- true, true, false, true, NATIVE, msg- ));- assert!(should_run_super_context(- true, true, false, true, LOCAL, msg- ));- assert_eq!(super_context_skip_reason(msg, LOCAL), None);- }-- #[test]- fn keeps_super_context_for_explicit_scheduling_intent() {- // #4361 case: "schedule a meeting tomorrow at 3" is an explicit- // integration ask → super context is allowed when integrations are- // enabled (the `enabled` flag), on BOTH provider kinds.- let msg = "schedule a meeting tomorrow at 3";- assert!(should_run_super_context(- true, true, false, true, NATIVE, msg- ));- assert!(should_run_super_context(- true, true, false, true, LOCAL, msg- ));- // Still gated by the config flag: disabled ⇒ no scout regardless.- assert!(!should_run_super_context(- true, true, false, false, LOCAL, msg- ));- }-- #[test]- fn local_provider_keeps_super_context_for_explicit_italian_integration_intent() {- // Fix B, locale-aware: an explicit Italian integration ask must keep the- // scout ON even on a local (non-native-tool-calling) provider — the- // provider gate only suppresses *context-free* first turns. A generic- // Italian prompt with no cue is still suppressed on local providers.- for msg in [- "mostra le mie connessioni", // show my connections- "fissa una riunione domani", // schedule a meeting tomorrow- "aggiungilo al mio calendario", // add it to my calendar- "controlla la mia email", // check my email- ] {- assert!(- should_run_super_context(true, true, false, true, LOCAL, msg),- "expected local provider to keep super context for {msg:?}"- );- assert_eq!(super_context_skip_reason(msg, LOCAL), None);- }-- // A generic Italian ask (a poem) carries no integration cue → the local- // provider still suppresses it, while a native provider scouts.- let generic = "scrivimi una breve poesia sul mare";- assert!(should_run_super_context(- true, true, false, true, NATIVE, generic- ));- assert_eq!(- super_context_skip_reason(generic, LOCAL),- Some("non_native_provider_no_explicit_intent")- );- }-- #[test]- fn mentions_context_or_integration_matches_expected_cues() {- for hit in [- "show my connections",- "schedule a meeting tomorrow at 3",- "check my gmail inbox",- "what did we discuss earlier",- "add it to my calendar",- "post this to slack",- // Italian cues (#4361)- "mostra le mie connessioni",- "fissa una riunione domani",- "aggiungilo al mio calendario",- "impostami un promemoria",- "controlla la mia email",- ] {- assert!(- mentions_context_or_integration(hit),- "expected context/integration cue in {hit:?}"- );- }- for miss in [- "write me a short poem about the sea",- "what is 2 plus 2",- "translate hola to english",- "scrivimi una breve poesia sul mare",- ] {- assert!(- !mentions_context_or_integration(miss),- "did not expect a cue in {miss:?}"- );- }- }-- #[test]- fn context_status_note_tells_model_not_to_prepare_context_again() {- let note = render_agent_context_status_note(&[- AgentContextPreparedSource {- source: "memory agent context retrieval".to_string(),- has_enough_context: None,- },- AgentContextPreparedSource {- source: "super context preparation".to_string(),- has_enough_context: Some(true),- },- ]);-- assert!(note.contains("## Agent context status"));- assert!(note.contains("already run once"));- assert!(note.contains("memory agent context retrieval"));- assert!(note.contains("super context preparation"));- assert!(note.contains("Do not call `agent_prepare_context` again"));- }-}diff --git a/src/openhuman/agent/orchestration/tools/agent_prepare_context.rs b/src/openhuman/agent/orchestration/tools/agent_prepare_context.rsindex 12acb02c47..0c9832d65c 100644--- a/src/openhuman/agent/orchestration/tools/agent_prepare_context.rs+++ b/src/openhuman/agent/orchestration/tools/agent_prepare_context.rs@@ -37,22 +37,17 @@ const SCOUT_AGENT_ID: &str = "context_scout";/// substring (tags included). Returns `None` when no usable envelope is/// present.///-/// The harness prepends every non-error `run_context_scout` result to turn 1 as-/// "Prepared context", and the `context_scout` contract is "emit the single-/// envelope and nothing outside it". But the scout runs on a fast chat-tier-/// model that regularly wraps the envelope in a preamble (`Sure, here's what I-/// found:\n[context_bundle]…`) or a closing line (`…[/context_bundle]\nHope-/// that helps!`). Requiring the *whole* trimmed output to be the envelope made-/// any such wrap fail validation, so the harness silently dropped an-/// otherwise-good bundle and injected nothing — the "scout runs, bundle-/// missing" failure.+/// The `context_scout` contract is "emit the single envelope and nothing+/// outside it", but the fast model may wrap the envelope in a preamble (`Sure,+/// here's what I found:\n[context_bundle]…`) or a closing line+/// (`…[/context_bundle]\nHope that helps!`). Requiring the *whole* trimmed+/// output to be the envelope would discard an otherwise-good bundle.////// Pulling the envelope substring out of the surrounding text keeps the safety-/// property intact: we still never inject the model's free-form prose, only the-/// bracketed envelope itself. We still reject genuinely unusable output —+/// property intact: callers receive only the bracketed envelope, never the+/// model's free-form prose. We still reject genuinely unusable output —/// absent, unterminated/reversed, or duplicated (where we can't tell which-/// envelope is authoritative) — by returning `None`, so the caller falls back-/// to the un-augmented message.+/// envelope is authoritative) — by returning `None`.fn extract_context_bundle(output: &str) -> Option<String> {const OPEN: &str = "[context_bundle]";const CLOSE: &str = "[/context_bundle]";@@ -108,14 +103,8 @@ fn already_prepared_context_bundle(sources: &[AgentContextPreparedSource]) -> St/// Run the `context_scout` sub-agent inline (blocking) for `question` and/// return its bounded `[context_bundle]` envelope as a [`ToolResult`].///-/// This is the shared engine behind two callers:-///-/// 1. The [`AgentPrepareContextTool`] — invoked *autonomously by the LLM*-/// when it decides to scout context mid-turn.-/// 2. The agent harness itself — when "super context" is enabled it calls-/// this directly on the first turn of a new thread (see-/// [`crate::openhuman::config::ContextConfig::super_context_enabled`]),-/// so the collection happens regardless of the model's decision.+/// This is the engine behind [`AgentPrepareContextTool`], invoked autonomously+/// by the LLM when it decides to scout context mid-turn.////// Must be called from within an active agent turn (i.e. with the/// [`crate::openhuman::agent::harness::fork_context::PARENT_CONTEXT`]@@ -416,8 +405,7 @@ async fn run_context_scout_with_catalog_and_workspace(// authoritative (it sets/replaces via `goal_set`); the// context-gathering path just seeds a goal on the first scout of// a fresh chat so the harness has something to steer toward.- // Runs for both entry points (LLM-invoked tool + harness- // super-context first turn). Best-effort — never fails the call.+ // Best-effort — never fails the call.if let (Some(parent), Some(thread_id)) = (current_parent(), current_thread_id()) {if let Some(objective) = AgentPrepareContextTool::parse_proposed_goal(&bundle) {match crate::openhuman::threads::goals::store::set_if_absent(@@ -864,7 +852,7 @@ mod tests {let tool = AgentPrepareContextTool::new();let result = crate::openhuman::agent::harness::with_agent_context_prepared_sources(vec![AgentContextPreparedSource {- source: "super context preparation".to_string(),+ source: "memory agent context retrieval".to_string(),has_enough_context: Some(false),}],tool.execute(json!({"question": "prepare context again"})),@@ -876,7 +864,7 @@ mod tests {assert!(result.output().contains("[context_bundle]"));assert!(result.output().contains("has_enough_context: false"));assert!(result.output().contains("already been prepared once"));- assert!(result.output().contains("super context preparation"));+ assert!(result.output().contains("memory agent context retrieval"));assert!(result.output().contains("does not assert that enough context is available"));@@ -888,7 +876,7 @@ mod tests {let tool = AgentPrepareContextTool::new();let result = crate::openhuman::agent::harness::with_agent_context_prepared_sources(vec![AgentContextPreparedSource {- source: "super context preparation".to_string(),+ source: "memory agent context retrieval".to_string(),has_enough_context: Some(true),}],tool.execute(json!({"question": "prepare context again"})),diff --git a/src/openhuman/agent/registry/agents/loader.rs b/src/openhuman/agent/registry/agents/loader.rsindex 89466d66be..9d11b525c1 100644--- a/src/openhuman/agent/registry/agents/loader.rs+++ b/src/openhuman/agent/registry/agents/loader.rs@@ -1507,8 +1507,8 @@ mod tests {let def = find("context_scout");assert_eq!(def.agent_tier, AgentTier::Worker);assert_eq!(def.sandbox_mode, SandboxMode::ReadOnly);- // Super-context scout rides the cheap, high-throughput `burst` tier- // (resolves to `burst-v1` on the managed backend) — not the pricier+ // The context scout rides the cheap, high-throughput `burst` tier+ // (resolves to `burst-v1` on the managed backend), not the pricier// agentic/reasoning tiers.assert!(matches!(&def.model, ModelSpec::Hint(h) if h == "burst"),diff --git a/src/openhuman/agent/tinyagents/middleware.rs b/src/openhuman/agent/tinyagents/middleware.rsindex 053517bcf5..ff9964a881 100644--- a/src/openhuman/agent/tinyagents/middleware.rs+++ b/src/openhuman/agent/tinyagents/middleware.rs@@ -87,11 +87,6 @@ pub(crate) struct TurnContextMiddleware {/// summarizer tokens or rewrite history. The deterministic hard-trim backstop/// still installs regardless. Defaults to `true` (see [`defaults`](Self::defaults)).pub(crate) autocompact_enabled: bool,- /// "Super context" first-turn context collection. `Some` installs the- /// [`SuperContextMiddleware`] graph node; `None` (the default, and every- /// non-chat path) skips it. Only the chat turn sets this — and only when its- /// gate (`should_run_super_context`) passes.- pub(crate) super_context: Option<SuperContextConfig>,/// Progressive-disclosure handoff: when set (integrations_agent with a/// resolved toolkit), oversized tool results are stashed in the shared/// [`ResultHandoffCache`] and replaced with an `extract_from_result` drill-in@@ -270,14 +265,6 @@ impl OpenHumanToolExposureShadowMiddleware {}}-/// Inputs the [`SuperContextMiddleware`] node needs to run its first-turn-/// read-only context-collection pass.-#[derive(Clone)]-pub(crate) struct SuperContextConfig {- /// The raw user ask, used as the context scout's query.- pub(crate) user_message: String,-}-impl TurnContextMiddleware {/// A sensible default for turn paths without a session `ContextManager`/// (channel / sub-agent): the default tool-result byte cap, no summarizer or@@ -291,7 +278,6 @@ impl TurnContextMiddleware {tokenjuice_compression: AgentTokenjuiceCompression::Off,microcompact_keep_recent: 0,autocompact_enabled: true,- super_context: None,handoff: None,transcript_snapshot: None,}@@ -303,7 +289,6 @@ impl TurnContextMiddleware {&& self.payload_summarizer.is_none()&& !self.tokenjuice_compaction_enabled&& self.microcompact_keep_recent == 0- && self.super_context.is_none()&& self.handoff.is_none()&& self.transcript_snapshot.is_none()}@@ -326,15 +311,6 @@ impl TurnContextMiddleware {if let Some(sink) = self.transcript_snapshot {harness.push_middleware(Arc::new(TranscriptSnapshotMiddleware { sink }));}- // Super context runs first: it prepares the read-only context bundle and- // folds it into the first model call's user message before any other- // before_model hook inspects the request.- if let Some(sc) = self.super_context {- harness.push_middleware(Arc::new(SuperContextMiddleware {- user_message: sc.user_message,- ran: AtomicBool::new(false),- }));- }if self.microcompact_keep_recent > 0 {// Crate middleware (upstreamed from the in-house copy). Constructed// with OpenHuman's model-facing placeholder so behavior is@@ -508,125 +484,6 @@ impl Middleware<()> for HandoffMiddleware {}}-/// `before_model` (first call only): "super context" — the graph node analogue-/// of the harness-driven first-turn context collection that used to run-/// imperatively in `session/turn/core.rs`. On the first model call it runs the-/// read-only `context_scout` sub-agent against the raw user ask, folds the-/// resulting `[context_bundle]` into the user message, and registers a-/// prepared-context source so a later `agent_prepare_context` call in the same-/// turn self-suppresses.-///-/// Best-effort: any scout error leaves the turn to proceed with the-/// un-augmented message rather than blocking the user. Runs inside the parent-/// context scope the chat turn already installs (`with_parent_context`), which-/// the scout reads via `current_parent()`.-struct SuperContextMiddleware {- /// The raw user ask, used as the scout's query (not the enriched message).- user_message: String,- /// One-shot latch — `before_model` fires on every model call, but super- /// context is a first-turn, once-per-run pass.- ran: AtomicBool,-}--#[async_trait]-impl Middleware<()> for SuperContextMiddleware {- fn name(&self) -> &str {- "super_context"- }-- async fn before_model(- &self,- _ctx: &mut RunContext<()>,- _state: &(),- request: &mut ModelRequest,- ) -> TaResult<()> {- if self.ran.swap(true, Ordering::SeqCst) {- return Ok(());- }- let scout = crate::openhuman::agent::orchestration::tools::run_context_scout(- &self.user_message,- None,- )- .await;- match scout {- Ok(result) if !result.is_error => {- let bundle = result.output();- // Register the source live so `agent_prepare_context` (which reads- // `current_agent_context_prepared_sources()`) self-suppresses for- // the rest of the turn. Only on success — a failed scout must not- // block a legitimate retry.- crate::openhuman::agent::harness::push_agent_context_prepared_source(- crate::openhuman::agent::harness::AgentContextPreparedSource {- source: "super context preparation".to_string(),- has_enough_context: parse_context_bundle_has_enough_context(&bundle),- },- );- tracing::info!(- bundle_chars = bundle.chars().count(),- "[tinyagents::mw] super_context bundle collected — folding into user message"- );- let block = format!(- "## Agent context status\n\nAgent context retrieval/preparation has already \- run once for this turn in code via super context preparation. Do not call \- `agent_prepare_context` again for general context preparation. Use the \- prepared context below, and call only specific follow-up tools if a concrete \- missing detail is required.\n\n\- ## Prepared context (super context)\n\nThe following context was collected \- up-front by a read-only context scout before this turn. Use it to ground your \- response; do not call `agent_prepare_context` again for general preparation.\n\n\- {bundle}\n\n---\n\n"- );- prepend_text_to_last_user(&mut request.messages, block);- }- Ok(_) => {- tracing::warn!(- "[tinyagents::mw] super_context scout returned an error — proceeding without bundle"- );- }- Err(err) => {- tracing::warn!(- %err,- "[tinyagents::mw] super_context collection failed — proceeding without bundle"- );- }- }- Ok(())- }-}--/// Prepend a text block to the most recent user message, preserving its existing-/// content blocks (multimodal image blocks survive — the bundle rides in front-/// as a new leading text block). No-op if there is no user message.-fn prepend_text_to_last_user(messages: &mut [TaMessage], block: String) {- if let Some(TaMessage::User(m)) = messages- .iter_mut()- .rev()- .find(|m| matches!(m, TaMessage::User(_)))- {- m.content.insert(0, ContentBlock::Text(block));- }-}--/// Parse the `has_enough_context: true|false` marker line the context scout-/// emits inside its `[context_bundle]`. Mirrors the former core.rs helper so the-/// prepared-source record carries the same signal. Returns `None` when absent or-/// unparseable.-fn parse_context_bundle_has_enough_context(bundle: &str) -> Option<bool> {- const PREFIX: &str = "has_enough_context:";- let line = bundle.lines().map(str::trim).find(|line| {- line.get(..PREFIX.len())- .is_some_and(|prefix| prefix.eq_ignore_ascii_case(PREFIX))- })?;- let value = line[PREFIX.len()..].trim();- if value.eq_ignore_ascii_case("true") {- Some(true)- } else if value.eq_ignore_ascii_case("false") {- Some(false)- } else {- None- }-}-/// Stable SHA-256 fingerprint over canonical JSON. TinyAgents' prompt builder/// uses the same shape for `ModelRequest::prompt_fingerprint`; OpenHuman builds/// requests directly, so this adapter must stamp equivalent content-derived@@ -3365,80 +3222,6 @@ mod tests {assert!(!mw.is_empty());}- // ── SuperContextMiddleware helpers ──────────────────────────────────────-- #[test]- fn super_context_is_off_by_default() {- assert!(TurnContextMiddleware::defaults().super_context.is_none());- assert!(TurnContextMiddleware::default().super_context.is_none());- }-- #[test]- fn parse_bundle_sufficiency_reads_the_marker_case_insensitively() {- assert_eq!(- parse_context_bundle_has_enough_context(- "[context_bundle]\nhas_enough_context: true\n[/context_bundle]"- ),- Some(true)- );- assert_eq!(- parse_context_bundle_has_enough_context("HAS_ENOUGH_CONTEXT: false"),- Some(false)- );- assert_eq!(- parse_context_bundle_has_enough_context("[context_bundle]\nsummary: ok"),- None- );- }-- #[test]- fn prepend_folds_bundle_ahead_of_the_last_user_message_keeping_images() {- use tinyagents::harness::message::ImageRef;- let mut msgs = vec![TaMessage::system("sys"), {- // A multimodal user turn: text + an image block.- let mut u = TaMessage::user("original ask");- if let TaMessage::User(m) = &mut u {- m.content.push(ContentBlock::Image(ImageRef {- url: "data:image/png;base64,AAAA".into(),- mime_type: None,- }));- }- u- }];-- prepend_text_to_last_user(&mut msgs, "BUNDLE_BLOCK\n\n".to_string());-- let TaMessage::User(m) = &msgs[1] else {- panic!("expected a user message");- };- // Bundle rides in front as a new leading text block.- assert!(- matches!(&m.content[0], ContentBlock::Text(t) if t.starts_with("BUNDLE_BLOCK")),- "bundle should be the leading text block"- );- // Original text and the image both survive.- assert!(m- .content- .iter()- .any(|b| matches!(b, ContentBlock::Text(t) if t.contains("original ask"))));- assert!(- m.content- .iter()- .any(|b| matches!(b, ContentBlock::Image(_))),- "the image block must survive the fold"- );- // System message untouched.- assert_eq!(msgs[0].text(), "sys");- }-- #[test]- fn prepend_is_a_noop_without_a_user_message() {- let mut msgs = vec![TaMessage::system("only system")];- prepend_text_to_last_user(&mut msgs, "IGNORED".to_string());- assert_eq!(msgs.len(), 1);- assert_eq!(msgs[0].text(), "only system");- }-// ── MicrocompactMiddleware (crate) ──────────────────────────────────────//// These assert the crate `MicrocompactMiddleware`, constructed withdiff --git a/src/openhuman/agent/tinyagents/mod.rs b/src/openhuman/agent/tinyagents/mod.rsindex b3a0207aba..1c2cbae832 100644--- a/src/openhuman/agent/tinyagents/mod.rs+++ b/src/openhuman/agent/tinyagents/mod.rs@@ -82,9 +82,7 @@ use crate::openhuman::agent::progress::AgentProgress;#[allow(unused_imports)] // Wired into the recall/retrieval facade in workstream 09.2.pub(crate) use embeddings::ProviderEmbeddingModel;-pub(crate) use middleware::{- HandoffConfig, SuperContextConfig, TranscriptSnapshotSink, TurnContextMiddleware,-};+pub(crate) use middleware::{HandoffConfig, TranscriptSnapshotSink, TurnContextMiddleware};use model::{BuiltTurnModels, ProfileOverrideModel, RouteRecordingModel, TierRoutes, TurnChatModel,};diff --git a/src/openhuman/config/ops/mod.rs b/src/openhuman/config/ops/mod.rsindex d075c010c5..a5dddf8f2b 100644--- a/src/openhuman/config/ops/mod.rs+++ b/src/openhuman/config/ops/mod.rs@@ -66,10 +66,9 @@ pub use sandbox::{pub use ui::{apply_analytics_settings, apply_browser_settings, apply_meet_settings, apply_search_settings,get_dictation_settings, get_onboarding_completed, get_search_settings,- get_super_context_enabled, get_voice_server_settings, load_and_apply_analytics_settings,- load_and_apply_browser_settings, load_and_apply_dictation_settings,- load_and_apply_meet_settings, load_and_apply_search_settings,- load_and_apply_voice_server_settings, set_onboarding_completed, set_super_context_enabled,+ get_voice_server_settings, load_and_apply_analytics_settings, load_and_apply_browser_settings,+ load_and_apply_dictation_settings, load_and_apply_meet_settings,+ load_and_apply_search_settings, load_and_apply_voice_server_settings, set_onboarding_completed,workspace_onboarding_flag_exists, workspace_onboarding_flag_resolve,workspace_onboarding_flag_set, AnalyticsSettingsPatch, BrowserSettingsPatch,DictationSettingsPatch, MeetSettingsPatch, SearchSettingsPatch, VoiceServerSettingsPatch,diff --git a/src/openhuman/config/ops/ui.rs b/src/openhuman/config/ops/ui.rsindex 622f840e92..70ec8732cf 100644--- a/src/openhuman/config/ops/ui.rs+++ b/src/openhuman/config/ops/ui.rs@@ -496,35 +496,6 @@ pub async fn set_onboarding_completed(value: bool) -> Result<RpcOutcome<bool>, S))}-/// Reads the "super context" toggle (`context.super_context_enabled`).-///-/// When on, the agent harness runs a mandatory read-only context-collection-/// pass on the first turn of a new thread before the orchestrator LLM runs.-/// Surfaced as the toggle below the chat composer.-pub async fn get_super_context_enabled() -> Result<RpcOutcome<bool>, String> {- let config = load_config_with_timeout().await?;- Ok(RpcOutcome::single_log(- config.context.super_context_enabled,- "super_context_enabled read from config",- ))-}--/// Updates and persists the "super context" toggle.-///-/// Read at thread/session construction, so the new value only takes effect-/// for threads started after the change (matches the frozen turn-1 prefix-/// contract).-pub async fn set_super_context_enabled(value: bool) -> Result<RpcOutcome<bool>, String> {- tracing::debug!(value, "[super_context] set_super_context_enabled called");- let mut config = load_config_with_timeout().await?;- config.context.super_context_enabled = value;- config.save().await.map_err(|e| e.to_string())?;- Ok(RpcOutcome::single_log(- config.context.super_context_enabled,- "super_context_enabled saved to config",- ))-}-/// Returns the current dictation settings as a JSON object.pub async fn get_dictation_settings() -> Result<RpcOutcome<serde_json::Value>, String> {let config = load_config_with_timeout().await?;diff --git a/src/openhuman/config/schema/context.rs b/src/openhuman/config/schema/context.rsindex 2b03af561d..4a8c6a0a47 100644--- a/src/openhuman/config/schema/context.rs+++ b/src/openhuman/config/schema/context.rs@@ -116,24 +116,6 @@ pub struct ContextConfig {/// See `compaction-plan.md`.#[serde(default = "default_true")]pub compaction_enabled: bool,-- /// "Super context" mode. When `true`, the agent harness runs a- /// mandatory read-only context-collection pass (the `context_scout`- /// sub-agent, the same one behind the `agent_prepare_context` tool)- /// on the **first turn** of a new thread, *before* the orchestrator- /// LLM runs, and folds the resulting `[context_bundle]` into the user- /// message. This pass is driven by the harness regardless of the- /// model's decision, so the orchestrator does not expose the- /// `agent_prepare_context` tool for the same first-turn work.- ///- /// Read once at session/thread construction, so toggling it only- /// affects threads started afterwards (the value is baked into the- /// frozen turn-1 context). Default: `false` — it's an expensive pass, so- /// it's opt-in. Env override: `OPENHUMAN_SUPER_CONTEXT` (set to `1` to opt- /// in). Surfaced in the UI as the "super context" toggle next to the chat- /// composer's Quick/Reasoning mode switch, shown only on a fresh thread.- #[serde(default = "default_false")]- pub super_context_enabled: bool,}fn default_enabled() -> bool {@@ -144,10 +126,6 @@ fn default_true() -> bool {true}-fn default_false() -> bool {- false-}-fn default_microcompact_keep_recent() -> usize {crate::openhuman::agent::context::DEFAULT_KEEP_RECENT_TOOL_RESULTS}@@ -182,7 +160,6 @@ impl Default for ContextConfig {summarizer_model: None,prefer_markdown_tool_output: default_true(),compaction_enabled: default_true(),- super_context_enabled: default_false(),}}}diff --git a/src/openhuman/config/schema/load/env_overlay.rs b/src/openhuman/config/schema/load/env_overlay.rsindex a8f04e105e..b9d894ebf6 100644--- a/src/openhuman/config/schema/load/env_overlay.rs+++ b/src/openhuman/config/schema/load/env_overlay.rs@@ -1065,20 +1065,6 @@ impl Config {self.context.summarizer_model = Some(model.to_string());}}- // "Super context" — harness-driven first-turn context collection.- // Off by default (expensive); `OPENHUMAN_SUPER_CONTEXT=1` opts in.- // Accepts the canonical short name and the namespaced form.- if let Some(flag) = env- .get("OPENHUMAN_SUPER_CONTEXT")- .or_else(|| env.get("OPENHUMAN_CONTEXT_SUPER_CONTEXT_ENABLED"))- {- match flag.trim().to_ascii_lowercase().as_str() {- "1" | "true" | "yes" | "on" => self.context.super_context_enabled = true,- "0" | "false" | "no" | "off" => self.context.super_context_enabled = false,- _ => {}- }- }-let context_default = crate::openhuman::agent::context::DEFAULT_TOOL_RESULT_BUDGET_BYTES;let context_env_set = env.contains("OPENHUMAN_CONTEXT_TOOL_RESULT_BUDGET_BYTES");if !context_env_setdiff --git a/src/openhuman/config/schema/load_tests.rs b/src/openhuman/config/schema/load_tests.rsindex e2f5c11a7c..09af3e726a 100644--- a/src/openhuman/config/schema/load_tests.rs+++ b/src/openhuman/config/schema/load_tests.rs@@ -1268,31 +1268,6 @@ fn env_overlay_compaction_default_on_and_kill_switch() {assert!(cfg.context.compaction_enabled);}-#[test]-fn env_overlay_super_context_default_off_and_toggle() {- // Default is off — it's an expensive pass, so it's opt-in.- assert!(!Config::default().context.super_context_enabled);-- // `OPENHUMAN_SUPER_CONTEXT=1` opts in.- let mut cfg = Config::default();- cfg.apply_env_overlay_with(&HashMapEnv::new().with("OPENHUMAN_SUPER_CONTEXT", "1"));- assert!(cfg.context.super_context_enabled);-- // The namespaced alias works and `off` disables it again.- let mut cfg = Config::default();- cfg.context.super_context_enabled = true;- cfg.apply_env_overlay_with(- &HashMapEnv::new().with("OPENHUMAN_CONTEXT_SUPER_CONTEXT_ENABLED", "off"),- );- assert!(!cfg.context.super_context_enabled);-- // Garbage is ignored (leaves the prior value untouched).- let mut cfg = Config::default();- cfg.context.super_context_enabled = true;- cfg.apply_env_overlay_with(&HashMapEnv::new().with("OPENHUMAN_SUPER_CONTEXT", "maybe"));- assert!(cfg.context.super_context_enabled);-}-#[test]fn env_overlay_context_tool_result_budget_legacy_migration_when_env_absent() {// Env absent, context at default, agent customised → agent value copies forward.diff --git a/src/openhuman/config/schema/types.rs b/src/openhuman/config/schema/types.rsindex fe0ad5d1c9..9943083a0e 100644--- a/src/openhuman/config/schema/types.rs+++ b/src/openhuman/config/schema/types.rs@@ -15,8 +15,8 @@ pub const MODEL_CHAT_V1: &str = "chat-v1";pub const MODEL_REASONING_QUICK_V1: &str = "reasoning-quick-v1";pub const MODEL_CODING_V1: &str = "coding-v1";/// High-throughput "burst" tier served by the managed backend. Cheap, fast,-/// non-reasoning, text-only, 128k context, no prompt cache; used by the-/// super-context scout. Managed-backend only (no BYOK knob).+/// non-reasoning, text-only, 128k context, no prompt cache; used by fast+/// high-fanout workers. Managed-backend only (no BYOK knob).pub const MODEL_BURST_V1: &str = "burst-v1";pub const MODEL_SUMMARIZATION_V1: &str = "summarization-v1";/// Multimodal (image-input) tier. Managed backend serves this with the visiondiff --git a/src/openhuman/config/schemas/controllers.rs b/src/openhuman/config/schemas/controllers.rsindex 5ccf7b9891..6c6665044f 100644--- a/src/openhuman/config/schemas/controllers.rs+++ b/src/openhuman/config/schemas/controllers.rs@@ -12,9 +12,8 @@ use super::helpers::{ComposioTriggerSettingsUpdate, DictationSettingsUpdate, LocalAiSettingsUpdate,MeetSettingsUpdate, MemorySettingsUpdate, MemorySyncSettingsUpdate, ModelSettingsUpdate,OnboardingCompletedSetParams, PrivacyModeUpdate, RuntimeSettingsUpdate, SandboxSettingsUpdate,- SearchSettingsUpdate, SetBrowserAllowAllParams, SuperContextSetParams,- VoiceServerSettingsUpdate, WorkspaceOnboardingFlagParams, WorkspaceOnboardingFlagSetParams,- DEFAULT_ONBOARDING_FLAG_NAME,+ SearchSettingsUpdate, SetBrowserAllowAllParams, VoiceServerSettingsUpdate,+ WorkspaceOnboardingFlagParams, WorkspaceOnboardingFlagSetParams, DEFAULT_ONBOARDING_FLAG_NAME,};use super::schema_defs::schemas;@@ -44,8 +43,6 @@ pub fn all_controller_schemas() -> Vec<ControllerSchema> {schemas("update_agent_paths"),schemas("get_onboarding_completed"),schemas("set_onboarding_completed"),- schemas("get_super_context_enabled"),- schemas("set_super_context_enabled"),schemas("get_dictation_settings"),schemas("update_dictation_settings"),schemas("get_voice_server_settings"),@@ -167,14 +164,6 @@ pub fn all_registered_controllers() -> Vec<RegisteredController> {schema: schemas("set_onboarding_completed"),handler: handle_set_onboarding_completed,},- RegisteredController {- schema: schemas("get_super_context_enabled"),- handler: handle_get_super_context_enabled,- },- RegisteredController {- schema: schemas("set_super_context_enabled"),- handler: handle_set_super_context_enabled,- },RegisteredController {schema: schemas("get_dictation_settings"),handler: handle_get_dictation_settings,@@ -938,17 +927,6 @@ fn handle_set_onboarding_completed(params: Map<String, Value>) -> ControllerFutu})}-fn handle_get_super_context_enabled(_params: Map<String, Value>) -> ControllerFuture {- Box::pin(async { to_json(config_rpc::get_super_context_enabled().await?) })-}--fn handle_set_super_context_enabled(params: Map<String, Value>) -> ControllerFuture {- Box::pin(async move {- let payload = deserialize_params::<SuperContextSetParams>(params)?;- to_json(config_rpc::set_super_context_enabled(payload.value).await?)- })-}-fn handle_update_composio_trigger_settings(params: Map<String, Value>) -> ControllerFuture {Box::pin(async move {log::debug!("[config][rpc] update_composio_trigger_settings enter");diff --git a/src/openhuman/config/schemas/helpers.rs b/src/openhuman/config/schemas/helpers.rsindex c457a40afd..345711a34a 100644--- a/src/openhuman/config/schemas/helpers.rs+++ b/src/openhuman/config/schemas/helpers.rs@@ -176,11 +176,6 @@ pub(super) struct OnboardingCompletedSetParams {pub(super) value: bool,}-#[derive(Debug, Deserialize)]-pub(super) struct SuperContextSetParams {- pub(super) value: bool,-}-#[derive(Debug, Deserialize)]pub(super) struct DictationSettingsUpdate {pub(super) enabled: Option<bool>,diff --git a/src/openhuman/config/schemas/schema_defs.rs b/src/openhuman/config/schemas/schema_defs.rsindex ab9c00e3f0..ea4824a061 100644--- a/src/openhuman/config/schemas/schema_defs.rs+++ b/src/openhuman/config/schemas/schema_defs.rs@@ -808,38 +808,6 @@ pub fn schemas(function: &str) -> ControllerSchema {required: true,}],},- "get_super_context_enabled" => ControllerSchema {- namespace: "config",- function: "get_super_context_enabled",- description: "Read whether \"super context\" is enabled (harness runs a \- read-only context-collection pass on the first turn of a new \- thread before the orchestrator LLM runs).",- inputs: vec![],- outputs: vec![FieldSchema {- name: "enabled",- ty: TypeSchema::Bool,- comment: "True when super context is enabled.",- required: true,- }],- },- "set_super_context_enabled" => ControllerSchema {- namespace: "config",- function: "set_super_context_enabled",- description: "Enable or disable \"super context\". Takes effect for threads \- started after the change.",- inputs: vec![FieldSchema {- name: "value",- ty: TypeSchema::Bool,- comment: "True to enable super context, false to disable.",- required: true,- }],- outputs: vec![FieldSchema {- name: "enabled",- ty: TypeSchema::Bool,- comment: "Updated super-context enabled state.",- required: true,- }],- },"update_composio_trigger_settings" => ControllerSchema {namespace: "config",function: "update_composio_trigger_settings",diff --git a/src/openhuman/config/schemas_tests.rs b/src/openhuman/config/schemas_tests.rsindex a4f1bd8c31..c616d944ad 100644--- a/src/openhuman/config/schemas_tests.rs+++ b/src/openhuman/config/schemas_tests.rs@@ -182,23 +182,6 @@ fn autonomy_settings_rpc_is_registered() {assert!(funcs.contains(&"update_autonomy_settings"));}-#[test]-fn super_context_rpc_is_registered() {- let funcs: Vec<&str> = all_controller_schemas()- .iter()- .map(|s| s.function)- .collect();- assert!(funcs.contains(&"get_super_context_enabled"));- assert!(funcs.contains(&"set_super_context_enabled"));- // Handler registry must stay in lockstep with the schema list.- let handlers: Vec<&str> = all_registered_controllers()- .iter()- .map(|h| h.schema.function)- .collect();- assert!(handlers.contains(&"get_super_context_enabled"));- assert!(handlers.contains(&"set_super_context_enabled"));-}-#[test]fn memory_sync_settings_rpc_is_registered() {let funcs: Vec<&str> = all_controller_schemas()diff --git a/src/openhuman/inference/provider/factory.rs b/src/openhuman/inference/provider/factory.rsindex 3ded7b6547..7c65f9e878 100644--- a/src/openhuman/inference/provider/factory.rs+++ b/src/openhuman/inference/provider/factory.rs@@ -1097,8 +1097,8 @@ fn managed_tier_for_role(role: &str) -> Option<&'static str> {"agentic" => Some(MODEL_AGENTIC_V1),"coding" => Some(MODEL_CODING_V1),// Burst rides the managed backend's high-throughput tier. Pinned here- // (rather than collapsing to `default_model`) so the `hint = "burst"`- // sub-agent — the super-context scout — actually reaches `burst-v1`.+ // (rather than collapsing to `default_model`) so `hint = "burst"`+ // workers actually reach `burst-v1`.// There is no `burst_provider` knob: burst is managed-only."burst" => Some(MODEL_BURST_V1),"vision" => Some(MODEL_VISION_V1),diff --git a/tests/agent_harness_e2e.rs b/tests/agent_harness_e2e.rsindex 26f4fc88fb..97daec75d2 100644--- a/tests/agent_harness_e2e.rs+++ b/tests/agent_harness_e2e.rs@@ -333,7 +333,7 @@ fn assert_no_jsonrpc_error<'a>(v: &'a Value, context: &str) -> &'a Value {.unwrap_or_else(|| panic!("{context}: missing result: {v}"))}-fn write_min_config(openhuman_dir: &Path, api_origin: &str, super_context_enabled: bool) {+fn write_min_config(openhuman_dir: &Path, api_origin: &str) {let cfg = format!(r#"api_url = "{api_origin}"default_model = "e2e-mock-model"@@ -343,12 +343,6 @@ chat_onboarding_completed = true[secrets]encrypt = false-[context]-# Most harness tests script the mock-LLM call sequence exactly; the default-on-# first-turn "super context" pass (#4085) would spawn a context_scout and consume-# a scripted response, desyncing the orchestrator turns. Tests opt in only when-# they explicitly cover super context.-super_context_enabled = {super_context_enabled}"#);fn write_config_file(config_dir: &Path, cfg: &str) {@@ -496,10 +490,6 @@ impl Drop for Stack {}async fn boot_stack() -> Stack {- boot_stack_with_super_context(false).await-}--async fn boot_stack_with_super_context(super_context_enabled: bool) -> Stack {// Ensure the global AgentDefinitionRegistry is populated with built-in// archetypes (orchestrator, researcher, task_manager_agent, etc.) before// the RPC stack starts. Without this the session builder cannot synthesise@@ -518,13 +508,9 @@ async fn boot_stack_with_super_context(super_context_enabled: bool) -> Stack {let (mock_addr, mock_join) = serve_on_ephemeral(scripted_upstream_router()).await;let mock_origin = format!("http://{mock_addr}");- write_min_config(&openhuman_home, &mock_origin, super_context_enabled);+ write_min_config(&openhuman_home, &mock_origin);// Pre-write user-scoped config so it's found after auth_store_session activates "e2e-user".- write_min_config(- &openhuman_home.join("users").join("e2e-user"),- &mock_origin,- super_context_enabled,- );+ write_min_config(&openhuman_home.join("users").join("e2e-user"), &mock_origin);// The transport-only router does not create a Core runtime context. Install// the explicit tinymemory host seams before handlers service memory-backed@@ -870,204 +856,6 @@ async fn subagent_delegation_happy_path_inner() {stack.shutdown();}-// ─── Super context: harness-driven context-scout happy path ───────────────────-//-// Tool surface (src/openhuman/agent/orchestration/tools/agent_prepare_context.rs,-// src/openhuman/agent/registry/agents/context_scout/agent.toml):-// - First-turn context prep is harness-driven, not orchestrator-scoped. The-// harness runs the read-only `context_scout` before the orchestrator's first-// LLM call and injects the scout's `[context_bundle]` into the user message.-//-// Actual LLM request ordering (with registry init):-// request[0] = context_scout subagent inner loop → model returns the bundle text-// request[1] = orchestrator synthesis → final text, having read the bundle--/// The harness runs `context_scout` before the first orchestrator turn and-/// injects the returned `[context_bundle]`; the final orchestrator synthesis-/// reads it. Two upstream requests prove the full scout path ran without-/// exposing `agent_prepare_context` to the orchestrator.-#[test]-fn super_context_happy_path() {- run_on_agent_stack("super_context_happy_path", super_context_happy_path_inner);-}--/// Regression for the "scout runs, bundle missing" failure: the fast chat-tier-/// `context_scout` wraps its `[context_bundle]` envelope in a preamble and a-/// closing line. The harness must extract just the envelope and inject it (not-/// drop the whole thing, and not leak the surrounding prose into the-/// orchestrator's context).-#[test]-fn super_context_extracts_prose_wrapped_bundle() {- run_on_agent_stack(- "super_context_extracts_prose_wrapped_bundle",- super_context_extracts_prose_wrapped_bundle_inner,- );-}--async fn super_context_extracts_prose_wrapped_bundle_inner() {- let _lock = env_lock();- // The envelope is wrapped in prose on BOTH sides — exactly what the strict- // whole-output validator used to reject.- let prose_wrapped = "Sure! Here's what I found for you:\n\n\- [context_bundle]\n\- has_enough_context: true\n\- summary: CTX_CANARY_9 — the user wants the marker phrase (memory).\n\- recommended_tool_calls:\n\- [/context_bundle]\n\n\- Hope that helps — let me know if you want me to dig deeper!";- reset_script(vec![- // request[0]: harness-driven context_scout returns a prose-wrapped bundle.- text_completion(prose_wrapped),- // request[1]: orchestrator reads the *extracted* bundle and synthesizes.- text_completion("Prepared. CTX_CANARY_9 noted."),- ]);- let stack = boot_stack_with_super_context(true).await;-- let mut events = spawn_sse_collector(format!(- "{}/events?client_id=harness-prepctx-prose",- stack.rpc_base- ));- send_web_chat(- &stack.rpc_base,- 400,- "harness-prepctx-prose",- "thread-prepctx-prose",- "prepare context for the marker",- )- .await;-- let done = wait_for_terminal(&mut events, Duration::from_secs(120)).await;- assert_eq!(- done.get("event").and_then(Value::as_str),- Some("chat_done"),- "expected chat_done for prose-wrapped super_context: {done}"- );-- let requests = with_captured(|c| c.clone());- let last_messages = serde_json::to_string(- requests- .last()- .and_then(|r| r.pointer("/body/messages"))- .unwrap_or(&Value::Null),- )- .unwrap_or_default();- // The extracted envelope (with its canary) must reach the orchestrator …- assert!(- last_messages.contains("[context_bundle]") && last_messages.contains("CTX_CANARY_9"),- "extracted bundle missing from synthesis request; messages: {last_messages}"- );- // … but the wrapping prose must NOT — we inject only the envelope.- assert!(- !last_messages.contains("Here's what I found")- && !last_messages.contains("Hope that helps"),- "scout's wrapping prose leaked into the orchestrator context; messages: {last_messages}"- );-- stack.shutdown();-}--async fn super_context_happy_path_inner() {- let _lock = env_lock();- let scout_bundle = "[context_bundle]\n\- has_enough_context: true\n\- summary: CTX_CANARY_7 — the user wants the marker phrase (memory).\n\- recommended_tool_calls:\n\- \x20 - tool: spawn_worker_thread\n\- \x20 args: {\"prompt\": \"act on the marker\"}\n\- \x20 why: execute the prepared plan\n\- [/context_bundle]";- reset_script(vec![- // request[0]: harness-driven context_scout subagent returns the bundle.- text_completion(scout_bundle),- // request[1]: Orchestrator reads the injected bundle and synthesizes.- text_completion("Prepared. CTX_CANARY_7 noted; next I'd spawn a worker."),- ]);- let stack = boot_stack_with_super_context(true).await;-- let mut events = spawn_sse_collector(format!(- "{}/events?client_id=harness-prepctx",- stack.rpc_base- ));- send_web_chat(- &stack.rpc_base,- 400,- "harness-prepctx",- "thread-prepctx",- "prepare context for the marker",- )- .await;-- let done = wait_for_terminal(&mut events, Duration::from_secs(120)).await;- assert_eq!(- done.get("event").and_then(Value::as_str),- Some("chat_done"),- "expected chat_done for super_context: {done}"- );- let full_response = done- .get("full_response")- .and_then(Value::as_str)- .unwrap_or_else(|| panic!("chat_done missing 'full_response': {done}"));- assert!(- full_response.contains("CTX_CANARY_7"),- "final response missing scout canary; full_response: {full_response}\nevent: {done}"- );-- let requests = with_captured(|c| c.clone());- assert!(- requests.len() >= 2,- "expected ≥2 upstream requests (context_scout + orchestrator), got {};\n{}",- requests.len(),- serde_json::to_string_pretty(&requests).unwrap_or_default()- );-- let orchestrator_tools = serde_json::to_string(- requests- .last()- .and_then(|r| r.pointer("/body/tools"))- .unwrap_or(&Value::Null),- )- .unwrap_or_default();- assert!(- !orchestrator_tools.contains("agent_prepare_context"),- "orchestrator should not see agent_prepare_context in its tool schema; tools: {orchestrator_tools}"- );-- // The synthesis turn must carry the scout's bundle in the user message —- // proves the [context_bundle] flowed into the orchestrator's context without- // an orchestrator tool call.- let last_messages = serde_json::to_string(- requests- .last()- .and_then(|r| r.pointer("/body/messages"))- .unwrap_or(&Value::Null),- )- .unwrap_or_default();- assert!(- last_messages.contains("[context_bundle]") && last_messages.contains("CTX_CANARY_7"),- "synthesis request missing the scout bundle as a tool result; messages: {last_messages}"- );-- // request[1] (context_scout) must build a different context than request[0]- // (orchestrator) — proves a genuinely separate scout agent ran.- let req0_sys = requests- .first()- .and_then(|r| r.pointer("/body/messages/0/content"))- .and_then(Value::as_str)- .unwrap_or("");- let req1_sys = requests- .get(1)- .and_then(|r| r.pointer("/body/messages/0/content"))- .and_then(Value::as_str)- .unwrap_or("");- assert_ne!(- req0_sys, req1_sys,- "request[0] and request[1] share identical first-message content — \- context_scout did not build its own context"- );-- stack.shutdown();-}-// ─── Task 4: Subagent clarification flow ──────────────────────────────────────//// Exercises the ask_user_clarification path via scheduler_agent@@ -2542,14 +2330,7 @@ mod streaming_support {.event_context("stream-accum-session", "stream-accum-channel").agent_definition_name("round17/orchestrator").config(config)- // These are deterministic scripted-mock orchestrator turns. The- // default-on first-turn "super context" pass (#4085) would spawn a- // context_scout and add an extra model call the scripts don't expect,- // breaking every orchestrator test here. Disable it for the harness.- .context_config(ContextConfig {- super_context_enabled: false,- ..ContextConfig::default()- })+ .context_config(ContextConfig::default()).auto_save(true).explicit_preferences_enabled(false).build()diff --git a/tests/config_auth_app_state_connectivity_e2e.rs b/tests/config_auth_app_state_connectivity_e2e.rsindex 1724ba556d..188b83bb35 100644--- a/tests/config_auth_app_state_connectivity_e2e.rs+++ b/tests/config_auth_app_state_connectivity_e2e.rs@@ -2814,14 +2814,12 @@ async fn worker_a_controller_schemas_are_fully_exposed() {"openhuman.config_get_runtime_flags","openhuman.config_get_sandbox_settings","openhuman.config_get_search_settings",- "openhuman.config_get_super_context_enabled","openhuman.config_get_voice_server_settings","openhuman.config_reset_local_data","openhuman.config_resolve_api_url","openhuman.config_set_browser_allow_all","openhuman.config_set_onboarding_completed","openhuman.config_set_privacy_mode",- "openhuman.config_set_super_context_enabled","openhuman.config_update_activity_level_settings","openhuman.config_update_agent_paths","openhuman.config_update_agent_settings",