Skip to content

fix: Include current date in AI generation context#36

Open
spenceriam wants to merge 1 commit intomainfrom
fix/bug-19-ai-model-date
Open

fix: Include current date in AI generation context#36
spenceriam wants to merge 1 commit intomainfrom
fix/bug-19-ai-model-date

Conversation

@spenceriam
Copy link
Owner

@spenceriam spenceriam commented Nov 3, 2025

Summary

Fixes issue where AI models were using incorrect dates in generated documents by including the current browser date in generation context.

Changes Made

  • Added current date retrieval from browser to all prompt generation functions
  • Updated buildRequirementsPrompt, buildDesignPrompt, and buildTasksPrompt to include current date
  • Modified getSystemPromptForPhase to include date context in system prompts
  • Ensures AI models generate documents with correct current date

Testing

  • Generated requirements, design, and tasks - all include correct current date
  • Date is displayed in a human-readable format (e.g., "November 2, 2024")
  • AI models now reference the correct date when planning timelines or schedules

Fixes #19


Note

Adds the browser’s current date to system and user prompts for requirements, design, and tasks to ensure accurate date references.

  • Prompts:
    • System prompts: getSystemPromptForPhase now appends a date context using the browser’s current date.
    • User prompts: buildRequirementsPrompt, buildDesignPrompt, and buildTasksPrompt embed Current Date: ... in generated prompts.
    • Minor: small guard added in buildRequirementsPrompt to respect remaining prompt size when appending context files.

Written by Cursor Bugbot for commit 7c163a7. This will update automatically on new commits. Configure here.

- Add current date from browser to all prompt generation functions
- Update buildRequirementsPrompt, buildDesignPrompt, and buildTasksPrompt
- Update getSystemPromptForPhase to include date context
- This ensures AI models use correct current date when generating documents

Fixes #19
@vercel
Copy link

vercel bot commented Nov 3, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
open-spec Ready Ready Preview Comment Nov 3, 2025 1:36am

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.


// Phase-specific prompt builders matching Kiro IDE's approach
function buildRequirementsPrompt(featureName: string, description: string, contextFiles: ContextFile[]): string {
// Get current date from browser
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Inconsistent Date Context in Refinement Prompts

The getRefinementPromptForPhase function was not updated to include current date context, unlike other prompt generation functions. This creates an inconsistency where AI models receive date context during initial generation but not during refinement, potentially causing incorrect or inconsistent date references when refining content involving timelines or scheduling.

Fix in Cursor Fix in Web

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.

bug: AI model does not recognize current time when generation phases are occuring

1 participant