Skip to content

v0.3.0

Choose a tag to compare

@github-actions github-actions released this 20 Nov 20:52
· 1005 commits to main since this release

Added

  • --user for the install script: it installs the binary and the user-level service for the account that runs the script without asking for the installation level. --system and --user both skip the question; the script refuses --user when it runs as root.
  • agent-peer uninstall removes the service, the binary, the runtime directory and the account's MCP registration, and asks once before also removing the configuration, identity, audit and service logs; --purge skips the question. Root removes the system-level installation, and another account with only that installation is asked once before the command re-runs itself through sudo. When the data is removed at the system level, the administration group is removed too, but only when the installation recorded creating it, or when an older installation's configuration file uses the default agent-peer group; the binary is removed only when it is the running executable.
  • join_topic and leave_topic accept an omitted name and then act on the session's default topics: the topics named by the project configuration file, or the one named by the workspace's git origin. These calls ignore the automatic-joining switches, so a session whose Broker or project file turns automatic joining off can still join its default topics on request. A session with no default topic gets an invalid_argument error that says to pass a name. Leaving the default topics only affects the current session; a new session joins them again when automatic joining is on.
  • An --allow-degraded option for agent-peer broker. A Broker started with it does not exit when, after taking the account lock, the data directory or audit log is unusable or the broker.listen bind fails: the first keeps the process running with a diagnostics-only local interface, the second keeps every local call except creating a pairing key, and both retry and recover without a restart. Other startup failures still exit. Service definitions written by agent-peer service install pass the option.
  • agent-peer service start, stop and restart start, stop and restart the Broker service for the account that runs the command: root acts on the system-level service, any other account on its user-level service. A level without an installed service fails and names that level; an account that only has the system-level installation is told to run the command with sudo. start and restart wait for the local socket and exit with code 3 when the Broker runs degraded, printing the failure and the fix.
  • agent-peer status and agent-peer peer list print the Broker's state before the sections. A degraded Broker shows its level, the reason and the repair command; an offline Broker says that messages from other hosts are refused and gives the command that accepts them. A Broker that serves diagnostics only prints just the degraded lines, and agent-peer status exits with code 1 without repeating the reason on standard error.
  • The list_brokers result carries a local object with the connected Broker's offline state and, while it runs degraded, its level, reason and repair command. An older Broker leaves local out, which reads as online and not degraded.
  • Session tool errors carry fixed text for broker_degraded and broker_offline. A degraded Broker's reason says the call cannot run until the startup failure is fixed; an offline peer Broker says the message was not sent, resending will not deliver it, and the other user can be reached another way.
  • Broker offline mode. The broker.offline setting, the agent-peer offline and agent-peer online commands, and the set_broker_online tool switch a running Broker between accepting and refusing messages from other hosts. While offline, a delivery from another host is refused with broker_offline and nothing is written to a session; links, topic exchange, local deliveries and messages this Broker sends continue. The state is kept in the configuration file, survives a restart, and a configuration-file edit applies without one.

Changed

  • The install script now chooses the installation level when neither --system nor --user is given. It asks Install system-wide (all accounts)? [y/N] on the controlling terminal, or Upgrade the system-wide installation? [Y/n] when a system-level service is already installed; answering no to the upgrade leaves the host unchanged and exits 0 with a hint to pass --user for a user-level install. Root installs system-wide without asking, an account without a controlling terminal gets a user-level install, and a system-level choice from a non-root account reruns the script through sudo. Passing both flags is a usage error, and a host without sudo fails with a message that says to install sudo or use --user.
  • A Broker that refuses a broker.listen port below 1024 now fails at the listen step and exits with code 4 (listen address unavailable) instead of 5 (invalid configuration), a breaking change for scripts that match the old exit code.
  • Without --allow-degraded, a startup failure caused by the data directory or the audit log now reads the configuration is invalid: config: data directory or audit log unavailable: ..., which names the failure class between the existing prefix and the file error. The failure class, exit code and behavior are unchanged.
  • agent-peer service install now prints a summary after a successful or degraded installation: the install level and when the service starts, the binary, configuration file, run log and audit log paths, and the start, stop, restart and uninstall commands. When the installed service answers but its Broker is degraded, the command keeps the service installed and running, prints the reason and the repair command on standard error, and exits with code 3; other installation failures still exit 1.

Fixed

  • Runtime log records no longer carry the event key twice. A caller-supplied event name replaces the message, which moves to the message field, and audit failures name their kind under audit_event instead of a second event.
  • Runtime log event values that were free text now use their snake-case names, so a value can be matched: accountdb: account database lookup failed; falling back to os/user → accountdb_lookup_fallback, access check for an account outside the account database; denying → access_check_unknown_account, access check process reported an error → access_check_failed, account helper exited → account_helper_exited, account helper stderr → account_helper_stderr. The config package logs config_audit_before_load, config_audit_unknown_kind, config_audit_encode_failed, config_audit_not_open and config_audit_closed in place of its config: ... messages, and keeps the audit event kind in audit_event.
  • A system-level Broker no longer logs an account helper's exit as an error while the Broker is stopping. Such exits and their context canceled stderr lines are recorded below the warning levels and are not respawned.
  • agent-peer service install checks the broker.listen address before it starts the service. An address already in use fails the installation with the address, the configuration file and the broker.listen key to change. When the address is held by this service's own running Broker, identified by the service manager's main pid and the local socket peer pid, the installation stops it and waits up to 20 seconds for the address, so a reinstall is not mistaken for a conflict; a foreign occupant fails the installation with the running service untouched. A failed installation never leaves a service that starts at boot or login: Linux disables the unit, and macOS removes the plist a fresh installation wrote or, when the plist existed before the installation, keeps it and disables the launchd label. The configuration file stays. If the service holding the address cannot be stopped, the installation still disables it and the error says it will not start automatically and gives the command that restores it. If the installation stopped an existing service before it failed, the error says the existing service was stopped and gives the command that restores it; on macOS that command loads the pre-existing plist the installation kept. The readiness timeout carries the last startup_failed reason from the service log, considering only records written after the installation began.
  • A readiness timeout in agent-peer service install no longer reports only the silent socket when the service log has no startup_failed record from this installation. The error now includes the state and last exit status the service manager reports: systemctl show -p ActiveState -p SubState -p ExecMainStatus agent-peer.service, or launchctl print <domain>/<label>'s state and last exit code, and it says so when the query itself fails.
  • On macOS, installing the service while it is running no longer fails with Bootstrap failed: 5: Input/output error. The installation boots the old job out once before the bootstrap, waits until launchctl print reports it gone and broker.listen is released, then bootstraps the new plist, retrying a bootstrap that still returns exit 5; the unload wait and the address wait share one 20-second budget, and the exit-5 retries have a separate 10-second budget. A failed replacement removes the plist a fresh installation wrote, or keeps a pre-existing plist and disables its label, so nothing starts at the next login; if the label cannot be disabled, the error says the service may start automatically. When the old service is gone, the error states that no Broker is running and gives the enable-then-bootstrap command that recovers it.
  • A failed configuration write during agent-peer service install now names the configuration file it targeted.