Skip to content

feat: allow overriding system prompt date via OPENCODE_DATE env var#4

Draft
nilo85 wants to merge 1 commit into
devfrom
feat/date-override
Draft

feat: allow overriding system prompt date via OPENCODE_DATE env var#4
nilo85 wants to merge 1 commit into
devfrom
feat/date-override

Conversation

@nilo85

@nilo85 nilo85 commented May 20, 2026

Copy link
Copy Markdown
Owner

Allows overriding the Today's date string in the system prompt via the OPENCODE_DATE environment variable.

Use case: Running opencode in integration tests with recorded LLM request replay. The dynamic date string makes it impossible to match recorded requests without hacks on the playback side. Setting OPENCODE_DATE to a fixed value enables deterministic replay matching.

Usage:

OPENCODE_DATE="Thu Jan 01 2025" opencode

Changes:

  • Added dateOverride flag to RuntimeFlags service (OPENCODE_DATE env var)
  • SystemPrompt.environment uses the override when set, falls back to new Date().toDateString() otherwise
  • Follows the established RuntimeFlags pattern used for other runtime overrides

Enables deterministic LLM request replay in CI integration tests by
fixing the date string in the system prompt.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant