fix: kilocode markers

This commit is contained in:
Catriel Müller
2026-05-08 14:54:30 -03:00
parent 71067656e2
commit cd67db9501
8 changed files with 28 additions and 19 deletions
+3 -1
View File
@@ -45,16 +45,18 @@ export const layer = Layer.effect(
// Plugin can mutate config so it has to be initialized before anything else.
yield* plugin.init()
yield* Effect.promise(() => KilocodeBootstrap.init()).pipe(Effect.forkDetach) // kilocode_change
// kilocode_change start - shareNext removed from list, handled by KilocodeBootstrap
yield* Effect.all(
[
lsp,
/* shareNext, kilocode_change - handled by KilocodeBootstrap */ format,
format,
file,
fileWatcher,
vcs,
snapshot,
].map((s) => Effect.forkDetach(s.init())),
).pipe(Effect.withSpan("InstanceBootstrap.init"))
// kilocode_change end
const projectID = ctx.project.id
yield* bus.subscribeCallback(Command.Event.Executed, async (payload) => {
@@ -1,4 +1,4 @@
// kilocode_change new file
// kilocode_change - new file
import { fetchKiloModels, type KiloModelsResult } from "@kilocode/kilo-gateway"
import { Config } from "../config/config"
import { Auth } from "../auth"
@@ -3,7 +3,7 @@ import { Config } from "@/config/config"
import { ModelsDev } from "@/provider/models"
import { Provider } from "@/provider/provider"
import { ProviderID } from "@/provider/schema"
import { mapValues, pickBy } from "remeda"
import { mapValues, pickBy } from "remeda" // kilocode_change
import { ModelCache } from "@/provider/model-cache" // kilocode_change
import { Effect, Schema } from "effect"
import { HttpServerRequest, HttpServerResponse } from "effect/unstable/http"
@@ -274,7 +274,7 @@ export const sessionHandlers = HttpApiBuilder.group(InstanceHttpApi, "session",
params: { sessionID: SessionID }
payload: typeof PromptPayload.Type
}) {
// kilocode_change - cast to bridge schema-readonly→PromptInput-mutable; matches legacy Hono session.ts
// kilocode_change start - cast to bridge schema-readonly→PromptInput-mutable; matches legacy Hono session.ts
yield* promptSvc
.prompt({ ...ctx.payload, sessionID: ctx.params.sessionID } as unknown as SessionPrompt.PromptInput)
.pipe(
@@ -289,6 +289,7 @@ export const sessionHandlers = HttpApiBuilder.group(InstanceHttpApi, "session",
),
Effect.forkIn(scope, { startImmediately: true }),
)
// kilocode_change end
return HttpApiSchema.NoContent.make()
})
@@ -82,12 +82,14 @@ export const ProjectRoutes = lazy(() =>
Project.Service.use((svc) => svc.initGit({ directory: dir, project: prev })),
)
if (next.id === prev.id && next.vcs === prev.vcs && next.worktree === prev.worktree) return c.json(next)
// kilocode_change start
await InstanceStore.reloadInstance({
directory: dir,
worktree: dir,
project: next,
init: await getBootstrapRunEffect(),
})
// kilocode_change end
return c.json(next)
},
)
+1 -1
View File
@@ -84,7 +84,7 @@ export const layer: Layer.Layer<
}
// kilocode_change - prefer KILO_CONFIG_DIR profile when set, else fall back to global.config
const root = Flag.KILO_CONFIG_DIR ?? global.config
return yield* fs.globUp(instruction, root, root).pipe(Effect.catch(() => Effect.succeed([] as string[])))
return yield* fs.globUp(instruction, root, root).pipe(Effect.catch(() => Effect.succeed([] as string[]))) // kilocode_change
})
const read = Effect.fnUntraced(function* (filepath: string) {
@@ -22,22 +22,25 @@ const writeConfig = (dir: string, agent: Config.Info["agent"]) =>
),
)
// kilocode_change start
it.live("agent color parsed from project config", () =>
Effect.gen(function* () {
const dir = yield* tmpdirScoped()
yield* writeConfig(dir, {
code: { color: "#FFA500" }, // kilocode_change
code: { color: "#FFA500" },
plan: { color: "primary" },
})
yield* Effect.gen(function* () {
const cfg = yield* Effect.promise(() => AppRuntime.runPromise(Config.Service.use((svc) => svc.get())))
expect(cfg.agent?.["code"]?.color).toBe("#FFA500") // kilocode_change
expect(cfg.agent?.["code"]?.color).toBe("#FFA500")
expect(cfg.agent?.["plan"]?.color).toBe("primary")
}).pipe(provideInstance(dir))
}),
)
// kilocode_change end
// kilocode_change start
it.live("Agent.get includes color from config", () =>
Effect.gen(function* () {
const dir = yield* tmpdirScoped()
@@ -54,6 +57,7 @@ it.live("Agent.get includes color from config", () =>
}).pipe(provideInstance(dir))
}),
)
// kilocode_change end
test("Color.hexToAnsiBold converts valid hex to ANSI", () => {
const result = Color.hexToAnsiBold("#FFA500")
@@ -7,12 +7,12 @@ export const iconNames = [
"zai",
"zai-coding-plan",
"xiaomi",
"xiaomi-token-plan-sgp",
"xiaomi-token-plan-cn",
"xiaomi-token-plan-ams",
"xiaomi-token-plan-sgp", // kilocode_change
"xiaomi-token-plan-cn", // kilocode_change
"xiaomi-token-plan-ams", // kilocode_change
"xai",
"wandb",
"wafer.ai",
"wafer.ai", // kilocode_change
"vultr",
"vivgrid",
"vercel",
@@ -20,8 +20,8 @@ export const iconNames = [
"v0",
"upstage",
"togetherai",
"the-grid-ai",
"tencent-tokenhub",
"the-grid-ai", // kilocode_change
"tencent-tokenhub", // kilocode_change
"tencent-coding-plan",
"synthetic",
"submodel",
@@ -32,7 +32,7 @@ export const iconNames = [
"scaleway",
"sap-ai-core",
"requesty",
"regolo-ai",
"regolo-ai", // kilocode_change
"qiniu-ai",
"qihang-ai",
"privatemode-ai",
@@ -55,7 +55,7 @@ export const iconNames = [
"moonshotai-cn",
"modelscope",
"moark",
"mixlayer",
"mixlayer", // kilocode_change
"mistral",
"minimax",
"minimax-coding-plan",
@@ -64,7 +64,7 @@ export const iconNames = [
"meganova",
"lucidquery",
"lmstudio",
"llmgateway",
"llmgateway", // kilocode_change
"llama",
"kuae-cloud-coding-plan",
"kimi-for-coding",
@@ -75,7 +75,7 @@ export const iconNames = [
"inception",
"iflowcn",
"huggingface",
"hpc-ai",
"hpc-ai", // kilocode_change
"helicone",
"groq",
"google",
@@ -91,7 +91,7 @@ export const iconNames = [
"evroc",
"drun",
"dinference",
"digitalocean",
"digitalocean", // kilocode_change
"deepseek",
"deepinfra",
"cortecs",
@@ -114,7 +114,7 @@ export const iconNames = [
"alibaba-coding-plan-cn",
"alibaba-cn",
"aihubmix",
"abliteration-ai",
"abliteration-ai", // kilocode_change
"abacus",
"302ai",
] as const