diff --git a/src/kilocode/agent-manager/pipeline-runner.ts b/src/kilocode/agent-manager/pipeline-runner.ts index 4d90b77..b3d80fc 100644 --- a/src/kilocode/agent-manager/pipeline-runner.ts +++ b/src/kilocode/agent-manager/pipeline-runner.ts @@ -8,6 +8,7 @@ import { logAgentPerformance, detectRepository } from "./gitea-client" +import { HybridGiteaClient } from "./mcp-gitea-client" export interface PipelineConfig { giteaToken?: string @@ -32,16 +33,20 @@ export interface PipelineResult { } export class PollingSupervisor { - private client: GiteaClient + private client: HybridGiteaClient private efficiencyThreshold: number private autoLog: boolean private initialized: boolean = false private pollInterval: number constructor(config: PipelineConfig = {}) { - this.client = new GiteaClient({ - token: config.giteaToken, - apiUrl: config.giteaApiUrl, + // Use Hybrid client: MCP first, REST fallback + this.client = new HybridGiteaClient({ + mcpUrl: config.mcpUrl, // NEW: MCP server URL + restConfig: { + token: config.giteaToken, + apiUrl: config.giteaApiUrl, + } }) this.efficiencyThreshold = config.efficiencyThreshold ?? 7 this.autoLog = config.autoLog ?? true @@ -52,7 +57,9 @@ export class PollingSupervisor { if (this.initialized) return const { owner, repo } = await detectRepository() + // Hybrid client handles both MCP and REST this.client.setRepository(owner, repo) + await this.client.initialize() // Initialize MCP with fallback this.initialized = true }