fix: remove Current date from env context since OpenCode already provides it

date is already injected by OpenCode's system.ts. omo-env now contains only
Timezone and Locale, which are stable across requests and never break cache.
This commit is contained in:
YeonGyu-Kim
2026-02-26 20:22:17 +09:00
parent 0b69a6c507
commit 088984a8d4
2 changed files with 6 additions and 14 deletions
-9
View File
@@ -5,20 +5,11 @@
* See: https://github.com/code-yeongyu/oh-my-opencode/issues/379
*/
export function createEnvContext(): string {
const now = new Date()
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone
const locale = Intl.DateTimeFormat().resolvedOptions().locale
const dateStr = now.toLocaleDateString(locale, {
weekday: "short",
year: "numeric",
month: "short",
day: "numeric",
})
return `
<omo-env>
Current date: ${dateStr}
Timezone: ${timezone}
Locale: ${locale}
</omo-env>`