diff --git a/src/signals/focus-manifest.ts b/src/signals/focus-manifest.ts index 8fc4b4a3e8..865e8149ab 100644 --- a/src/signals/focus-manifest.ts +++ b/src/signals/focus-manifest.ts @@ -796,6 +796,7 @@ export function reviewConfigToJson(review: FocusManifestReviewConfig): JsonValue if (review.note !== null) out.note = review.note; if (review.profile !== null) out.profile = review.profile; if (review.inlineComments !== null) out.inline_comments = review.inlineComments; + if (review.instructions !== null) out.instructions = review.instructions; if (review.pathInstructions.length > 0) out.path_instructions = review.pathInstructions.map((entry) => ({ path: entry.path, instructions: entry.instructions })); if (review.excludePaths.length > 0) out.exclude_paths = [...review.excludePaths]; if (review.preMergeChecks.length > 0) { diff --git a/test/unit/focus-manifest-loader.test.ts b/test/unit/focus-manifest-loader.test.ts index 810aaea17e..5658ee2461 100644 --- a/test/unit/focus-manifest-loader.test.ts +++ b/test/unit/focus-manifest-loader.test.ts @@ -36,6 +36,22 @@ describe("focus-manifest loader", () => { expect(fetched).toEqual(["owner/repo"]); }); + it("preserves review.instructions across the repo-file cache round trip", async () => { + const env = createTestEnv(); + let fetches = 0; + const fetcher = async () => { + fetches += 1; + return JSON.stringify({ review: { instructions: "Follow our async-error conventions." } }); + }; + + const first = await loadRepoFocusManifest(env, "owner/review-instructions", { fetcher }); + expect(first.review.instructions).toBe("Follow our async-error conventions."); + + const second = await loadRepoFocusManifest(env, "owner/review-instructions", { fetcher }); + expect(fetches).toBe(1); + expect(second.review.instructions).toBe("Follow our async-error conventions."); + }); + it("falls back to an empty manifest when no repo file is published and never throws", async () => { const env = createTestEnv(); const manifest = await loadRepoFocusManifest(env, "owner/missing", { fetcher: async () => null });