test(ci): remove suite-order mock coupling
This commit is contained in:
@@ -129,9 +129,13 @@ export function createToolExecuteAfterHandler(input: {
|
||||
autoCommit: boolean
|
||||
getState: (sessionID: string) => SessionState
|
||||
isCallerOrchestrator?: (sessionID: string | undefined) => Promise<boolean>
|
||||
collectGitDiffStats?: typeof collectGitDiffStats
|
||||
formatFileChanges?: typeof formatFileChanges
|
||||
}): (toolInput: ToolExecuteAfterInput, toolOutput: ToolExecuteAfterOutput | undefined) => Promise<void> {
|
||||
const { ctx, pendingFilePaths, pendingTaskRefs, pendingPlanSnapshots, autoCommit, getState } = input
|
||||
const resolveIsCallerOrchestrator = input.isCallerOrchestrator ?? ((sessionID) => isCallerOrchestrator(sessionID, ctx.client))
|
||||
const collectGitDiffStatsImpl = input.collectGitDiffStats ?? collectGitDiffStats
|
||||
const formatFileChangesImpl = input.formatFileChanges ?? formatFileChanges
|
||||
return async (toolInput, toolOutput): Promise<void> => {
|
||||
// Guard against undefined output (e.g., from /review command - see issue #1035)
|
||||
if (!toolOutput) {
|
||||
@@ -212,8 +216,8 @@ export function createToolExecuteAfterHandler(input: {
|
||||
if (toolOutput.output && typeof toolOutput.output === "string") {
|
||||
const worktreePath = boulderState?.worktree_path?.trim()
|
||||
const verificationDirectory = worktreePath ? worktreePath : ctx.directory
|
||||
const gitStats = collectGitDiffStats(verificationDirectory)
|
||||
const fileChanges = formatFileChanges(gitStats)
|
||||
const gitStats = collectGitDiffStatsImpl(verificationDirectory)
|
||||
const fileChanges = formatFileChangesImpl(gitStats)
|
||||
const extractedSessionId = metadataSessionId ?? extractSessionIdFromOutput(toolOutput.output)
|
||||
|
||||
if (boulderState) {
|
||||
|
||||
Reference in New Issue
Block a user