From f5966db15555ad3aa2a985b99dc82ce5891edcb4 Mon Sep 17 00:00:00 2001 From: NW Date: Fri, 8 May 2026 22:35:21 +0100 Subject: [PATCH] feat(gns2): integrate HybridGiteaClient into PollingSupervisor - PollingSupervisor now uses HybridGiteaClient (MCP primary, REST fallback) - Added mcpUrl to PipelineConfig - Supervisor calls initialize() to detect MCP vs REST mode automatically Refs: Milestone #67, Issue #107 --- src/kilocode/agent-manager/pipeline-runner.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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 }