Skip to content

fix(code): explain why doctor has no latest-version answer - #5209

Merged
Mason Daugherty (mdrxy) merged 2 commits into
mainfrom
mdrxy/code/doctor-update-status-reason
Jul 31, 2026
Merged

fix(code): explain why doctor has no latest-version answer#5209
Mason Daugherty (mdrxy) merged 2 commits into
mainfrom
mdrxy/code/doctor-update-status-reason

Conversation

@mdrxy

@mdrxy Mason Daugherty (mdrxy) commented Jul 30, 2026

Copy link
Copy Markdown
Member

dcode doctor now says why it has no latest-version answer — editable install, update checks disabled, a stale cache, or no check ever completed — instead of the blanket unknown (no recent check).


The Updates section could render this, which reads as a contradiction:

Updates ✓
├ Update checks: enabled
├ Auto-updates: disabled (editable install)
├ Latest version: unknown (no recent check)
└ Last checked: 3d ago

Both rows read the same checked_at stamp, but get_cached_update_available applies the 24h cache TTL while the Last checked row does not, and that TTL is invisible in the output. The underlying situation is also worth surfacing: an editable install never contacts PyPI at all (startup auto-update, the in-app background worker, and the update command all bail early), so a stamp on disk was written by another install sharing the state directory — or, for a regular install, by a check that has since started failing, since a failed fetch leaves the stamp untouched.

_format_latest_version now names the cause: not checked (editable install), not checked (checks disabled), unknown (cache stale), or unknown (never checked). A cached answer is still reported whenever one exists.

Rows are deliberately not omitted when they are inert. doctor output is meant to be pasted into bug reports and compared line by line between a working and a broken machine, so the same four labels always render and the --json item labels stay stable; the configured [update] values remain visible even on an editable install, where they are exactly what a triager asks about. No new helper and no TTL arithmetic in doctor: a rejected cached answer plus a recorded stamp already distinguishes stale from never checked. Both rows now share a single stamp read, so they cannot straddle a concurrent cache refresh and disagree.

Freshness is read separately rather than inferred, via a new is_update_cache_fresh in the update-check module: a cache can be current and still hold no usable answer (only pre-release pins were recorded, or a pre-release install meets a stable-only payload), which reports as unknown (cache incomplete) so the row never claims an expiry that did not happen. The helper takes the already-read stamp so the file is still read once.

Made by Open SWE

The `Updates` section could show `Latest version: unknown (no recent
check)` directly above `Last checked: 3d ago`, which reads as a
contradiction. Both rows come from the same `checked_at` stamp, but only
the version row applies the 24h cache TTL, and that TTL was invisible.
The row now names the cause instead — editable install, disabled checks,
stale cache, or never checked — while the row set stays fixed so two
`doctor` outputs remain line-comparable.

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
@github-actions github-actions Bot added dcode Related to `deepagents-code` fix A bug fix (PATCH) internal User is a member of the `langchain-ai` GitHub organization size: S 50-199 LOC labels Jul 30, 2026
@mdrxy
Mason Daugherty (mdrxy) marked this pull request as ready for review July 30, 2026 23:08

@open-swe open-swe 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.

Open SWE Review found 1 potential issue.

Open in WebView Open SWE trace

Comment thread libs/code/deepagents_code/doctor.py Outdated
A `None` cached answer does not imply the cache expired: a pins-only
cache seeded by `_write_release_prerelease_pins`, or a pre-release
install reading a stable-only payload, is current yet has no usable
entry. Add `is_update_cache_fresh` so `doctor` can separate the two and
report `unknown (cache incomplete)` instead of asserting staleness.

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
@github-actions github-actions Bot added size: M 200-499 LOC and removed size: S 50-199 LOC labels Jul 30, 2026
@mdrxy
Mason Daugherty (mdrxy) merged commit ef3e078 into main Jul 31, 2026
69 checks passed
@mdrxy
Mason Daugherty (mdrxy) deleted the mdrxy/code/doctor-update-status-reason branch July 31, 2026 00:09
Mason Daugherty (mdrxy) pushed a commit that referenced this pull request Jul 31, 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).

---

_Release notes preview: keep this section in sync with the package
`CHANGELOG.md`. Publish reads the merged CHANGELOG via `release.yml`,
not this PR description — keep them aligned anyway so the PR stays an
accurate historical record for reviewers and anyone returning later._

---


##
[0.1.51](deepagents-code==0.1.50...deepagents-code==0.1.51)
(2026-07-31)

### Features

- The status bar and usage view now show the running session cost.
([#5036](#5036))
- Removed redundant `shell` and `web_search` prompt guidance.
([#5213](#5213))
- After switching threads, Deep Agents now points back to the previous
thread.
([#5172](#5172))
- Leaving `/mcp` with pending toggles now prompts you to reconnect.
([#5211](#5211))
- `dcode config get` now accepts configuration sections.
([#5134](#5134))

### Fixes

- Kept the `/goal` criteria prompt responsive.
([#5142](#5142))
- Improved goal handling so underspecified objectives can be resolved
from conversation context.
([#5201](#5201))
- Released the turn when an interrupted worker never starts.
([#5196](#5196))
- Hid timestamp footers together with their associated rows.
([#5167](#5167))
- Fixed editable SDK detection by scanning and correlating SDK locations
more accurately.
([#5199](#5199))
- Improved `doctor` output to explain why it may not have a
latest-version answer.
([#5209](#5209))

_End release notes preview._

---

> [!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: langchain-oss-automated-triage[bot] <248757908+langchain-oss-automated-triage[bot]@users.noreply.github.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` fix A bug fix (PATCH) internal User is a member of the `langchain-ai` GitHub organization size: M 200-499 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant