Skip to content

daemon status: say running=false when offline; upgrading notes for editable installs - #16

Merged
erfnzdeh merged 2 commits into
mainfrom
fix/daemon-status-offline
Sep 4, 2026
Merged

daemon status: say running=false when offline; upgrading notes for editable installs#16
erfnzdeh merged 2 commits into
mainfrom
fix/daemon-status-offline

Conversation

@erfnzdeh

@erfnzdeh erfnzdeh commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Two follow-ups found by the final fresh-clone verification of 2.0.0.

  • daemon status with no daemon running printed result: {} (and therefore nothing useful in human mode): DaemonStatus inherited omit_defaults=True, so an offline status where every field equals its default encoded to an empty object. DaemonStatus and HealthSummary now always emit their fields; the offline path fills socket, layer and socket_owner. A registry-contract test pins agent.schema as the only json-only op, and three tests cover the offline case for daemon status and the status shortcut.
  • docs/UPGRADING.md gains the pipx editable-install variant of step 2 (the checkout is the install: stop the daemon and any watchdog first, move the checkout, install the new dependencies into the pipx venv).

`DaemonStatus` inherited `omit_defaults=True`, which drops every field equal
to its default — and for a stopped daemon that is every field. The result
encoded to `{}`: human mode printed nothing at all, `--json` printed an empty
object, and `status["running"]` raised a KeyError for the one caller the flag
exists for. The operation that exists to tell you the daemon is down was the
operation that could not say so.

`omit_defaults=False` on the struct, as `WhoAmI` already carries it for the
same reason. The offline result also fills in the socket it would have asked
and the Telethon layer, so "not running" says where it looked, and `version`
is `None` rather than `""` because nobody read a version off a process that
is not there.

`HealthSummary` behind `tlgr status` had the same shape and the same fix: it
is read when nothing works, which is exactly when every answer on it is
false.

The `json-only` tag was the other suspect and is not implicated — `daemon
status` never carried it — but nothing said so. `agent.schema` is the only op
that may, and now a test holds that line.
§2 assumed `pipx upgrade tlgr`, which does nothing for an install made with
`pipx install -e <checkout>`: the venv holds a link to that working tree, so
the running version is whatever the checkout is on and the upgrade is a `git`
command. That is the part worth writing down — moving the branch swaps the
code under a running daemon with no install step in between, so §1 and the
watchdog it names are load-bearing here rather than housekeeping.

The reinstall is conditional and 2.0.0 is the condition: it adds msgspec and
pins telethon~=1.44.0, and a `git checkout` puts neither into the pipx venv.
`pipx runpip tlgr install -e '<checkout>[fast]'` does, with a note that it
replaces the extra set rather than adding to it.
@erfnzdeh
erfnzdeh merged commit c2303b9 into main Sep 4, 2026
9 of 10 checks passed
@erfnzdeh
erfnzdeh deleted the fix/daemon-status-offline branch September 4, 2026 15:30
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.

1 participant