(function Ma
{/* Cost Tracker - styled as pill (hidden when panel is narrow or agent doesn't support cost tracking) - shows active tab's cost */}
- {showCostWidget && activeSession.inputMode === 'ai' && activeTab?.agentSessionId && hasCapability('supportsCostTracking') && (
+ {showCostWidget && activeSession.inputMode === 'ai' && (activeTab?.agentSessionId || activeTab?.usageStats) && hasCapability('supportsCostTracking') && (
${(activeTab?.usageStats?.totalCostUsd ?? 0).toFixed(2)}
)}
{/* Context Window Widget with Tooltip - only show when context window is configured and agent supports usage stats */}
- {activeSession.inputMode === 'ai' && activeTab?.agentSessionId && hasCapability('supportsUsageStats') && (activeTab?.usageStats?.contextWindow ?? 0) > 0 && (
+ {activeSession.inputMode === 'ai' && (activeTab?.agentSessionId || activeTab?.usageStats) && hasCapability('supportsUsageStats') && (activeTab?.usageStats?.contextWindow ?? 0) > 0 && (
{
diff --git a/src/renderer/components/NewInstanceModal.tsx b/src/renderer/components/NewInstanceModal.tsx
index 79e9fa15..b7919ff7 100644
--- a/src/renderer/components/NewInstanceModal.tsx
+++ b/src/renderer/components/NewInstanceModal.tsx
@@ -55,6 +55,7 @@ export function NewInstanceModal({ isOpen, onClose, onCreate, theme, defaultAgen
const [homeDir, setHomeDir] = useState('');
const [customAgentPaths, setCustomAgentPaths] = useState>({});
const [customAgentArgs, setCustomAgentArgs] = useState>({});
+ const [agentConfigs, setAgentConfigs] = useState>>({});
const nameInputRef = useRef(null);
@@ -94,6 +95,14 @@ export function NewInstanceModal({ isOpen, onClose, onCreate, theme, defaultAgen
const args = await window.maestro.agents.getAllCustomArgs();
setCustomAgentArgs(args);
+ // Load configurations for all agents
+ const configs: Record> = {};
+ for (const agent of detectedAgents) {
+ const config = await window.maestro.agents.getConfig(agent.id);
+ configs[agent.id] = config;
+ }
+ setAgentConfigs(configs);
+
// Set default or first available
const defaultAvailable = detectedAgents.find((a: AgentConfig) => a.id === defaultAgent && a.available);
const firstAvailable = detectedAgents.find((a: AgentConfig) => a.available);
@@ -193,8 +202,8 @@ export function NewInstanceModal({ isOpen, onClose, onCreate, theme, defaultAgen
useEffect(() => {
if (isOpen) {
loadAgents();
- // Expand the selected agent by default
- setExpandedAgent(defaultAgent);
+ // Keep all agents collapsed by default
+ setExpandedAgent(null);
}
}, [isOpen, defaultAgent]);
@@ -439,6 +448,94 @@ export function NewInstanceModal({ isOpen, onClose, onCreate, theme, defaultAgen
Additional CLI arguments appended to all calls to this agent
+
+ {/* Agent-specific configuration options (contextWindow, model, etc.) */}
+ {agent.configOptions && agent.configOptions.length > 0 && agent.configOptions.map((option: any) => (
+
+
+ {option.label}
+
+ {option.type === 'number' && (
+
{
+ const value = e.target.value === '' ? 0 : parseInt(e.target.value, 10);
+ const newConfig = {
+ ...agentConfigs[agent.id],
+ [option.key]: isNaN(value) ? 0 : value
+ };
+ setAgentConfigs(prev => ({
+ ...prev,
+ [agent.id]: newConfig
+ }));
+ }}
+ onBlur={() => {
+ const currentConfig = agentConfigs[agent.id] || {};
+ window.maestro.agents.setConfig(agent.id, currentConfig);
+ }}
+ onClick={(e) => e.stopPropagation()}
+ placeholder={option.default?.toString() || '0'}
+ min={0}
+ className="w-full p-2 rounded border bg-transparent outline-none text-xs font-mono"
+ style={{ borderColor: theme.colors.border, color: theme.colors.textMain }}
+ />
+ )}
+ {option.type === 'text' && (
+
{
+ const newConfig = {
+ ...agentConfigs[agent.id],
+ [option.key]: e.target.value
+ };
+ setAgentConfigs(prev => ({
+ ...prev,
+ [agent.id]: newConfig
+ }));
+ }}
+ onBlur={() => {
+ const currentConfig = agentConfigs[agent.id] || {};
+ window.maestro.agents.setConfig(agent.id, currentConfig);
+ }}
+ onClick={(e) => e.stopPropagation()}
+ placeholder={option.default || ''}
+ className="w-full p-2 rounded border bg-transparent outline-none text-xs font-mono"
+ style={{ borderColor: theme.colors.border, color: theme.colors.textMain }}
+ />
+ )}
+ {option.type === 'checkbox' && (
+
e.stopPropagation()}>
+ {
+ const newConfig = {
+ ...agentConfigs[agent.id],
+ [option.key]: e.target.checked
+ };
+ setAgentConfigs(prev => ({
+ ...prev,
+ [agent.id]: newConfig
+ }));
+ window.maestro.agents.setConfig(agent.id, newConfig);
+ }}
+ className="w-4 h-4"
+ style={{ accentColor: theme.colors.accent }}
+ />
+ Enabled
+
+ )}
+
+ {option.description}
+
+
+ ))}