fix: issues with pagination not resolving correct url templates

This commit is contained in:
2026-05-31 01:43:42 -05:00
parent 2aca1a3aa3
commit 0438688e32
14 changed files with 287 additions and 467 deletions
+5 -6
View File
@@ -67,12 +67,11 @@ export function SelectModeTool(ctx: ToolContext) {
// For Plan mode with issue_number, look up existing plan comment
if (foundMode.name === "Plan" && issue_number !== undefined) {
try {
const commentsResp = await ctx.gitea.paginate(ctx.gitea.rest.issue.issueGetComments, {
owner: ctx.repo.owner,
repo: ctx.repo.name,
index: issue_number,
});
const comments = commentsResp;
const commentsR = await ctx.gitea.request(
"GET /repos/{owner}/{repo}/issues/{index}/comments",
{ owner: ctx.repo.owner, repo: ctx.repo.name, index: issue_number, limit: 50 }
);
const comments = commentsR.data as Array<{ id?: number; body?: string | null }>;
// Look for a plan comment (one with our footer)
const planComment = comments.find((c) => c.body?.includes("<!-- shockbot-footer -->"));
if (planComment) {