feat(core): render CodeMode catalog deltas from structured snapshots (#38183)

This commit is contained in:
Aiden Cline 2026-07-24 10:20:26 -05:00 committed by GitHub
commit 4605308be2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 565 additions and 431 deletions

View file

@ -844,12 +844,19 @@ describe("SessionRunnerLLM", () => {
output: Schema.String,
execute: () => Effect.sync(() => executed.push(name)).pipe(Effect.as({ output: name })),
})
const catalog = (name: string) => [
{
path: `catalog.${name.toLowerCase()}`,
description: `Code Mode catalog ${name}`,
signature: `tools.catalog.${name.toLowerCase()}(input: {}): Promise<string>`,
},
]
const session = yield* setup
codeModeMaterializations = [
{ instructions: "Code Mode catalog A", tool: execute("A") },
{ instructions: "Code Mode catalog B", tool: execute("B") },
{ instructions: "Code Mode catalog C", tool: execute("C") },
{ instructions: "Code Mode catalog D", tool: execute("D") },
{ catalog: catalog("A"), tool: execute("A") },
{ catalog: catalog("B"), tool: execute("B") },
{ catalog: catalog("C"), tool: execute("C") },
{ catalog: catalog("D"), tool: execute("D") },
]
yield* admit(session, "Use Code Mode")
responses = [reply.tool("call-execute", "execute", {}), reply.stop()]
@ -1036,9 +1043,7 @@ describe("SessionRunnerLLM", () => {
input: Schema.Struct({}),
output: Schema.Struct({ value: Schema.String }),
execute: () =>
Effect.sync(() => executions.push("advertised")).pipe(
Effect.as({ output: { value: "advertised" } }),
),
Effect.sync(() => executions.push("advertised")).pipe(Effect.as({ output: { value: "advertised" } })),
}),
},
{ codemode: false },
@ -1067,9 +1072,7 @@ describe("SessionRunnerLLM", () => {
input: Schema.Struct({}),
output: Schema.Struct({ value: Schema.String }),
execute: () =>
Effect.sync(() => executions.push("replacement")).pipe(
Effect.as({ output: { value: "replacement" } }),
),
Effect.sync(() => executions.push("replacement")).pipe(Effect.as({ output: { value: "replacement" } })),
}),
},
{ codemode: false },