fix: wire errand repository through tRPC adapter

ErrandRepository was instantiated in the container but never passed
from TrpcAdapterOptions into createContext(), causing all errand
procedures to throw "Errand repository not available" at runtime.
This commit is contained in:
Lukas May
2026-03-06 21:24:19 +01:00
parent 56efc0bad6
commit 094b7e6307

View File

@@ -22,6 +22,7 @@ import type { LogChunkRepository } from '../db/repositories/log-chunk-repository
import type { ConversationRepository } from '../db/repositories/conversation-repository.js'; import type { ConversationRepository } from '../db/repositories/conversation-repository.js';
import type { ChatSessionRepository } from '../db/repositories/chat-session-repository.js'; import type { ChatSessionRepository } from '../db/repositories/chat-session-repository.js';
import type { ReviewCommentRepository } from '../db/repositories/review-comment-repository.js'; import type { ReviewCommentRepository } from '../db/repositories/review-comment-repository.js';
import type { ErrandRepository } from '../db/repositories/errand-repository.js';
import type { AccountCredentialManager } from '../agent/credentials/types.js'; import type { AccountCredentialManager } from '../agent/credentials/types.js';
import type { DispatchManager, PhaseDispatchManager } from '../dispatch/types.js'; import type { DispatchManager, PhaseDispatchManager } from '../dispatch/types.js';
import type { CoordinationManager } from '../coordination/types.js'; import type { CoordinationManager } from '../coordination/types.js';
@@ -82,6 +83,8 @@ export interface TrpcAdapterOptions {
reviewCommentRepository?: ReviewCommentRepository; reviewCommentRepository?: ReviewCommentRepository;
/** Project sync manager for remote fetch/sync operations */ /** Project sync manager for remote fetch/sync operations */
projectSyncManager?: ProjectSyncManager; projectSyncManager?: ProjectSyncManager;
/** Errand repository for errand CRUD operations */
errandRepository?: ErrandRepository;
/** Absolute path to the workspace root (.cwrc directory) */ /** Absolute path to the workspace root (.cwrc directory) */
workspaceRoot?: string; workspaceRoot?: string;
} }
@@ -166,6 +169,7 @@ export function createTrpcHandler(options: TrpcAdapterOptions) {
chatSessionRepository: options.chatSessionRepository, chatSessionRepository: options.chatSessionRepository,
reviewCommentRepository: options.reviewCommentRepository, reviewCommentRepository: options.reviewCommentRepository,
projectSyncManager: options.projectSyncManager, projectSyncManager: options.projectSyncManager,
errandRepository: options.errandRepository,
workspaceRoot: options.workspaceRoot, workspaceRoot: options.workspaceRoot,
}), }),
}); });