// Fixture: gateway/session.ts — session management (has circular dep with agents/runner.ts)
import { getConfig } from '../config/config';
import { runAgent } from '../agents/runner';
import { SessionEntry } from './types';

export function loadSession(key: string): SessionEntry {
  const config = getConfig();
  return { key, agentId: config.defaultAgent, model: config.model };
}

export function saveSession(entry: SessionEntry): void {
  // persist
}

export function refreshSession(key: string): SessionEntry {
  const session = loadSession(key);
  runAgent(session);  // circular: gateway calls agents, agents call gateway
  return session;
}
