Skip to content

fix(code): show months instead of "0y ago" for 360-364 day old timestamps#4267

Merged
Mason Daugherty (mdrxy) merged 2 commits into
langchain-ai:mainfrom
parveshsaini:parveshsaini/code/relative-timestamp-year-gap
Jun 25, 2026
Merged

fix(code): show months instead of "0y ago" for 360-364 day old timestamps#4267
Mason Daugherty (mdrxy) merged 2 commits into
langchain-ai:mainfrom
parveshsaini:parveshsaini/code/relative-timestamp-year-gap

Conversation

@parveshsaini

@parveshsaini Parvesh (parveshsaini) commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Fixes #4265


Summary

format_relative_timestamp showed "0y ago" for timestamps 360–364 days old, since the months branch stopped at days < 360 but the years branch only kicks in at days >= 365. This closes that gap so those dates show "12mo ago".

User story: with relative timestamps enabled, opening the /threads switcher to resume an old session shows each thread's age. A thread last touched ~360–364 days ago reads "0y ago", which looks broken and is hard to tell apart from a brand-new thread. The same helper formats the released … ago line on the update notice, so that hits the gap too. After this fix both read "12mo ago".

I came across it while reading the timestamp bucketing, the month bucket divides by 30 and the year bucket by 365, so I checked the boundary between them and confirmed 360–364 days falls through to "0y ago".

No breaking changes; only the 360–364 day range is affected.

How I verified: added a boundary test that fails on main and passes here, and ran make format, make lint, and make test for the code package.

Social handles (optional)

Twitter: @PrvshHasNoLife
LinkedIn: https://www.linkedin.com/in/saini-parvesh/

@github-actions github-actions Bot added dcode Related to `deepagents-code` fix A bug fix (PATCH) size: XS < 50 LOC labels Jun 25, 2026
@langchain-oss-automated-triage langchain-oss-automated-triage Bot added new-contributor First-time contributor to this repo external User is not a member of the `langchain-ai` GitHub organization labels Jun 25, 2026
@mdrxy

Copy link
Copy Markdown
Member

thanks - how did you encounter this OOC? can you update PR description with a user story of where this resolves?

@parveshsaini

Parvesh (parveshsaini) commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

From a user's perspective, this can show up in places like the /threads switcher (which displays thread age) and the release update notice ("released ... ago"). So if a thread or release is almost a year old, it can end up showing "0y ago", which doesn't look quite right.

I've updated the PR description with that user-facing example as well.

Mason Daugherty (@mdrxy)

@mdrxy
Mason Daugherty (mdrxy) merged commit 820b331 into langchain-ai:main Jun 25, 2026
49 checks passed
Mason Daugherty (mdrxy) added a commit that referenced this pull request Jun 26, 2026
> [!CAUTION]
> Merging this PR will automatically publish to **PyPI** and create a
**GitHub release**.

For the full release process, see
[`.github/RELEASING.md`](https://github.com/langchain-ai/deepagents/blob/main/.github/RELEASING.md).

---

_Everything below this line will be the GitHub release body._

---


##
[0.1.25](deepagents-code==0.1.24...deepagents-code==0.1.25)
(2026-06-26)

### Bug Fixes

* Bind ephemeral port instead of squatting `langgraph dev`'s 2024
([#4264](#4264))
([11e5359](11e5359))
* Block dotenv shell startup hooks
([#4288](#4288))
([686d6f3](686d6f3))
* Defer server graph construction
([#4300](#4300))
([220dfc0](220dfc0))
* Avoid blocking MCP imports during graph readiness
([#4302](#4302))
([7533ca8](7533ca8))
* Gate `delete` file operations
([#4299](#4299))
([92a8681](92a8681))
* Handle recursive `fetch_url` conversion
([#4257](#4257))
([f240a40](f240a40))
* Report editable SDK runtime version
([#4304](#4304))
([4439e91](4439e91))
* Show months instead of "0y ago" for 360-364 day old timestamps
([#4267](#4267))
([820b331](820b331))
* Surface `/auth`-stored credentials in `config show`/`get`
([#4258](#4258))
([c7c8788](c7c8788))
* Switch input mode without flashing the mode trigger
([#4243](#4243))
([fc5d9cb](fc5d9cb))

---

_Everything above this line will be the GitHub release body._

---

> [!NOTE]
> A **New Contributors** section is appended to the GitHub release notes
automatically at publish time (see [Release
Pipeline](https://github.com/langchain-ai/deepagents/blob/main/.github/RELEASING.md#release-pipeline),
step 2).

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Mason Daugherty <github@mdrxy.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dcode Related to `deepagents-code` external User is not a member of the `langchain-ai` GitHub organization fix A bug fix (PATCH) new-contributor First-time contributor to this repo size: XS < 50 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

format_relative_timestamp shows "0y ago" for timestamps 360–364 days old

2 participants