feat: make the one-click update in Settings > About work under raven web
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start with ui-web/src/features/settings/pages/About.tsx and ui-web/src/state/upgradeShade.ts, then trace system.upgrade in raven/rpc/methods/system.py and update_notice._upgrade_command_works() in raven/updates/update_notice.py. Read SERVE.arm_hosted() in raven/rpc/serve_control.py, gateway _reload(), _refuse_incomplete_install, and raven/updates/upgrade.py before choosing the release or source-checkout scope; done means the chosen path is demonstrated end to end on the same port with documented refusal recovery.
Written by the indexing model from the issue text.
Description
Problem
Settings > About already offers a one-click upgrade: once a newer release is
known, an "Upgrade to X" button appears next to "Check for updates"
(ui-web/src/features/settings/pages/About.tsx), and it calls system.upgrade.
Under raven web, the normal way to run the WebUI, it can never succeed, and on
some installs it is offered where it cannot work at all.
system.upgraderefuses first withgateway_hostedwhenever the page is
mounted insideraven gateway(raven/rpc/methods/system.py), which is what
raven webruns under its supervisor. The comment there calls restarting the
gateway in place "a later phase".- Whether the button is offered is decided by
update_notice._upgrade_command_works()(raven/updates/update_notice.py).
Its docstring says editable installs are excluded; its body only checks for a
uv tool receipt. An editable uv-tool install -- a source checkout installed
with./install.sh-- is therefore offered an upgrade thatplan_upgrade
always refuses ("Editable Raven installations cannot be upgraded
automatically"). - On a refusal the upgrade card offers one fixed fallback,
raven upgrade
(COMMANDinui-web/src/state/upgradeShade.ts). That command refuses
editable installs too, and underraven webit installs without restarting
the running WebUI, so the complete manual sequence israven web --stop,
raven upgrade,raven web. - A source checkout has no update path from the page at all. For a checkout,
"an update is available" means upstreammainis ahead of it, not that a
newer release tag exists.
For context: the latest stable release, v0.1.13, predates raven web (as
install.sh notes), so the first release that ships this page is the version a
page-driven upgrade will upgrade from.
Proposal
In order, smallest first.
A. Stop offering what cannot work, and name what does.
- Exclude editable installs in
_upgrade_command_works(), as its docstring says. - Give each
system.upgraderefusal a reason-specific detail and a
data.commandthat the card copies instead of the hard-codedraven upgrade:
raven web --stop,raven upgrade,raven webforgateway_hosted, and
git pullthen./install.sh(.\install.ps1) for an editable install. - In the UI, translate the refusal reasons, and name the recovery command in the
text shown when the page gives up waiting.
B. Make system.upgrade work under raven web for release installs.
- Give the hosted page a handle on the gateway's graceful shutdown.
SERVE.arm_hosted()(raven/rpc/serve_control.py) takes none today, so
request_shutdown()returns False there. - Refuse with a
busyreason while IM turns, sub-agents or pending questions are
running, using the same test the gateway's_reload(force=False)already
applies (raven/cli/gateway_commands.py). - Have the existing detached helper (
raven/updates/upgrade.py) wait on the
supervisor's pid and relaunchraven web --supervise --port Nfrom the new
install, carryingRAVEN_SERVE_PORT_STRICT,RAVEN_SERVE_TOKENand
RAVEN_SERVE_COOKIEso the open tab comes back signed in on the same port. - Make the gateway, or the supervisor before each launch, wait out the
install-guard marker, asraven servealready does
(_refuse_incomplete_installinraven/cli/serve_commands.py). - Make a strict-port page-mount failure exit non-zero so the supervisor retries,
and send the helper's output to a log so a failed install can be diagnosed. - Rehearse end to end on a beta build before release: old wheel, click, new
wheel back on the same port with the tab still signed in.
C. Optionally, a separate update path for source checkouts. Fetch upstream
main, refuse unless it fast-forwards a clean tree that is on main, rebuild
the TUI and page only when stale, reinstall only when the lock changed, and
relaunch as in B. The pull has to happen in the helper after the gateway exits,
never inside the RPC, and the page should be built into a temporary directory
and swapped in. This is roughly a Python port of install.sh and several times
the size of B.
Alternatives considered
- Teach the supervisor a "restart after install" exit code and have it re-exec
itself from the new install, instead of the helper starting a fresh
supervisor. It has more moving parts, and the supervisor holds its interpreter
open while the environment it runs from is being replaced, which blocks
uv tool installon Windows. - For source checkouts, run
install.shfrom the helper instead of C. Less code,
but it always force-reinstalls, can download Chromium, and writes no
install-guard marker.
Area
Channels / gateway
Additional context
Costs of B that nothing in the tree addresses yet:
- every IM channel is offline for the whole
uv tool install, which can take
minutes; - if the install fails badly the helper may have nothing to relaunch, leaving no
WebUI and no rollback; - other Raven processes that share the install, such as a second gateway or a
TUI, are not stopped; - Windows needs its own rehearsal before it is offered.
Open questions: whether the first version covers release installs only or source
checkouts too; whether a running IM turn, sub-agent or question should block an
upgrade or only warn; whether Windows ships in the first version.
The manual update steps are being documented on the quick start page in #711.
- Dominant language
- Python
- Stars
- 4.1k
- Forks
- 94
- Avg merge
- 10h 2m
- Merged PRs (30d)
- 376
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from EverMind-AI/Raven
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
EverMind-AI/Raven#798 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
EverMind-AI/Raven#797 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
EverMind-AI/Raven#640 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
EverMind-AI/Raven#479 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
EverMind-AI/Raven#474 · 2 comments ·
Maintainers usually reply within 1 day
All issues in EverMind-AI/Raven
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
letsencrypt/cp-cps#353 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
PedestrianDynamics/pyFDS-Evac#394 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
DOI-USGS/pywatershed#421 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
python-pillow/Pillow#10087 · 1 comment ·
Maintainers usually reply within 1 day