Skip to content

Fix missing models.dev date handling for created_at metadata#652

Merged
crmne merged 1 commit into
crmne:mainfrom
afurm:fix/models-dev-created-at-nil
Mar 4, 2026
Merged

Fix missing models.dev date handling for created_at metadata#652
crmne merged 1 commit into
crmne:mainfrom
afurm:fix/models-dev-created-at-nil

Conversation

@afurm

@afurm afurm commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

What this does

Fixes an edge case in Models.models_dev_model_to_info where created_at was built from a blank date when both release_date and last_updated were missing.

Before this fix, it could build " 00:00:00 UTC", which later parsed to the current date, causing incorrect and non-deterministic created_at values in model metadata.

This PR:

  • Sets created_at only when a non-blank date is present.
  • Keeps created_at as nil when both source dates are missing.
  • Adds a regression test covering this nil-date case.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Performance improvement

Scope check

  • I read the Contributing Guide
  • This aligns with RubyLLM's focus on LLM communication
  • This isn't application-specific logic that belongs in user code
  • This benefits most users, not just my specific use case

Required for new features

  • I opened an issue before writing code and received maintainer approval
  • Linked issue: #___

PRs for new features or enhancements without a prior approved issue will be closed.

Quality check

  • I ran overcommit --install and all hooks pass
  • I tested my changes thoroughly
  • For provider changes: Re-recorded VCR cassettes with bundle exec rake vcr:record[provider_name]
  • All tests pass: bundle exec rspec
  • I updated documentation if needed
  • I didn't modify auto-generated files manually (models.json, aliases.json)

AI-generated code

  • I used AI tools to help write this code
  • I have reviewed and understand all generated code (required if above is checked)

API changes

  • Breaking change
  • New public methods/classes
  • Changed method signatures
  • No API changes

@crmne crmne merged commit d940984 into crmne:main Mar 4, 2026
19 checks passed
@codecov

codecov Bot commented Mar 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.37%. Comparing base (97c0546) to head (9daceb1).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #652   +/-   ##
=======================================
  Coverage   81.36%   81.37%           
=======================================
  Files         116      116           
  Lines        5425     5427    +2     
  Branches     1426     1427    +1     
=======================================
+ Hits         4414     4416    +2     
  Misses       1011     1011           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@afurm afurm deleted the fix/models-dev-created-at-nil branch March 4, 2026 15:51
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.

2 participants