feat: unified self-upgrade (source/release/service) + /self-upgrade command + /models command with inline keyboard#44
Merged
Conversation
…mbiguity, add edge case, command registration, TOML round-trip note, background tasks note
… modes, /self-upgrade command, /models command, self_update crate
…s channel, remove redundant imports, combine parse_command dispatch
…ion no longer exists)
…tion, cache is_service_installed, handle UpToDate status
…letion; wire config_path
… log service restart failures, verify new binary starts, fix Windows sc query false-positive
… for selection, add callback query handler
…rompt, adds input UI via state tracking
…flag only on successful write
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
Two major improvements to RustFox runtime management:
1. Unified Self-Upgrade
The
self_update_to_branchtool has been replaced with a unifiedself_upgrade()that auto-detects the deployment mode and handles all three paths:Cargo.tomlfound near binarygit fetch→checkout→pull→cargo build --release→ spawn new binaryCargo.tomlself_updatecrate → atomic binary swapcargo install --path .+rustfox --service installrerender +systemctl restartNew user-facing command:
/self-upgrade [branch]— bypasses the LLM, shows inline per-step progress via liveedit_message_text, then auto-restarts.Improved LLM tool:
self_upgrade(branch, mode)— renamed fromself_update_to_branch, addsmodeparam (auto/source/release), properly setsrestart_pendingflag for deferred restart.2. /models Command
Browse and switch OpenRouter models at runtime without restart:
/models/models <exact-id>/models <keyword>idandnamefields — top 5 shown as inline keyboard buttonsInline keyboard: Search results show tappable buttons (callback query handler saves model + edits message). Cancel button included.
set_model()persists toconfig.tomlvia TOML round-trip and updates an in-memoryRwLock— next LLM call picks up the new model immediately.Technical Changes
Cargo.tomlself_update = \0.44\src/learning.rsself_upgrade(),restart_bot(),is_service_installed(),detect_deployment_mode(),find_project_root()src/agent.rsrestart_pending: AtomicBool,current_model: RwLock<String>,config_path,set_model(), updatedchat_completioncall, renamed dispatch armsrc/llm.rsModelInfostruct +fetch_models()src/tools.rsself_update_to_branch→self_upgradewithmodeparamsrc/platform/telegram.rs/self-upgradecommand (inline progress),/modelscommand (smart search + inline keyboard), callback query handler, restart checksrc/main.rsconfig_pathto Agentscripts/services/rustfox.service.templateRestart=on-failure→Restart=alwaysVerification
cargo check✅cargo clippy -- -D warnings✅cargo fmt --all -- --check✅cargo test— 371 unit + 14 integration tests, all pass ✅