Add BRAIN_DISABLED flag and fix Ollama tool call formatting
Features: - Add BRAIN_DISABLED feature flag to hide all Brain functionality - When enabled, hides Brain banner, status indicator, menu, and commands - Flag location: src/constants/brain.ts Fixes: - Fix Ollama 400 error by properly formatting tool_calls in messages - Update OllamaMessage type to include tool_calls field - Fix Brain menu keyboard not working (add missing modes to isMenuOpen) UI Changes: - Remove "^Tab toggle mode" hint from status bar - Remove "ctrl+t to hide todos" hint from status bar Files modified: - src/constants/brain.ts (add BRAIN_DISABLED flag) - src/types/ollama.ts (add tool_calls to OllamaMessage) - src/providers/ollama/chat.ts (format tool_calls in messages) - src/tui-solid/components/header.tsx (hide Brain UI when disabled) - src/tui-solid/components/status-bar.tsx (remove hints) - src/tui-solid/components/command-menu.tsx (filter brain command) - src/tui-solid/components/input-area.tsx (fix isMenuOpen modes) - src/tui-solid/routes/session.tsx (skip brain menu when disabled) - src/services/brain.ts (early return when disabled) - src/services/chat-tui/initialize.ts (skip brain init when disabled)
This commit is contained in:
@@ -62,6 +62,9 @@ interface AppProps extends TuiInput {
|
||||
scope?: LearningScope,
|
||||
editedContent?: string,
|
||||
) => void;
|
||||
onBrainSetJwtToken?: (jwtToken: string) => Promise<void>;
|
||||
onBrainSetApiKey?: (apiKey: string) => Promise<void>;
|
||||
onBrainLogout?: () => Promise<void>;
|
||||
plan?: {
|
||||
id: string;
|
||||
title: string;
|
||||
@@ -139,9 +142,14 @@ function AppContent(props: AppProps) {
|
||||
app.setCascadeEnabled(props.cascadeEnabled);
|
||||
}
|
||||
|
||||
// Navigate to session if resuming
|
||||
if (props.sessionId) {
|
||||
route.goToSession(props.sessionId);
|
||||
// Always navigate to session view (skip home page)
|
||||
// Use existing sessionId or create a new one
|
||||
if (!route.isSession()) {
|
||||
const sessionId = props.sessionId ?? `session-${Date.now()}`;
|
||||
batch(() => {
|
||||
app.setSessionInfo(sessionId, app.provider(), app.model());
|
||||
route.goToSession(sessionId);
|
||||
});
|
||||
}
|
||||
|
||||
if (props.availableModels && props.availableModels.length > 0) {
|
||||
@@ -375,6 +383,9 @@ function AppContent(props: AppProps) {
|
||||
onCascadeToggle={handleCascadeToggle}
|
||||
onPermissionResponse={handlePermissionResponse}
|
||||
onLearningResponse={handleLearningResponse}
|
||||
onBrainSetJwtToken={props.onBrainSetJwtToken}
|
||||
onBrainSetApiKey={props.onBrainSetApiKey}
|
||||
onBrainLogout={props.onBrainLogout}
|
||||
plan={props.plan}
|
||||
agents={props.agents}
|
||||
currentAgent={props.currentAgent}
|
||||
@@ -429,6 +440,9 @@ export interface TuiRenderOptions extends TuiInput {
|
||||
scope?: LearningScope,
|
||||
editedContent?: string,
|
||||
) => void;
|
||||
onBrainSetJwtToken?: (jwtToken: string) => Promise<void>;
|
||||
onBrainSetApiKey?: (apiKey: string) => Promise<void>;
|
||||
onBrainLogout?: () => Promise<void>;
|
||||
plan?: {
|
||||
id: string;
|
||||
title: string;
|
||||
|
||||
Reference in New Issue
Block a user