Skip to content

feat(daemon): a chat says once when the daemon it joins runs another build - #1972

Merged
edenreich merged 2 commits into
mainfrom
feat/issue-1966
Nov 24, 2026
Merged

edenreich merged 2 commits into
mainfrom
feat/issue-1966

Conversation

@edenreich

@edenreich edenreich commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #1966.

A daemon runs until idle_exit passes with no threads and no clients, and every dev build declares the version dev, so a chat built from newer code joined an older daemon without a word, and whatever the new code added on the daemon's side was silently missing. That is how the room approvals of #1963 never appeared during testing: the daemon and its members ran a branch without them.

  • The daemon declares a build identity. Its hello ack carries build, the SHA-256 of its executable, which tells two dev builds of one version apart and two releases too.

  • A chat that joins a daemon of another build says so once and keeps working:

    ✗ infer daemon runs another build than this chat, so what this build changed there is missing - stop it (pid 86806) and run again
    

    Both infer chat --daemon and a plain chat's rooms warn, on the first connection and again only if a reconnect lands on yet another build. A daemon that declares no build predates this change and counts as another build.

  • Released builds compare the same way, so a chat after an upgrade notices a daemon still running the previous version.

  • docs/daemon.md describes the notice under the chat TUI section.

Verification

  • In tmux against the tokenless mock, with an isolated HOME and binding port:
    • a daemon built from main and a chat built from this branch: the notice above appeared with the daemon's real pid, and a turn ran to Done.
    • the same binary as daemon and chat: no notice
  • TestBuildNoticeTellsAnotherBuildApart: the same build, another build and a daemon declaring none, with and without a pid file.
  • TestSessionlessThreadSaysOnceThatTheDaemonRunsAnotherBuild: a plain chat's rooms dial warns once across two requests, and a same-build daemon never warns.
  • TestThreadHandsTheBuildNoticeOverOnce: the --daemon chat path hands the notice over once.
  • go test -race for internal/daemon and internal/presentation/tui/daemonthread, golangci-lint, the import check and task precommit:run.
  • Not run: Windows.

Cross-repo impact

…build

A daemon runs until idle_exit passes, and every dev build declares the version
dev, so a chat built from newer code joined an older daemon without a word and
whatever the new code added on the daemon's side was silently missing. The
daemon now declares the SHA-256 of its executable as build in its hello ack.
A chat whose own build differs, or that meets a daemon declaring none, shows
once that the daemon runs another build, names its pid to stop and keeps
working. Released builds compare the same way, so a chat after an upgrade
notices the daemon still running the previous version.

Verified in tmux against the tokenless mock: a daemon built from main with a
chat from this branch shows the notice with the daemon's pid and still runs a
turn, and the same binary as daemon and chat shows nothing.
…t earned

The thread kept the finished notice text to decide whether it had already
told the UI about another build, so the field named a build but held a
sentence. It now stores the raw build from the daemon's ack and words the
notice when the UI takes it.
@edenreich
edenreich merged commit dbd131e into main Nov 24, 2026
14 checks passed
@edenreich
edenreich deleted the feat/issue-1966 branch November 24, 2026 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

[FEATURE] A chat warns when the daemon it joins runs another build

1 participant