Skip to content

fix(workflows): normalize two-digit years in GetDOBTask#1837

Open
rosetta-livekit-bot[bot] wants to merge 1 commit into
1.5.0from
port-dob-two-digit-years
Open

fix(workflows): normalize two-digit years in GetDOBTask#1837
rosetta-livekit-bot[bot] wants to merge 1 commit into
1.5.0from
port-dob-two-digit-years

Conversation

@rosetta-livekit-bot

@rosetta-livekit-bot rosetta-livekit-bot Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Testing

  • pnpm --filter @livekit/agents typecheck
  • pnpm --filter @livekit/agents lint (passes with existing warnings)
  • pnpm --filter @livekit/agents build

No tests added per porting request.


Ported from livekit/agents#6124

Original PR description

Closes #6067

GetDOBTask's prompt tells the model to normalize two-digit years ("90" likely means 1990), but _update_dob_impl takes year as a raw int with no lower bound. Smaller/faster models often pass the spoken value through literally, and date(90, 5, 15) is a valid Python date (year 90 AD): the future-date check passes, no ToolError is raised, and the task completes with a corrupted birthdate. Because this workflow tends to feed identity/healthcare/fintech intake, it's silent data corruption rather than a visible error.

Fix: normalize year < 100 at the top of _update_dob_impl with a pivot window keyed on the current year, which is exactly what the prompt already promises. 90 -> 1990, 05 -> 2005, 26 -> 2026, 27 -> 1927. Four-digit years are left untouched, so there's no regression. The issue floated a hard floor (raise on year < 1900) as an alternative; I went with normalization since it matches the documented prompt contract and the smaller behavioral change.

Verified:

  • Added tests/test_dob.py (unit, no LLM). It fails on main (date(90, 5, 15) != date(1990, 5, 15)) and passes with the fix.
  • pytest tests/test_dob.py --unit -> 2 passed.
  • ruff check and ruff format --check clean on both files.

@changeset-bot

changeset-bot Bot commented Jun 19, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2a64eae

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 35 packages
Name Type
@livekit/agents Major
@livekit/agents-plugin-anam Major
@livekit/agents-plugin-assemblyai Major
@livekit/agents-plugin-baseten Major
@livekit/agents-plugin-bey Major
@livekit/agents-plugin-cartesia Major
@livekit/agents-plugin-cerebras Major
@livekit/agents-plugin-deepgram Major
@livekit/agents-plugin-did Major
@livekit/agents-plugin-elevenlabs Major
@livekit/agents-plugin-fishaudio Major
@livekit/agents-plugin-google Major
@livekit/agents-plugin-hedra Major
@livekit/agents-plugin-hume Major
@livekit/agents-plugin-inworld Major
@livekit/agents-plugin-lemonslice Major
@livekit/agents-plugin-liveavatar Major
@livekit/agents-plugin-livekit Major
@livekit/agents-plugin-minimax Major
@livekit/agents-plugin-mistral Major
@livekit/agents-plugin-mistralai Major
@livekit/agents-plugin-neuphonic Major
@livekit/agents-plugin-openai Major
@livekit/agents-plugin-perplexity Major
@livekit/agents-plugin-phonic Major
@livekit/agents-plugin-resemble Major
@livekit/agents-plugin-rime Major
@livekit/agents-plugin-runway Major
@livekit/agents-plugin-sarvam Major
@livekit/agents-plugin-silero Major
@livekit/agents-plugin-soniox Major
@livekit/agents-plugin-tavus Major
@livekit/agents-plugins-test Major
@livekit/agents-plugin-trugen Major
@livekit/agents-plugin-xai Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

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.

0 participants