Skip to content

Commit 95efe66

Browse files
committed
fix: avoid stale system prompt instance context
1 parent e17df09 commit 95efe66

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

packages/opencode/src/session/system.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Context, Effect, Layer } from "effect"
22

3-
import { InstanceState } from "@/effect"
3+
import { Instance } from "../project/instance"
44

55
import PROMPT_ANTHROPIC from "./prompt/anthropic.txt"
66
import PROMPT_DEFAULT from "./prompt/default.txt"
@@ -43,18 +43,18 @@ export const layer = Layer.effect(
4343
Service,
4444
Effect.gen(function* () {
4545
const skill = yield* Skill.Service
46-
const ctx = yield* InstanceState.context
4746

4847
return Service.of({
4948
environment(model) {
49+
const project = Instance.project
5050
return [
5151
[
5252
`You are powered by the model named ${model.api.id}. The exact model ID is ${model.providerID}/${model.api.id}`,
5353
`Here is some useful information about the environment you are running in:`,
5454
`<env>`,
55-
` Working directory: ${ctx.directory}`,
56-
` Workspace root folder: ${ctx.worktree}`,
57-
` Is directory a git repo: ${ctx.project.vcs === "git" ? "yes" : "no"}`,
55+
` Working directory: ${Instance.directory}`,
56+
` Workspace root folder: ${Instance.worktree}`,
57+
` Is directory a git repo: ${project.vcs === "git" ? "yes" : "no"}`,
5858
` Platform: ${process.platform}`,
5959
` Today's date: ${new Date().toDateString()}`,
6060
`</env>`,

0 commit comments

Comments
 (0)