This repository has been archived on 2026-07-19. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
ci-agent-runner/app/src/application/execution/context.ts
T
2026-07-13 18:50:38 +02:00

28 lines
888 B
TypeScript

import type { Result } from "../../core/contracts.js";
export const maximumIterations = 3;
export interface OrchestrationOutput {
result: Result;
sessionId: string;
}
export function issueContext(input: {
title: string;
body: string;
comments: Array<{ author: string; createdAt: string; body: string }>;
}): string {
const comments = input.comments.length
? input.comments
.map(
(comment) =>
`### ${comment.author} (${comment.createdAt})\n${comment.body}`,
)
.join("\n\n")
: "No human comments.";
const context = `# Issue\n\n## Title\n${input.title}\n\n## Body\n${input.body || "(empty)"}\n\n## Human comments\n${comments}`;
if (context.length > 500_000)
throw new Error("Issue context exceeds the 500,000 character limit");
return context;
}