Skip to content

Commit 449d956

Browse files
committed
fix(typecheck): resolve post-rebase type errors
- Add missing Flag import in prompt.ts and skill/index.ts - Update instruction.test.ts assertion for new system() return type - Fix llm.test.ts to use withTestInstance helper and pass ctx correctly
1 parent a0a82ad commit 449d956

4 files changed

Lines changed: 33 additions & 25 deletions

File tree

packages/opencode/src/session/prompt.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import { SessionProcessor } from "./processor"
3737
import { Tool } from "@/tool/tool"
3838
import { Permission } from "@/permission"
3939
import { SessionStatus } from "./status"
40+
import { Flag } from "@opencode-ai/core/flag/flag"
4041
import { LLM } from "./llm"
4142
import { Shell } from "@/shell/shell"
4243
import { ShellID } from "@/tool/shell/id"

packages/opencode/src/skill/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { AppFileSystem } from "@opencode-ai/core/filesystem"
1111
import { Config } from "@/config/config"
1212
import { ConfigMarkdown } from "@/config/markdown"
1313
import { RuntimeFlags } from "@/effect/runtime-flags"
14+
import { Flag } from "@opencode-ai/core/flag/flag"
1415
import { Glob } from "@opencode-ai/core/util/glob"
1516
import { withStatics } from "@opencode-ai/core/schema"
1617
import * as Log from "@opencode-ai/core/util/log"

packages/opencode/test/session/instruction.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ describe("Instruction.system", () => {
229229
const paths = yield* svc.systemPaths()
230230
expect(paths.has(path.join(globalTmp, ".claude", "CLAUDE.md"))).toBe(false)
231231
expect(paths.has(path.join(projectTmp, "CLAUDE.md"))).toBe(false)
232-
expect(yield* svc.system()).toEqual([])
232+
expect(yield* svc.system()).toEqual({ global: [], project: [] })
233233
}).pipe(
234234
provideInstance(projectTmp),
235235
provideInstruction({ home: globalTmp, config: globalTmp }, { disableClaudeCodePrompt: true }),

packages/opencode/test/session/llm.test.ts

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1375,10 +1375,10 @@ describe("session.llm.stream", () => {
13751375
},
13761376
})
13771377

1378-
await WithInstance.provide({
1378+
await withTestInstance({
13791379
directory: tmp.path,
1380-
fn: async () => {
1381-
const resolved = await getModel(ProviderID.make("anthropic"), ModelID.make(model.id))
1380+
fn: async (ctx) => {
1381+
const resolved = await getModel(ProviderID.make("anthropic"), ModelID.make(model.id), ctx)
13821382
const sessionID = SessionID.make("session-test-split-system")
13831383
const agent = {
13841384
name: "test",
@@ -1396,15 +1396,18 @@ describe("session.llm.stream", () => {
13961396
model: { providerID: ProviderID.make("anthropic"), modelID: resolved.id },
13971397
} satisfies MessageV2.User
13981398

1399-
await drain({
1400-
user,
1401-
sessionID,
1402-
model: resolved,
1403-
agent,
1404-
system: { stable: ["Global instructions"], dynamic: ["Project instructions"] },
1405-
messages: [{ role: "user", content: "Hello" }],
1406-
tools: {},
1407-
})
1399+
await drain(
1400+
{
1401+
user,
1402+
sessionID,
1403+
model: resolved,
1404+
agent,
1405+
system: { stable: ["Global instructions"], dynamic: ["Project instructions"] },
1406+
messages: [{ role: "user", content: "Hello" }],
1407+
tools: {},
1408+
},
1409+
ctx,
1410+
)
14081411

14091412
const capture = await request
14101413
const body = capture.body
@@ -1481,10 +1484,10 @@ describe("session.llm.stream", () => {
14811484
},
14821485
})
14831486

1484-
await WithInstance.provide({
1487+
await withTestInstance({
14851488
directory: tmp.path,
1486-
fn: async () => {
1487-
const resolved = await getModel(ProviderID.make("anthropic"), ModelID.make(model.id))
1489+
fn: async (ctx) => {
1490+
const resolved = await getModel(ProviderID.make("anthropic"), ModelID.make(model.id), ctx)
14881491
const sessionID = SessionID.make("session-test-flat-system")
14891492
const agent = {
14901493
name: "test",
@@ -1502,15 +1505,18 @@ describe("session.llm.stream", () => {
15021505
model: { providerID: ProviderID.make("anthropic"), modelID: resolved.id },
15031506
} satisfies MessageV2.User
15041507

1505-
await drain({
1506-
user,
1507-
sessionID,
1508-
model: resolved,
1509-
agent,
1510-
system: ["Combined instructions"],
1511-
messages: [{ role: "user", content: "Hello" }],
1512-
tools: {},
1513-
})
1508+
await drain(
1509+
{
1510+
user,
1511+
sessionID,
1512+
model: resolved,
1513+
agent,
1514+
system: ["Combined instructions"],
1515+
messages: [{ role: "user", content: "Hello" }],
1516+
tools: {},
1517+
},
1518+
ctx,
1519+
)
15141520

15151521
const capture = await request
15161522
const body = capture.body

0 commit comments

Comments
 (0)