feat: allow overriding system prompt date via OPENCODE_DATE env var#28546
Open
nilo85 wants to merge 1 commit into
Open
feat: allow overriding system prompt date via OPENCODE_DATE env var#28546nilo85 wants to merge 1 commit into
nilo85 wants to merge 1 commit into
Conversation
Enables deterministic LLM request replay in CI integration tests by fixing the date string in the system prompt.
Author
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Enables deterministic LLM request replay in CI integration tests by fixing the date string in the system prompt.
Issue for this PR
Type of change
What does this PR do?
The system prompt in session/system.ts includes a dynamic Today's date: ${new Date().toDateString()} line. This makes it impossible to match recorded LLM requests when replaying them in CI integration tests, since the date changes every day.
This PR adds an OPENCODE_DATE environment variable that overrides the date string when set, falling back to the real date otherwise. It follows the established RuntimeFlags pattern used for other runtime overrides in the project.
How did you verify your code works?
I built it locally, and ran:
Then I verified the system promt in the capture of llama-swap (see comment)
Screenshots / recordings
N/A — no UI changes.
Checklist