From 537db084473bd009e590ac986794e0ecb4ce62dd Mon Sep 17 00:00:00 2001 From: Evgeny Shurakov Date: Thu, 9 Apr 2026 14:17:13 +0200 Subject: [PATCH] fix: exempt kilo-* dirs from annotation check, add markers to session route The kilo-sessions/ directory is entirely Kilo-specific and should not require kilocode_change markers. Update isExempt() to also match directories starting with 'kilo-'. Add block markers to the /viewed route changes in session.ts. --- packages/opencode/src/server/routes/session.ts | 2 ++ script/check-opencode-annotations.ts | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/opencode/src/server/routes/session.ts b/packages/opencode/src/server/routes/session.ts index f7d3b32bc4..f6c97d4055 100644 --- a/packages/opencode/src/server/routes/session.ts +++ b/packages/opencode/src/server/routes/session.ts @@ -971,6 +971,7 @@ export const SessionRoutes = lazy(() => ) .post( "/viewed", + // kilocode_change start describeRoute({ summary: "Set viewed sessions", description: "Notify the server which sessions the user is currently viewing, or clear all.", @@ -993,6 +994,7 @@ export const SessionRoutes = lazy(() => const { KiloSessions } = await import("../../kilo-sessions/kilo-sessions") const body = c.req.valid("json") KiloSessions.setViewedSessions({ focused: body.focused ?? [], open: body.open ?? [] }) + // kilocode_change end return c.json(true) }, ), diff --git a/script/check-opencode-annotations.ts b/script/check-opencode-annotations.ts index b953fd44d8..2b122e67d0 100644 --- a/script/check-opencode-annotations.ts +++ b/script/check-opencode-annotations.ts @@ -22,6 +22,7 @@ * - packages/opencode/src/kilocode/** * - packages/opencode/test/kilocode/** * - Any path containing "kilocode" in directory or filename + * - Any path with a directory starting with "kilo-" (e.g. kilo-sessions/) */ import { spawnSync } from "node:child_process" @@ -52,7 +53,7 @@ function changedFiles() { function isExempt(file: string) { const norm = file.replaceAll("\\", "/").toLowerCase() - return norm.split("/").some((part) => part.includes("kilocode")) + return norm.split("/").some((part) => part.includes("kilocode") || part.startsWith("kilo-")) } function isSource(file: string) { @@ -180,6 +181,7 @@ console.error( " - packages/opencode/src/kilocode/**", " - packages/opencode/test/kilocode/**", " - Any path containing 'kilocode' in the directory or filename", + " - Any directory starting with 'kilo-' (e.g. kilo-sessions/)", "", "See AGENTS.md for details.", ].join("\n"),