Files
oh-my-openagent/src/agents/env-context.ts
YeonGyu-Kim 088984a8d4 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.
2026-02-26 20:22:17 +09:00

17 lines
569 B
TypeScript

/**
* Creates OmO-specific environment context (timezone, locale).
* Note: Working directory, platform, and date are already provided by OpenCode's system.ts,
* so we only include fields that OpenCode doesn't provide to avoid duplication.
* See: https://github.com/code-yeongyu/oh-my-opencode/issues/379
*/
export function createEnvContext(): string {
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone
const locale = Intl.DateTimeFormat().resolvedOptions().locale
return `
<omo-env>
Timezone: ${timezone}
Locale: ${locale}
</omo-env>`
}