Repository navigation
feat(daemon): a chat says once when the daemon it joins runs another build - #1972
Merged
Merged
Conversation
…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.
2 tasks
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #1966.
A daemon runs until
idle_exitpasses with no threads and no clients, and every dev build declares the versiondev, 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:
Both
infer chat --daemonand 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.mddescribes the notice under the chat TUI section.Verification
HOMEand binding port:mainand a chat built from this branch: the notice above appeared with the daemon's real pid, and a turn ran toDone.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--daemonchat path hands the notice over once.go test -raceforinternal/daemonandinternal/presentation/tui/daemonthread, golangci-lint, the import check andtask precommit:run.Cross-repo impact
cli.md, next toinfer daemon stop.