Repository navigation
fix(daemon): dial the local binding with the token the daemon generates - #1676
Merged
Merged
Conversation
An enabled binding with neither a token nor TLS client certificates uses this machine's local token, ~/.infer/daemon/binding.token. The daemon and the chat --daemon TUI filled it in, but LocalDialConfig did not. So on a machine without infer init, which seeds browser_use's fallback token, every infer daemon client command (workspaces, teleport, run, stop) was refused with ErrNoBinding while the daemon was up. LocalDialConfig now fills the local token first, so every local client agrees with the daemon, as docs/daemon.md describes. ErrNoBinding is left for a binding that is off.
Contributor
|
🎉 This PR is included in version 0.240.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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
An enabled daemon binding with neither a token nor TLS client certificates uses this machine's local token,
~/.infer/daemon/binding.token, asdocs/daemon.mddescribes. The daemon and thechat --daemonTUI filled it in, butLocalDialConfigdid not. So on a machine withoutinfer init, which seedsbrowser_use's fallback token, everyinfer daemonclient command (workspaces,teleport,run,stop) was refused withErrNoBindingwhile the daemon was up and listening.LocalDialConfignow fills the local token first, so every local client agrees with the daemon on it.ErrNoBindingis left for a binding that is off, and its message says only that.Found while testing the Tailscale mode of the session teleport example (#1674), where infer-local runs on the host with its own
HOME.Test plan
TestLocalDialConfigDialsWithTheBindingsCredentials: an enabled binding with no token and no client certificates now dials with the local token the daemon reads, instead of failing withErrNoBindinggo test ./internal/daemon/ ./cmd/daemon/ ./internal/presentation/tui/daemonthread/ ./internal/tools/ ./cmd/chat/HOMEwithoutinfer initand adaemon.yamlwith onlybinding.enabledand a port:infer daemon, theninfer daemon workspaceslists the workspaces (refused before)task precommit:run