Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/opencode/src/session/prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1326,7 +1326,7 @@ export const layer = Layer.effect(

const [skills, env, instructions, modelMsgs] = yield* Effect.all([
sys.skills(agent),
sys.environment(model),
sys.environment(model, session.time.created),
instruction.system().pipe(Effect.orDie),
MessageV2.toModelMessagesEffect(msgs, model),
])
Expand Down
6 changes: 3 additions & 3 deletions packages/opencode/src/session/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function provider(model: Provider.Model) {
}

export interface Interface {
readonly environment: (model: Provider.Model) => Effect.Effect<string[]>
readonly environment: (model: Provider.Model, sessionCreated?: number) => Effect.Effect<string[]>
readonly skills: (agent: Agent.Info) => Effect.Effect<string | undefined>
}

Expand All @@ -52,7 +52,7 @@ export const layer = Layer.effect(
const locations = yield* LocationServiceMap

return Service.of({
environment: Effect.fn("SystemPrompt.environment")(function* (model: Provider.Model) {
environment: Effect.fn("SystemPrompt.environment")(function* (model: Provider.Model, sessionCreated?: number) {
const ctx = yield* InstanceState.context
const references = yield* Effect.gen(function* () {
yield* (yield* PluginBoot.Service).wait()
Expand All @@ -67,7 +67,7 @@ export const layer = Layer.effect(
` Workspace root folder: ${ctx.worktree}`,
` Is directory a git repo: ${ctx.project.vcs === "git" ? "yes" : "no"}`,
` Platform: ${process.platform}`,
` Today's date: ${new Date().toDateString()}`,
` Today's date: ${new Date(sessionCreated ?? Date.now()).toDateString()}`,
`</env>`,
].join("\n"),
references.length === 0
Expand Down
Loading