From fbb61a373f47769734a0d47d8f61935ffca84b84 Mon Sep 17 00:00:00 2001
From: Xubin Ren <52506698+Re-bin@users.noreply.github.com>
Date: Wed, 21 Oct 2026 19:16:56 +0800
Subject: [PATCH] feat(update): integrate managed installs and recoverable
in-app updates (#6168)
Add owner-aware Stable and Preview updates with explicit consent, verified release plans, protected process handoff and bounded service recovery. Keep configuration and conversations separate from program rollback.
Include the compact About controls, Windows long-path support, native package recovery checks and optional macOS Dock lifecycle integration. Preserve documented guidance for installations owned by other managers.
This code integration does not publish packages, enable signing or advance the public update channel.
Co-authored-by: chengyongru <61816729+chengyongru@users.noreply.github.com>
---
.gitattributes | 3 +
.github/release-signing-requirements.in | 3 +
.github/release-signing-requirements.txt | 615 +++++
.github/workflows/ci.yml | 141 +-
.github/workflows/release-approve.yml | 87 +
.github/workflows/release-candidate.yml | 188 ++
.github/workflows/tui-release.yml | 3 +-
README.md | 17 +-
docs/README.md | 3 +
docs/cli-reference.md | 28 +-
docs/quick-start.md | 50 +-
docs/releasing.md | 248 +-
docs/start-without-technical-background.md | 10 +-
docs/update-protocol.md | 88 +
docs/updating.md | 109 +
docs/webui.md | 18 +-
hatch_build.py | 4 +-
nanobot/agent/loop.py | 169 +-
nanobot/agent/subagent.py | 6 +
nanobot/agent/tools/exec_session.py | 54 +-
nanobot/bun.py | 122 +
nanobot/bus/queue.py | 13 +-
nanobot/channels/base.py | 10 +
nanobot/channels/connect.py | 26 +-
nanobot/channels/feishu/connect.py | 14 +
nanobot/channels/feishu/tests/test_connect.py | 11 +-
nanobot/channels/linear/connect.py | 45 +-
nanobot/channels/linear/server.py | 24 +-
nanobot/channels/linear/tests/test_linear.py | 82 +-
.../linear/tests/webui/LinearPanel.test.tsx | 2 +-
nanobot/channels/manager.py | 78 +-
nanobot/channels/plugin.py | 7 +-
nanobot/channels/qq/connect.py | 29 +-
nanobot/channels/qq/tests/test_connect.py | 113 +
nanobot/channels/websocket/runtime.py | 22 +-
.../tests/test_attachment_ingress.py | 131 +
.../tests/test_websocket_outbound_delivery.py | 38 +-
nanobot/channels/weixin/connect.py | 9 +
nanobot/channels/weixin/tests/test_connect.py | 13 +-
.../weixin/tests/test_weixin_channel.py | 1 +
nanobot/channels/whatsapp/connect.py | 134 +-
.../channels/whatsapp/tests/test_connect.py | 137 +-
nanobot/cli/_macos_dock.py | 238 ++
nanobot/cli/agent.py | 15 +
nanobot/cli/assets/README.md | 5 +
nanobot/cli/assets/dock-icon.png | Bin 0 -> 230419 bytes
nanobot/cli/commands.py | 2 +
nanobot/cli/dock.py | 230 ++
nanobot/cli/entry.py | 57 +-
nanobot/cli/gateway.py | 1 +
nanobot/cli/gateway_runtime.py | 126 +-
nanobot/cli/tui_launcher.py | 29 +-
nanobot/cli/update.py | 87 +
nanobot/cli/webui.py | 46 +-
nanobot/cli/webui_support.py | 7 +-
nanobot/cron/service.py | 15 +
nanobot/data_access.py | 368 +++
nanobot/gateway/runtime.py | 48 +-
nanobot/installation_lock.py | 146 ++
nanobot/installation_receipt.py | 28 +
nanobot/optional_features.py | 23 +-
nanobot/process_runtime.py | 6 +-
nanobot/providers/github_copilot_oauth.py | 16 +-
nanobot/providers/openai_codex_oauth.py | 48 +-
nanobot/providers/xai_oauth.py | 44 +-
nanobot/release_feed.py | 382 +++
nanobot/release_trust.py | 44 +
nanobot/releases.py | 169 ++
nanobot/runtime_admission.py | 115 +
nanobot/triggers/local_runner.py | 148 +-
nanobot/update.py | 329 +++
nanobot/update_backup.py | 217 ++
nanobot/update_channel.py | 48 +
nanobot/update_contract.json | 4 +
nanobot/update_fallback.py | 375 +++
nanobot/update_guidance.py | 108 +
nanobot/update_handoff.py | 57 +
nanobot/update_jobs.py | 597 +++++
nanobot/update_manager.py | 167 ++
nanobot/update_plan.py | 460 ++++
nanobot/update_process.py | 207 ++
nanobot/update_profiles.py | 285 ++
nanobot/update_recovery.py | 68 +
nanobot/update_restart.py | 234 ++
nanobot/update_service.py | 273 ++
nanobot/update_stop.py | 301 +++
nanobot/update_uv.py | 354 +++
nanobot/update_worker.py | 957 +++++++
nanobot/utils/atomic_file.py | 173 ++
nanobot/utils/helpers.py | 67 +-
nanobot/webui/build.py | 28 +-
nanobot/webui/client_contract.py | 13 +-
nanobot/webui/gateway_endpoint.py | 6 +
nanobot/webui/mcp_oauth_api.py | 63 +-
nanobot/webui/settings_models.py | 74 +-
nanobot/webui/settings_routes.py | 39 +-
nanobot/webui/settings_services.py | 124 +-
nanobot/webui/settings_system.py | 224 +-
nanobot/webui/version_check.py | 95 +-
nanobot/webui/ws_http.py | 20 +-
pyproject.toml | 8 +-
scripts/build_tui_wheels.py | 60 +-
scripts/check_import_boundaries.py | 26 +
scripts/install.ps1 | 495 +++-
scripts/install.sh | 462 +++-
scripts/release_candidate.py | 363 +++
scripts/release_install_guide.py | 215 ++
scripts/verify_installed_release.py | 335 +++
scripts/verify_packaged_update.py | 772 ++++++
scripts/verify_release_approval.py | 41 +
tests/agent/test_memory_store.py | 6 +-
tests/agent/test_runtime_maintenance.py | 574 ++++
tests/agent/test_subagent_control.py | 15 +-
tests/architecture/test_import_boundaries.py | 28 +
.../test_channel_manager_concurrency.py | 59 +
tests/channels/test_channel_plugins.py | 22 +-
tests/channels/test_scheduled_delivery.py | 53 +
tests/cli/test_cli_input.py | 22 +-
tests/cli/test_commands.py | 103 +-
tests/cli/test_dock.py | 333 +++
tests/cli/test_entry.py | 71 +-
tests/cli/test_gateway_commands.py | 1 +
tests/cli/test_tui_launcher.py | 12 +-
tests/cli/test_tui_wheels.py | 191 ++
tests/cli/test_wsl_browser.py | 5 +-
tests/cron/test_cron_persistence.py | 3 +-
tests/fixtures/sigstore/LICENSE | 202 ++
tests/fixtures/sigstore/README.md | 13 +
tests/fixtures/sigstore/bundle_v3.txt | 5 +
.../fixtures/sigstore/bundle_v3.txt.sigstore | 53 +
tests/gateway/test_readiness.py | 76 +
tests/gateway/test_runtime.py | 35 +
tests/providers/test_openai_codex_oauth.py | 41 +
tests/providers/test_xai_oauth.py | 45 +
tests/test_bun.py | 78 +
tests/test_data_access.py | 271 ++
tests/test_install_scripts.py | 834 ++++++
tests/test_installation_lock.py | 135 +
tests/test_installed_release_probe.py | 110 +
tests/test_installer_exec.py | 108 +
tests/test_openai_api.py | 3 +-
tests/test_packaged_update_probe.py | 189 ++
tests/test_release_candidate.py | 127 +
tests/test_release_feed.py | 291 ++
tests/test_release_install_guide.py | 76 +
tests/test_release_trust.py | 199 ++
tests/test_releases.py | 125 +
tests/test_update.py | 410 +++
tests/test_update_backup.py | 204 ++
tests/test_update_channels.py | 89 +
tests/test_update_guidance.py | 119 +
tests/test_update_jobs.py | 2330 +++++++++++++++++
tests/test_update_manager.py | 123 +
tests/test_update_plan.py | 257 ++
tests/test_update_profiles.py | 503 ++++
tests/test_update_restart.py | 302 +++
tests/test_update_stop.py | 614 +++++
tests/test_update_uv.py | 319 +++
tests/test_windows_update_paths.py | 124 +
tests/tools/test_shell_execution_budgets.py | 15 +
tests/utils/test_helpers.py | 51 +-
tests/webui/test_build.py | 12 +-
tests/webui/test_mcp_oauth_api.py | 79 +-
tests/webui/test_settings_api.py | 54 +-
tests/webui/test_settings_routes.py | 273 +-
tests/webui/test_settings_services.py | 92 +
tests/webui/test_update_plans.py | 925 +++++++
tests/webui/test_version_check.py | 191 +-
tui/src/app/layout.test.ts | 7 +-
webui/browser/about-layout.spec.ts | 45 +
webui/browser/skeleton-additions.spec.ts | 6 +-
webui/src/App.tsx | 12 +
webui/src/components/Sidebar.tsx | 9 +
webui/src/components/UpdateGuide.tsx | 78 +
webui/src/components/UpdateNotice.tsx | 57 +
.../settings/overview/AboutSettingsView.tsx | 28 +-
.../settings/overview/OverviewSettings.tsx | 50 +-
.../settings/overview/VersionCheckRowView.tsx | 165 +-
.../shared/SettingsSectionSkeleton.tsx | 17 +-
.../settings/useSettingsController.ts | 6 +
webui/src/components/ui/button.tsx | 1 +
webui/src/dev/gallery/foundations.tsx | 2 +-
.../src/dev/gallery/locales/controls/en.json | 5 +-
.../src/dev/gallery/locales/controls/es.json | 5 +-
.../src/dev/gallery/locales/controls/fr.json | 5 +-
.../src/dev/gallery/locales/controls/id.json | 5 +-
.../src/dev/gallery/locales/controls/ja.json | 5 +-
.../src/dev/gallery/locales/controls/ko.json | 5 +-
.../dev/gallery/locales/controls/pt-BR.json | 5 +-
.../src/dev/gallery/locales/controls/vi.json | 5 +-
.../dev/gallery/locales/controls/zh-CN.json | 5 +-
.../dev/gallery/locales/controls/zh-TW.json | 5 +-
webui/src/dev/gallery/runtime-settings.tsx | 21 +-
webui/src/globals.css | 4 +-
webui/src/i18n/locales/en/common.json | 110 +-
webui/src/i18n/locales/es/common.json | 110 +-
webui/src/i18n/locales/fr/common.json | 110 +-
webui/src/i18n/locales/id/common.json | 110 +-
webui/src/i18n/locales/ja/common.json | 110 +-
webui/src/i18n/locales/ko/common.json | 110 +-
webui/src/i18n/locales/pt-BR/common.json | 110 +-
webui/src/i18n/locales/vi/common.json | 110 +-
webui/src/i18n/locales/zh-CN/common.json | 110 +-
webui/src/i18n/locales/zh-TW/common.json | 110 +-
webui/src/lib/api.ts | 87 +-
webui/src/providers/ClientProvider.tsx | 14 +-
webui/src/providers/UpdateFlowProvider.tsx | 332 +++
webui/src/providers/VersionCheckProvider.tsx | 123 +
webui/src/tests/app-layout.test.tsx | 12 +-
webui/src/tests/bun-react-runtime.test.ts | 18 +
webui/src/tests/gallery-language.test.tsx | 24 +
webui/src/tests/settings-overview.test.tsx | 66 +-
webui/src/tests/update-channels.test.tsx | 172 ++
webui/src/tests/update-flow.test.tsx | 636 +++++
webui/src/tests/update-notice.test.tsx | 195 ++
webui/tsconfig.json | 3 +-
216 files changed, 27948 insertions(+), 1084 deletions(-)
create mode 100644 .github/release-signing-requirements.in
create mode 100644 .github/release-signing-requirements.txt
create mode 100644 .github/workflows/release-approve.yml
create mode 100644 .github/workflows/release-candidate.yml
create mode 100644 docs/update-protocol.md
create mode 100644 docs/updating.md
create mode 100644 nanobot/bun.py
create mode 100644 nanobot/cli/_macos_dock.py
create mode 100644 nanobot/cli/assets/README.md
create mode 100644 nanobot/cli/assets/dock-icon.png
create mode 100644 nanobot/cli/dock.py
create mode 100644 nanobot/cli/update.py
create mode 100644 nanobot/data_access.py
create mode 100644 nanobot/installation_lock.py
create mode 100644 nanobot/installation_receipt.py
create mode 100644 nanobot/release_feed.py
create mode 100644 nanobot/release_trust.py
create mode 100644 nanobot/releases.py
create mode 100644 nanobot/runtime_admission.py
create mode 100644 nanobot/update.py
create mode 100644 nanobot/update_backup.py
create mode 100644 nanobot/update_channel.py
create mode 100644 nanobot/update_contract.json
create mode 100644 nanobot/update_fallback.py
create mode 100644 nanobot/update_guidance.py
create mode 100644 nanobot/update_handoff.py
create mode 100644 nanobot/update_jobs.py
create mode 100644 nanobot/update_manager.py
create mode 100644 nanobot/update_plan.py
create mode 100644 nanobot/update_process.py
create mode 100644 nanobot/update_profiles.py
create mode 100644 nanobot/update_recovery.py
create mode 100644 nanobot/update_restart.py
create mode 100644 nanobot/update_service.py
create mode 100644 nanobot/update_stop.py
create mode 100644 nanobot/update_uv.py
create mode 100644 nanobot/update_worker.py
create mode 100644 nanobot/utils/atomic_file.py
create mode 100644 scripts/release_candidate.py
create mode 100644 scripts/release_install_guide.py
create mode 100644 scripts/verify_installed_release.py
create mode 100644 scripts/verify_packaged_update.py
create mode 100644 scripts/verify_release_approval.py
create mode 100644 tests/agent/test_runtime_maintenance.py
create mode 100644 tests/cli/test_dock.py
create mode 100644 tests/fixtures/sigstore/LICENSE
create mode 100644 tests/fixtures/sigstore/README.md
create mode 100644 tests/fixtures/sigstore/bundle_v3.txt
create mode 100644 tests/fixtures/sigstore/bundle_v3.txt.sigstore
create mode 100644 tests/gateway/test_readiness.py
create mode 100644 tests/test_bun.py
create mode 100644 tests/test_data_access.py
create mode 100644 tests/test_install_scripts.py
create mode 100644 tests/test_installation_lock.py
create mode 100644 tests/test_installed_release_probe.py
create mode 100644 tests/test_installer_exec.py
create mode 100644 tests/test_packaged_update_probe.py
create mode 100644 tests/test_release_candidate.py
create mode 100644 tests/test_release_feed.py
create mode 100644 tests/test_release_install_guide.py
create mode 100644 tests/test_release_trust.py
create mode 100644 tests/test_releases.py
create mode 100644 tests/test_update.py
create mode 100644 tests/test_update_backup.py
create mode 100644 tests/test_update_channels.py
create mode 100644 tests/test_update_guidance.py
create mode 100644 tests/test_update_jobs.py
create mode 100644 tests/test_update_manager.py
create mode 100644 tests/test_update_plan.py
create mode 100644 tests/test_update_profiles.py
create mode 100644 tests/test_update_restart.py
create mode 100644 tests/test_update_stop.py
create mode 100644 tests/test_update_uv.py
create mode 100644 tests/test_windows_update_paths.py
create mode 100644 tests/webui/test_update_plans.py
create mode 100644 webui/browser/about-layout.spec.ts
create mode 100644 webui/src/components/UpdateGuide.tsx
create mode 100644 webui/src/components/UpdateNotice.tsx
create mode 100644 webui/src/providers/UpdateFlowProvider.tsx
create mode 100644 webui/src/providers/VersionCheckProvider.tsx
create mode 100644 webui/src/tests/bun-react-runtime.test.ts
create mode 100644 webui/src/tests/update-channels.test.tsx
create mode 100644 webui/src/tests/update-flow.test.tsx
create mode 100644 webui/src/tests/update-notice.test.tsx
diff --git a/.gitattributes b/.gitattributes
index 9da244d8c..0ad04d9a9 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,2 +1,5 @@
# Ensure shell scripts always use LF line endings (Docker/Linux compat)
*.sh text eol=lf
+
+# The public Sigstore fixture is signed over exact bytes, including newlines.
+tests/fixtures/sigstore/bundle_v3.txt -text
diff --git a/.github/release-signing-requirements.in b/.github/release-signing-requirements.in
new file mode 100644
index 000000000..b1cfaa596
--- /dev/null
+++ b/.github/release-signing-requirements.in
@@ -0,0 +1,3 @@
+# This isolated signing job never installs nanobot or candidate dependencies.
+sigstore==4.5.0
+packaging==26.3
diff --git a/.github/release-signing-requirements.txt b/.github/release-signing-requirements.txt
new file mode 100644
index 000000000..05bf3922d
--- /dev/null
+++ b/.github/release-signing-requirements.txt
@@ -0,0 +1,615 @@
+annotated-types==0.8.0 \
+ --hash=sha256:13b2beaad985e05e2d6407ee4c4f35590b11f8d693a258a561055cac8f64cab7 \
+ --hash=sha256:f072f4d804ea359e4eaf198b1af7a8b0943881a87f31bb764f8bf219bb9419e0
+ # via pydantic
+certifi==2026.7.22 \
+ --hash=sha256:62f22742b58a1a33014a2b6b706588a8d7e2a88ae7bd1a6ebe8c992928483775 \
+ --hash=sha256:741e2c3b351ddf169a738da9f2c048608ff7f2c5cc02f1ebc6b118bb090d5d55
+ # via requests
+cffi==2.1.1 \
+ --hash=sha256:046bfc24911b37851ee1b51aab8bffe713d89c68c6a057b09484ce9fd5f69b4e \
+ --hash=sha256:06c72bb76605a4b0cd0aad6930b69d4baf7dd5d806cfc409b824191099700e66 \
+ --hash=sha256:0beceaabe56af686895136a2de78db54ecd8e4046b236b8fd6d6cb61389e9bf2 \
+ --hash=sha256:154852545011f779917b11c78db2358d095da62a9a172b78ad0a583ee5adc0d0 \
+ --hash=sha256:194cffa889098ced9976c3fc6340305e43f6303657d298da55366907c05c22d6 \
+ --hash=sha256:19ee6127ee34de7d83ce3d371ebc5ed91addbdcc39f9ab15ce4eb35a4e534971 \
+ --hash=sha256:1a18a57b58cfb21fc28d72e876acf10eaed67a1ed96226f92af4df681d571c4c \
+ --hash=sha256:1aa5645c30469b09530c4ebca77ebf8f17618293c58f8549cb1a543a50236e7d \
+ --hash=sha256:1dea0e4d7d4f11f619fe8c1d76caf49e24405b4b5743c0e3be16a500ecd930c9 \
+ --hash=sha256:208f941bb9d18e768138677f0a6d2ce01f590df56043dda1df1535ac57c88517 \
+ --hash=sha256:210019b6c7cf07f081b4c54635c8cf744377001350e29cc0f81c4377b4797735 \
+ --hash=sha256:246fa40ce8645a614ff682e0b70f37134e460eaf93a775e0cbe3cca585a67a80 \
+ --hash=sha256:25792eac27877609e7bb06d42ff88278a6624fff2ba9bbb523c09616b117e80f \
+ --hash=sha256:27350daa11d4f10c540e6e89dada4c54feb7256ad03e9a4dc075ebad7ba360d1 \
+ --hash=sha256:28907ab9bfb6aa13184cfc17c6b8e1023c5ab6fd7076d8c20a35e59fe04f8f29 \
+ --hash=sha256:2ae64be792b8966f2c69538199728b290e34726562896df1e5dc8ffd8d8188e8 \
+ --hash=sha256:31348097ff5bbe827ccc41795d4dd099d9f0625e7def00ee653c137a490c2a6c \
+ --hash=sha256:3143d81e29e1e20a9ce10901ec369012947876596f75a222235965f2b7ae832e \
+ --hash=sha256:3222ba5d678f80a030e6afbcc33dc1ae5cb45facabb61cee2c7016b8432fde48 \
+ --hash=sha256:3311ed60d36f83378794e1009ac6258bafbf81f7888b4caa7b35a521e3f95813 \
+ --hash=sha256:334644fbac4eff73d985a17a91226df55d0f394160c4cfb880e084c8f7161cac \
+ --hash=sha256:34e261f78cb6ceaaa36f42f2613f4380d94d9c759a9c73c769ee6e0247364632 \
+ --hash=sha256:363e05fa78e15116c3c32c210ee36884fd6b9afa6d440e47112c3bd511d64cb6 \
+ --hash=sha256:398aff33cee2767e3e781d2554c54bd0dff386bb437581e0d8011fde1a942ec1 \
+ --hash=sha256:3d22a20b1fb1632cc72c22f95f7b0d2961c3e1c235f245ba4c606c4771035659 \
+ --hash=sha256:42a494cee34437f05546455144f2b5d9ac09b1face62bcfce597d2e521066688 \
+ --hash=sha256:42e2f76b9455f5a9a844f770bf3e200ed3da0e15f5df3db9c31fe80b04b3d004 \
+ --hash=sha256:42f6930c31dc7f50732c9ae793c2786c7b6b044195967bbdde40bb9be81c4cc0 \
+ --hash=sha256:456a61fa52d579ebf9df2e9552ead5129855dbaff6c1e5a9b1bc408809bdc062 \
+ --hash=sha256:471cee653ae88de62096552e6d24ccb4a5adb8c8c9f10b5054d0122c15bf2779 \
+ --hash=sha256:49cbc70e6542d4ccccb936558d1064a8012541e78f821f955cff24e357776c94 \
+ --hash=sha256:4a7c934f7360e8cd64fe9efadcbd10c7c6364f531e432b9a4bf5ccbc9e0e8b50 \
+ --hash=sha256:4be96343e422f2dfcd12ab5c9f5aebe03f82f737c6bffeca6830b3875cb44aab \
+ --hash=sha256:4f42141fc14250de6dde5ee7ea4432be017252d91f19c5ad043c084cea629cac \
+ --hash=sha256:507a24c282e0f42f8ed737cf048572cbf580468da5555764a8331735e9c736b6 \
+ --hash=sha256:51b31d1c98274844cfd7838ce00bfc27c7423a4dc00fc0772fc3331c2cc90676 \
+ --hash=sha256:58acb8ab8e295e6c5ea12f888cbb13cf21511ef2a3303a23f4325c29d17fe5c1 \
+ --hash=sha256:5a59cc1c4442bc3d5c703bf720b51138d0bfc173618807c9ee2490a7541dd3d9 \
+ --hash=sha256:5bb4e7ea95dcd6a014a6fef62e62467d67d8e582326443f3d68e71d6320a9fcf \
+ --hash=sha256:5c58fe613dc5e5336357eff555824a314d8e43282600435c8d1cb6a7a2fedd13 \
+ --hash=sha256:5e7cecbaadb83884793e05828cee59b210b24583b9c7425d0ba6a754fe22eb4e \
+ --hash=sha256:616f097f2fe415bc92a247f02e11f634e1f9e9a83d327e3c915c15089c87869e \
+ --hash=sha256:63bbfd5ded17c4840ac07cd8f1c21ba9d9708141f840b324f422f41b207e3973 \
+ --hash=sha256:64faea20f4e2613363a1a9b9c7dd73058f3ecd00133a511e72ad7c511658f527 \
+ --hash=sha256:661c298b4821edebead0c91edd2b00374d67ad7c5a1f7a91d4442633b79d6a72 \
+ --hash=sha256:68e62fe11f30d5ca8289242866f0a5291402d8529ca2178ab8afc5c9694ae890 \
+ --hash=sha256:6a8dddef476fab96d066d578fc88526767b836ab5ab21754e1d5bf3879c31c7c \
+ --hash=sha256:6e192623c49c94421616a5778fba35cf0d5a8d000650c1967ef4448ee5cdd990 \
+ --hash=sha256:7225e4514edb64eb6740324353e0da0711954fd8d7da4576755b1c6e09b697cd \
+ --hash=sha256:75f80557d1389eddbd0de2681f6a390a0c5338c31ddaa821381c203fc3fd50d9 \
+ --hash=sha256:770de9db11e84213beec501cfcaa013b019820ca881e03344dea5844f7876d94 \
+ --hash=sha256:7750c6449dff7864bb9bb27ddfb0267756189201a3afc911d82b3caacd70dfc3 \
+ --hash=sha256:7bde5e4cc5c10140859842b9d383af292b22639a4dffb725314baf45968cef80 \
+ --hash=sha256:7ce713ace7c0e4520535b42b77eaa742c16dab813978064913e5a3cf82973b41 \
+ --hash=sha256:7da0c5eff80f0197f3b3d1232ec5a682a9325f4ae9016a78f5f5ca35f9ced1f5 \
+ --hash=sha256:7dbb61fe3a7699468030f71bbe5f8a0e326a151daa91beb11a6fc1f980c55e1c \
+ --hash=sha256:811bd1e21d32de12efca32393a0ab3f5133b54fce9bd44b8bd77ab07da14bf6a \
+ --hash=sha256:8ef53b2de9bcb9197d31854256575d59dbac0cba72ac627bb291ef5eceb74be4 \
+ --hash=sha256:937c0052c05a31ca1daf18de3158eed4dbfcb9cc107adbea227728d647be701e \
+ --hash=sha256:9d2055050ea716bd38b7f7f1579c275386646b4894c155a3e2f3cd62ed41b7c6 \
+ --hash=sha256:9f8d177621de5cb38ee3e731eda45d421db093ec0739f46a5594babda7987a98 \
+ --hash=sha256:a2d7755bef5a12ed488f4ef1f1b69ee9191d7396083b755a5d2295f6edb4768b \
+ --hash=sha256:a48d62ab9d6f4f98c983223a547af44be6ca3691074c31cecced6facd3ba2dc1 \
+ --hash=sha256:a4f00aa42f75d6e4595e8866e748cc1705adc0cddfeb2ca86d0d03993d63ba03 \
+ --hash=sha256:a6e721d4b0e45d5b65e87534470e67b18dcd092c83f68fba09f152b9cbc061af \
+ --hash=sha256:a730a083190634c65cca36ba5f489531576ebd79bcd5c8e172130f6453127231 \
+ --hash=sha256:a931079504ecc49efed7744c476a5c343a92fabf66dec2db95edb1b2fdc770e2 \
+ --hash=sha256:aa9511c62d14da7aacc9b4bf51f3f697a621e83b2d6919008243c3aad168eea3 \
+ --hash=sha256:ab36d55f9ed2d067327667c2fea18dda018eb628dd6347aa01dda6cf1f5d3836 \
+ --hash=sha256:ad2c86c495b899d862ea0f4b42891b8713a3bd45dd4105c7fd51c2a72f39f3a5 \
+ --hash=sha256:aeae0e330c9f6acd681f647d46cefd30c29f93e3392882e792e82080c9691399 \
+ --hash=sha256:b0431303acaea1089ad4b3e9ce4e6518193def1118d4073ca848635ee4ea2e96 \
+ --hash=sha256:b5bdfd1c873d4e093aabc0ca84c4ca6dbc4f752afb5c86f146d9742580c9da2e \
+ --hash=sha256:baed1e86cc735622097354b9d1281406caf42ff42a886d29faa8e8d1630333be \
+ --hash=sha256:c1453022f490d2459a11819d83ad1d586e9ff65a12ac3e705ffebd46d3685dcf \
+ --hash=sha256:c26608d2222fb1e94487e4a387d85f13eb55d5ed725cb25a0c589ac4ee60e7bc \
+ --hash=sha256:c7659f22557c5a0bc4855cd635f55edec690cc008a40768527762cb9fb263455 \
+ --hash=sha256:c8c69575568085ba0b1b10c0249d779a214aea6f6522e949a0fc9fb0fcb449d0 \
+ --hash=sha256:c8d2c9fd1f2d16f780d15127abb050d13d1a76c03a4bd87d7e4980e45e511e12 \
+ --hash=sha256:ca82be1a1d406ecfe1d25dc16cb33488e5a16bf4438c9fb590484ea29d92478b \
+ --hash=sha256:cc572dace3f60ef98d7b12ff411d20f5362feb31a0439eab0085bbfd349982d7 \
+ --hash=sha256:d18e5ac0f2f03f4f518d3e23db0f0cad7faa1da8620e9c09461d443bbf6e6692 \
+ --hash=sha256:d28630f5854ab07ab1fd4aba756de52326c82e6be15d414b12793f1975048b54 \
+ --hash=sha256:d9c275eaacd24aa73f94ffd6de08fc3f932424d8b6c376f4bed7cde376fe7bc3 \
+ --hash=sha256:da0e573f9f97159390c89d9f1a9e41908b66d408cc5b58d08cf3847d844c531b \
+ --hash=sha256:dd31f52ea1086513bb9df30f8fcee9b8918323ae067a3d5b78bc826a000712be \
+ --hash=sha256:dddad92b554513a31f272570678ba307fb9f618f05e3d4a5eacafff9eae03e1d \
+ --hash=sha256:df423d40ee8654634421812bc3b196da3f9bd7d32929da813f8394c4348a5358 \
+ --hash=sha256:df913725b79db7bcf03448f36b7bf8815363417d5b58deecf9305e3e30f0f21a \
+ --hash=sha256:e0bcb7e0f677f543555d2adff3bf19c05f66cdb4796e5ff602442ab2fe3c4ef7 \
+ --hash=sha256:e2d65b31f36619cda3999b78b2aa9632e76b78448e7a56fc4240824200e7c4fc \
+ --hash=sha256:e6e8cff14d6fb0be70a09c0bdc58096f501952d04624ebf867e0e56da2df8960 \
+ --hash=sha256:f16c709686a78c727bbbf059f92b0bf41c6fc60deec706d2dc19f529175a6125 \
+ --hash=sha256:f24fb43132a4c6b4cb4eb029492919b2db645be6808d738f244fd146c03c32cb \
+ --hash=sha256:f53e442b08449d42821fa4a4fba000095af9f62742a500f978a9f557ec44339a \
+ --hash=sha256:f5cfbc5fe74540d335175b656c725d74d90e3730c626d92575eea35029d9afaa \
+ --hash=sha256:f81b3b8f3d4e343550fa4baa0e479bba9f2d29ce9c2e9b51d1ce1718d7442fcf \
+ --hash=sha256:f8ec5e643a9a937f64e1999eb9f75d072263751912dc5cd06d3c85f8f44be7c3 \
+ --hash=sha256:fb92203a88b3d3053034db775110081c49d28be6551923805e039924093761e4 \
+ --hash=sha256:fcd22650c908d7b7da162bbfaab594a1227a15d1643a98c68b122ac642fa2264
+ # via cryptography
+charset-normalizer==3.5.2 \
+ --hash=sha256:01077390b03f7988f11d700a2194e69b119741a86b1a638b1db88891e3eced8e \
+ --hash=sha256:01b0c0d2262a9e28e8484a278c7e1b5d650e3ac8cf2683d2967e25899f208bdf \
+ --hash=sha256:04851f73ae72b8413dddadb16a49dfee95263553741fd42d546f7d66907e6be5 \
+ --hash=sha256:0521c5665880b33d603717defa76c094048900010897909952397feb3039da56 \
+ --hash=sha256:0774bf9bf620249fee3e0b8b9fd3065de213be30f3aa94ce2494b3b638949e26 \
+ --hash=sha256:0891b9d3903c5571c03771ca669a4b0ec5618ca722a5c957d3d29cd4e5062848 \
+ --hash=sha256:0c951d5e6dd9c2ff60609476752bee49da4206adde960ebc247766937f72e718 \
+ --hash=sha256:0fed1d06615f022ee3b13caf5e8b180cfea32bb2c5aded8a9d44277afc040f93 \
+ --hash=sha256:114e4d0c92d618409ed82a99e22b5c5e768fe995f2973f78265f4524f49d4640 \
+ --hash=sha256:11912e4bb14baae7c5d8791aa55ba0a3a03ec6729073307b0f57270abaa713d3 \
+ --hash=sha256:11a4d68a6ecda3292cb1e50239e111543ba5d709bb62a6b4ea1afcfa729d8875 \
+ --hash=sha256:124fbf1a8ff966d87ae05bb8bd45a71f966055ed8bba320d0c7cf450bc5f4d0e \
+ --hash=sha256:1461ac396c4fdb983a675f20aa555624f0ee18ac83d832b9244ffff3d8055275 \
+ --hash=sha256:1503bccbeb36d5527790c3930327704c39af22de3112f1b1666a9f3ce15ee204 \
+ --hash=sha256:15bb4005af6320d259dc7593ca84a38d7fe06a421dbcf7b910ae23979101e787 \
+ --hash=sha256:15c44f7edfd477b06f517a5cc317fc1707edb9de2c865f43d4b6513907473234 \
+ --hash=sha256:16fa0eccf81304b79c5cd87f9271c3b85dd9dd99245e4422ae9c0dd45e0f99d3 \
+ --hash=sha256:183b88127acdb4fabe59d951ab424faf1af7b63cdbb5f776186c1ea2ffcaed98 \
+ --hash=sha256:195c26fb65950f8fce54e26349852b7bdd7c5f120aeefbcc440b8a20faaed4a3 \
+ --hash=sha256:1afb975bd5d68d5ce9f6b6d44fdf2f7e34b895a35e95708a7a91b20a3b51d187 \
+ --hash=sha256:1b4cbc7c3491ccb4aa17fcd8165649d01cf39f76de1696da8631b5f71b85401d \
+ --hash=sha256:1bc0baf5ef96b6ede57d47f4b8fe4d9d84019c3bfcbeb20a41edc6a6ee341f1f \
+ --hash=sha256:1c50fe28bbc2ced33386f298650d91218076c05420e6cbd790b913adc41659e7 \
+ --hash=sha256:1db38f4c5496827c1a501846d64d14c3b80c7e6714e406cd7dc36a9899fa1011 \
+ --hash=sha256:211d5a3eb6af8f513b8d4ca19a8c1b7accab1b5f0d3175f9826b03c1a920dc1f \
+ --hash=sha256:23851fb4e1b85ed3f6c2a27b777cdfe2e19fb5b38429a8faf38c7542b7665869 \
+ --hash=sha256:254eb48b9fa5ee9898a3c445825a1f340fe53712a098904b39b0bddba8ea3cb1 \
+ --hash=sha256:2625388c6c754520c37abaf3b41eb34d1cc4a373f457898f08606c8e362b891d \
+ --hash=sha256:281cb91036248400f4cc957495cccd44c275c2e0c5854f7e45ac5cf7dc193847 \
+ --hash=sha256:28a15fdad492a99b6eccfaaed66ef3f74050680545ea61ec8b2f4c538f1f1320 \
+ --hash=sha256:28b4f0d66fb834ff90f28209ac7bce77868c45d8c93e26f906709d9b7c2e1af9 \
+ --hash=sha256:2a925889534b3748302dae5dead07cc13480de1dac3aea80a941b729b471ef93 \
+ --hash=sha256:2b7b3bbfb4fe8ef40600792d762fbaa9057559f9d3fad209525b7a22b99e91fd \
+ --hash=sha256:2c9ad19a6cfcd5ea5c0d41161d22f9df1dcc277e9bef2751391334546a314c00 \
+ --hash=sha256:2cc961b171b3f3440f410489ab3573e86aea8736134ebbb40ea1338b7f0831bc \
+ --hash=sha256:2ce45c6627b22c47e390bc91a41c3d13032192e699fa0bea96e9671b373d69b0 \
+ --hash=sha256:2e06a3a98f916dd41d27f3105e02e7a40181c98c94b9158733d03a6f80506c09 \
+ --hash=sha256:304d5463e65a35d7bb0850550e0780395395f6fcf452f04db7d5ca7cecc425ac \
+ --hash=sha256:304d8e4d493af723536393eee0c689eb7813f4a474c8b479dee63f1fdd98f621 \
+ --hash=sha256:30fcd120b732aa79317f08dee04d7de0847822e4cf7ee0e9f445bb958832252c \
+ --hash=sha256:31f3930700408d211f13378ccbe1c40845d8da54bd0681fac3a9b5aae81c7aa8 \
+ --hash=sha256:34276fd796040bf0993ab33a369aa572e6979c7aab225a88893667ad8eac8f7a \
+ --hash=sha256:355ad8011081dec5412240c087a9a0c9d4d5039f3ed11a3f13e18c2b29b56c51 \
+ --hash=sha256:38a873987f3be698494da8b2e3085e29da02da7b633dce73e79c699a113d7bf0 \
+ --hash=sha256:39de2a259fc954455c57274dc94c79d5842774e1247a016aff30bc0efed0f4ef \
+ --hash=sha256:3d14b50de6bf4d0edf857a9386836846f982b8f524e188e2e68b96d702bcf4aa \
+ --hash=sha256:3d21b8b13c7592db2ac5e544a6d83187b995257472b0c9e8351b6d507ae37ed6 \
+ --hash=sha256:3d31298449090ab8d47b7b1b2a555ff73cac7ed438a08b7ac160980c7ebed649 \
+ --hash=sha256:3ddacd27458c45bdacd6bd6db644bfb730efbf9e830310186e3045c9c5be8fb2 \
+ --hash=sha256:3df041de8887954562c9b261cba85ca0e9ded74048daf125f45edcfaa4832229 \
+ --hash=sha256:40ab6bffa02ae10a0581e6c198be7d2d8ca5c2a0c64e4ed3465d766df457573e \
+ --hash=sha256:4275811936e2f06feff5e598fb42a1b7ae852da8e39605211892b56b81a34efd \
+ --hash=sha256:443eae2bf318abeaf6f15d785138f71fd6de770e99a92158b8b814265e079115 \
+ --hash=sha256:447441e76ec720b15e64418d32e092297340387053047c7c694f579efb0ee1d9 \
+ --hash=sha256:4495c5002a7b28557e7e222e77e0b661183e432b7d6d2e788101e3f240e05b8c \
+ --hash=sha256:44bd4fbb29dfbeba60e7d2bd000c59e4b21ddb3cc53912b14048d37092706d7c \
+ --hash=sha256:4685902cf26edf013ed7a3da0f426ebba7a00ebb9541386d835afbf002c11cab \
+ --hash=sha256:498dc3188ca05a68231ac3fdbfc7f57eb67e1343c30e0fea17f8218c1599b253 \
+ --hash=sha256:4c2b5031f63e331e3839b40aed2dd6f191e9c07edbde303e7876846ea1946995 \
+ --hash=sha256:4d48f2d08b9de5864e2c8744d4461b862fb149a18274abc8b698c45975573438 \
+ --hash=sha256:4f87960d57feabfb618e4e0af6e7371645fa26a277860739d6e5d6e0012c92f0 \
+ --hash=sha256:50e3adfb96fc189eb27b1cf62d3b598b89b4bb0420d93a3d3e42e137409011be \
+ --hash=sha256:51cf45226a9b588d0d2b4880c62d686934b63ab0bd79ca23ab0e9762eb27441b \
+ --hash=sha256:52aa6992700996af31f375de0c6bacd402b0097fe40b53c426b9f51a90ebabc7 \
+ --hash=sha256:55ea99acb17b9325618de155a0cd6a2e8f5d10be008113e1d433bbb58db543b2 \
+ --hash=sha256:56bc200a365efb37383b7852e4cc5898d3b2da5987289b543956cf8cad71018a \
+ --hash=sha256:588461c2e8384d309bd63e5826019b6977bc66d629b99ac8737bb795d7b2cb5a \
+ --hash=sha256:58ca3755ee7ff7f59b57789ec9833c9de9ea275405cdd240eda1f193112e398a \
+ --hash=sha256:58f361dcbab699cf8f42db3f47c8e7fd1036f138c23a5d08de9fde5f425a730c \
+ --hash=sha256:598a11a2c7ebaa5334bf698bf29568c9c390abac6a154d8170fedecd1cea38c5 \
+ --hash=sha256:59f63901b0031c3136cf64704dcb21de0bbae62ce2c9529bc39d27665463de37 \
+ --hash=sha256:5cde776b7cc66e4f6c99612cea4aa7269aa65863f7a15841b2c264f103822f4e \
+ --hash=sha256:5e2b6b57e9733d39f0c9fd3185efa6b8e29652c4cd8fe94180272cf6ed9a78c4 \
+ --hash=sha256:5fb29fb8cd1a46c27a1bf9613ad5ec2599310d46b4025d9556404a6b6a292800 \
+ --hash=sha256:6045373d5a89a5ec71afde535db987ca28e76dfa276c2d4c818265b375d4b055 \
+ --hash=sha256:619799369eeef6366ed3e8755a5670f4f2f0fb6b30a0fd7264dc0fdc2357058e \
+ --hash=sha256:62588a277bfb59def052abd940703fa35107152bf479781a878617d60faf8fb5 \
+ --hash=sha256:62603db9a7caa0802eaa28c1c46fecd7b3a263a774069c24c3c28c302448721c \
+ --hash=sha256:65cd72beeeca9d3aaea1201e5923859f308f952f9c71de93f06063c79f0f7a3b \
+ --hash=sha256:68eb192d85ab8e5f6ec69c2bc6ac0179fbf04a5ac1569d12fbef74883fe102d0 \
+ --hash=sha256:6bd128f206a7752ae1f2ab6c61bf8a24ba28913a10df8b14c2637b973ff97a80 \
+ --hash=sha256:6be488a102b8cf28d0391d8c4ba7748938ae28b78ad901f8585520fca33ead1a \
+ --hash=sha256:7218e8f32b0956cfcd048fd42d9d5779809745ca1d86113ca56f66e7ae1549c4 \
+ --hash=sha256:7441d755b7ab94f8d4eb3e43ec05482d760842fd263d003a99102d742cd835e2 \
+ --hash=sha256:749e97e1b32313717a565abbe321bc2190bc8b35f1a67e4cdbc7c56c8d8ffe58 \
+ --hash=sha256:75a3ceed0724d625d64b86ca20aba182e4df462e04c2414fc941c0f523f06aac \
+ --hash=sha256:780fbe7cab297b81dad9fb8dc5eb003c0468ffb0d9e5f65068c53a34661a96bc \
+ --hash=sha256:78456a747de8dc58360ffa581f30a002baf5aa28cb262536545e91f113ed7639 \
+ --hash=sha256:7967d08cf06dee78443b874f98c98036f624f3a4e73e11f9f64f5be4d25393cf \
+ --hash=sha256:7a881931aa470808df94a8c380eed2bbbc76cd9dc622310f99665658c821eb6d \
+ --hash=sha256:7dcd882da75ef9adf94903b1e3b9419e8aa8fb4c7396822b834b9ef7fb96954f \
+ --hash=sha256:7e841fb9010836c992c9f12fcbd43a831de93a5f726fc1ccd8ca1d0268c5014c \
+ --hash=sha256:7fdde2c9fd9e3eca40631e024664cf2584272cc8f96308cbe5fdfc930f51d8bc \
+ --hash=sha256:8024d00c3faf3fc0c16e07a69f4405e8eac7cc0ab15f65fe6cf43827c4cf72b4 \
+ --hash=sha256:80d02b6f04e92601a081dd97b23d3128033098bff5d35d392ddcc0476ea11253 \
+ --hash=sha256:838dcc90063569a0448120554591a1d6c4a4ffe11babf048908793154ab86ade \
+ --hash=sha256:849df64e889b2e17230d58410a03dba311a65b163508fd33679b2b737d4b7858 \
+ --hash=sha256:87475fabc8d9996fd9c27debb395e642e8c838d78a00b6e932227a0e06b81e26 \
+ --hash=sha256:87e50a3e7cb90af586b6c5faf23e302a970415ac73bd7bd90a515a04b427ef96 \
+ --hash=sha256:89b53f3cda69831909888e0494f4fa0bcd3537e3e138dabeb620bd6ad946bae8 \
+ --hash=sha256:8a893cc101149f80a653f82062ebc95b34525a2614382e1da5458fe7c6997249 \
+ --hash=sha256:8b2bfab86aa71ae13aa41a6a26aab338e0db2b8bc75434b05aea89e011ff35a4 \
+ --hash=sha256:8d86d6fc60743dc916eb79e2eb1ec4818e21e427731543af40a3021851174a13 \
+ --hash=sha256:915563965d418f986e7e145accc592eae9e1a1be3566ff98a05d7a9ec42a76e1 \
+ --hash=sha256:92888bb3187c5ba50500b00b3b310c9f2c651709d28036077680cb5255450a03 \
+ --hash=sha256:93223adc95033dd47133a46ccfc316a0139176fd79085762e27202ec56018f03 \
+ --hash=sha256:9373ad13ef0d2c0fb761e04e55bfdee5a08b52cef2c882c8fbe9935b1517152e \
+ --hash=sha256:9409a8bf35cf78353942504b24a57de3d75b708997a1e4bd8db71ac8633ce364 \
+ --hash=sha256:9b7f416ff0978e2f2249330527f0ad6fa02f4932e6199692d3b52da2048c19e4 \
+ --hash=sha256:9bde855991b7e362c146535e3136a50bfaffc0487d38b33ca7e5edefc6e23849 \
+ --hash=sha256:9cae88599c7219005d879f98e5ed53341e9a122af585e1091200358a3003d2a0 \
+ --hash=sha256:9cf9b1a857e25c4baceeb3624e92a56df3668f398c4acba74e174d81fb4d1d3a \
+ --hash=sha256:9f56f72050826f63dcee7a7f55b0a77168cb3bfc553fd405e7f8f9ece75a4036 \
+ --hash=sha256:a090bb2c68df85450502e3e20d665e3a5af9c65a84d6508ed477badd49166fd3 \
+ --hash=sha256:a192e2c40070d92c3ccf777e3a5c4ff515573cd2bb7ed0c537fdadbbec5bbf21 \
+ --hash=sha256:a19a731138fc27d5682277d3b9df22855cea1239bce7fcec5f78f42ef2d1f3c3 \
+ --hash=sha256:a66c3bc5ab1f0ff2164fc9965ddd611ff0802173f4b9d24554c563f6ab7e1d6e \
+ --hash=sha256:a815775b6c38d4e0ff7bcffbeba67feded90202bb6a226b8dd35f1c855217413 \
+ --hash=sha256:a89012d6d5476ee112d20d998570ed58df2260a852afb1758809cd6900411d21 \
+ --hash=sha256:ae4f5fea5b8b8ccff88238cc8569303e5ee95efae67fa62922a311397a71f346 \
+ --hash=sha256:b6856554c4f44d79fc2307d5768854310a8f0096e501c75637542c82292b0429 \
+ --hash=sha256:b6b751274acb69d77b3323d6b7dbaa3c7fdfc1eb829b7eb61d262f32e1af9685 \
+ --hash=sha256:b736353c0a625bbd5fcec108576e2385db3496f4f771f785ff32e108d3c3bc45 \
+ --hash=sha256:b7fd005a73d9e657273b7a10dc71a9e03c8fb9ee6999798d6918ce095b81ac7f \
+ --hash=sha256:b91363207bd9dc966a691e959bb47f64b30f7ac4b072be9968b366982f7db77c \
+ --hash=sha256:ba0b1d2620edf869789c3879223f52bf2afc5d31b3cb47cc57b3a12c05e2aa9d \
+ --hash=sha256:bbbfc8e28816f19d7c0f1816664980c0a9875d01b27cdf8eedddb639d9e108ad \
+ --hash=sha256:bd16aabe4a02a297c23417aa17ac6299dbd8c49f673bcd645b4929b11f5a4400 \
+ --hash=sha256:c0afc6800ba57ccc350374c5bd6150419915d95ce93cdbab2d783d75eaf30ecb \
+ --hash=sha256:c6708715abcf3c73b99508253e961a9967f02fe536532834149574eda6de0d1c \
+ --hash=sha256:c7c9ab723cde841fefb34efbad91e87f00a674b1fe1cd0784fde742bf2c154dc \
+ --hash=sha256:c8f3d67aeaf55f017982b73683f0e7342ba2f6635a78f69ce89ebb26aa411e5c \
+ --hash=sha256:c9790464842f85f437dbbb54417eda1e0e6bfc52dd8d22d6fd1c994b73b2dc74 \
+ --hash=sha256:ca403d7e4798f525fdfc78e258820419cbbd0f0ecbab9de7840e3c017cf6b8cf \
+ --hash=sha256:d008d90a7f2471519aef0c90dfbe73b3e6e4d5e66ac48e19154c17e89e98b604 \
+ --hash=sha256:d19fbd981a488e22cd04883659ca6b08f50b5974f9fd7c95655ef6a043e5893f \
+ --hash=sha256:d1befeed746d247c81127bb14de9dc3d30edb6e5976d34f83f86ed262b1d9105 \
+ --hash=sha256:d2374b62878abb00cd8309b32af6c0b715cd02dec0ca74ef12e5069bdc64144a \
+ --hash=sha256:d376bbd28b3a8999db1a103b3b388aee6f1ddeb3e51bc2172993efdcd86e064d \
+ --hash=sha256:d4a7319f304a774bed22115bc891618e45f85065ab44ea6acd07d274e750519a \
+ --hash=sha256:d6734d2ef8a50fbf8445c139477da401f50d62a0606bf00e20ec6d87773fefb1 \
+ --hash=sha256:d760fe2a4d7c3b226cb9026d6a842868d52a7901bd98420e1baf14e80da85cf5 \
+ --hash=sha256:d913de495d90407cd859d263bee2e5d1a4ed3eb6573c04e70d9ec619a7cbed7f \
+ --hash=sha256:db19d07e2e0129e974a0e65d0064fc222a446cd5122c2fd4184d2af9fc734a9e \
+ --hash=sha256:dca9ab98072a5a54ebacebdc45f53e645336b320c667410b061be1ca588ae709 \
+ --hash=sha256:ddc7dacc8ece3a182e7f15cb862d1fd616b46d076cb1ae9dd232b2c38b655874 \
+ --hash=sha256:ddf19c062bea7a0cc80f519243d2c01dd091be0cf952a0750d4ad576709559f5 \
+ --hash=sha256:def79fa35ef0cef8d2accec024f4fdc7ead3012ff02f5215c783f39f03ef8cfc \
+ --hash=sha256:df29a0a7107f7011e77f4eebdddec4c7331e24d787a0b21a46d63bdf7445da95 \
+ --hash=sha256:e09a3942ecbdee5cce73ea9d42da82b81b72ac1bf031ce069b93b5adf4eac8cd \
+ --hash=sha256:e242bb1c5e76e97dfa9e7f209a71e93a01d7f19ffdd5cfbb2e2d55b4f08f8ab0 \
+ --hash=sha256:e243bd13217235fc7290c621941c3f5cc8b66e4872495be821d7436ba2fb838d \
+ --hash=sha256:e2af3aad578aa6bd1384bcf4750fc285e5a9de53f40b7d41e5a0bf748edeb2b3 \
+ --hash=sha256:e4e81e09c1578b8df602e3db08b0b3ea0a6947ad612f52bf8dc5ea8d47691f0c \
+ --hash=sha256:e54da4baf05720032d527874d40b65fa4d7e5c6c6a43d0c3adbeffcaf275a2b3 \
+ --hash=sha256:e80e6c2f55656b4824d72065abb4ddd6a525c74bd78a0aab5d9fc2cf4fb5af50 \
+ --hash=sha256:ed2a239c0ea213acc1908150a3037257083c7c083128f1a4cec2ec4b97dca491 \
+ --hash=sha256:ed905975ab14056a2e5eb1c376cb2e1ebc5396baf84163939c518556fccde9f5 \
+ --hash=sha256:ee21e28f0430bd6dc9086c6e525d5e818a44a5ad19720c8a0ef766792f3eb5e5 \
+ --hash=sha256:ee43c17b173d46a3212baa6ead3ae258eeabdae48c263a01ccf0218c366dd655 \
+ --hash=sha256:ef4fcbf3327382cd4c9f540babd61248208af7b93eec4de397b4d5f58a09e288 \
+ --hash=sha256:eff0ac9dbe711a4aee69bf04a83896aa9b85f19641264053a9f6d48573abb7dd \
+ --hash=sha256:f0aa869112ef88429ae17820d99c3dd9504c9e9c671d3c246f3d7442cb051084 \
+ --hash=sha256:f3c96f633825733f735c5a9cf21d21a257d8e1edf0b1cee0a064b9c424ca0f7d \
+ --hash=sha256:f5833ad231be5eb6553de524a70f48d71b2c8563101750531e0b80184e175cd4 \
+ --hash=sha256:f5ec61164adcec446f8969a3358ec3f9b26bbda3b9213e5586d219afa8df2915 \
+ --hash=sha256:f7d486c83842422badd511868fd8a9a20e9407ace71564b6af47ce7e60a336c1 \
+ --hash=sha256:fb9e68df06293761f9fe66ade60a9bc6d0f5e42b8acf2939a9158af86ab0e5bd \
+ --hash=sha256:fc14a032f813bf5fe624d991960ea83e9715adc27e4c1830a2361eb1d02ac341 \
+ --hash=sha256:fcff63213e8e6e47770541a4607175404f47cbb3ebea7b6058cc82d524a0e424 \
+ --hash=sha256:fd1fbe0f116b6e55da77aca2c6ddcddcfac2186cbf78bdebf40fc156efca389d \
+ --hash=sha256:fe9753dfee015c570d73df76f899f18444d41388bffcde097deba51c4fadbb9f
+ # via requests
+cryptography==50.0.2 \
+ --hash=sha256:0ddc924c04591c2811ca024d62ecad4f7f6f08af8939c211438f48a16bd23602 \
+ --hash=sha256:0ec5f09541743261e66e291b4a0cbf0fb2997aeaab6d9e9c740b9dba1b58d1c2 \
+ --hash=sha256:0ecbc5652bdb6fc9eaf89a7d196e20941adfe812f43bc4ca05d9150496821047 \
+ --hash=sha256:1981f1db4630889b9ef7803fadef12b056f428cb6b85c27ba57b774793b6093c \
+ --hash=sha256:1ba34f04897fcdaa73f74145c25f3ec146fbd56593853e88adc2e811303c5f42 \
+ --hash=sha256:241449bf940a5d27309bd317e6f9a2af6932113818bb2b8f5c59ddc7ef16da18 \
+ --hash=sha256:25784ce8b9621c90c643efb9e1e2162ab3b0224cae446ad5e70e7fcb1ce18b51 \
+ --hash=sha256:3dc4fd8058cea1644971207d530e1a03a184a805ffc8ebdddf0599d78a331b81 \
+ --hash=sha256:4061c0079120205fb760c58acab6443e217307dcf05e3702cf970e0689972856 \
+ --hash=sha256:4a20ce1e5cb4284a86692fdcba7cb8754185c6b2e5c56fcef3751cf451d3cdc2 \
+ --hash=sha256:4e81d95e5bafc2d6e34e4bed780e53e4d5b9a2f928573428aa4d35fbec1eb0de \
+ --hash=sha256:58a0c478eeca76fe5e07993c5a0703def34a6dc6a0cda4f5564639b33112ffe7 \
+ --hash=sha256:58ddb5a8e3179d12f19e4ea34d2d32e9d63a4baa142c875c1eb59f41b7243acd \
+ --hash=sha256:630ebfea3bf689d075f82316324ff7433dc447fe6bc1bfc76524b74b4a9567d2 \
+ --hash=sha256:6f8700550aa1474a91e5dc07049c46f98b423b5b1ddd0483e0b51362eeeaf5be \
+ --hash=sha256:78198641e5be9521beea5aa782bb551a58068d10e6eb04c9c680c1b69f2e7d45 \
+ --hash=sha256:79def8d059362e7831389ed3be0ecdf58a89386e1271e35dd9f5af84e81bffd0 \
+ --hash=sha256:7a8701d6b584d76e909e3d305b7d126b41439876a5aaf76cddc67fc230eafa2e \
+ --hash=sha256:7afa5a6602a9f29af1f3a2965f831bae7c9d5d597b7cbb716d41ab3b7d89879c \
+ --hash=sha256:7b46165bb56eb4704e2eaaf86f3c940d19154535d9b0ca7d6d590b04060e00d5 \
+ --hash=sha256:7b75de3c8b3be1cdb1052747c929440c3eea46c1bc2cb8a6e3a48388e9b7b452 \
+ --hash=sha256:7c6d0330c472d96f6a6afe24d80dfdf15176c33096f0a4397ae4c60f3dd3be48 \
+ --hash=sha256:828d49b0ff5a0e3975865571c5d91dbbdd0d38d8289b249a163e9425413a5e05 \
+ --hash=sha256:84f964e537f916e2cc85199e5a88742e964939b575ac8598b3f9d6cc416cdaf1 \
+ --hash=sha256:85d0d9a31b9098e98534226d5686b47264b95e62ce459dc2e62fdfc809f9fe93 \
+ --hash=sha256:87e9ce85beb6b328ba370cc6e6aea483c92617b4c95b1d33a49297eb662bfb04 \
+ --hash=sha256:8c71ba2cd31fc93748c38e1b613200ff1c2665cbfd5341fe3a61cfde35a1430e \
+ --hash=sha256:92e665960f25fcdc73725b9cec7a3824f279ba97a98653afe9ffac2e43668f67 \
+ --hash=sha256:94e5e9f108ee10471288214d3d233fbfbb492840a8457eb85178d643ddeb32c7 \
+ --hash=sha256:9c8402a82ea0dc4ceeab793db05f0fafa8ca139ca34fcde5df0f596103c74107 \
+ --hash=sha256:9dab55f57c74c3cad24c323bacbbd04be4705ba6eb0d92e920b1fc4837ed5079 \
+ --hash=sha256:a582ab2ae1d34f67112cadc86702774c9ea4374df6bca6afe672817203c99134 \
+ --hash=sha256:a6557e5f38e065ca9fbdaf7cfc7435ecb1d113aa81a022d1b51921ee7432e227 \
+ --hash=sha256:a9f7355e6fab51f6c369b86fb7571cffa05edee2c2121e0380a37fb9ac1cd5c1 \
+ --hash=sha256:ab50ee449bf968271e820086f10a33d101dd060370abc10bcd22279be2656539 \
+ --hash=sha256:ac9ed99d81760c62fe89d5f0815cdfa1ba9a35141cf30f1c2d044f04b4803d2e \
+ --hash=sha256:b13478603dcd0a2479ff8e87e2c19a7d525734686fe3c49542472293a204212d \
+ --hash=sha256:c423ab384a46c4dff7217b2ea5ba2e11cffdeab6441acd04cf65a369caf0366c \
+ --hash=sha256:c5e67125c7dca78d199ec4e116aa93dbb83494808ecbb8211a2cb09b1bf41dbd \
+ --hash=sha256:c71be1cbfa5cd9a41ee452acf1eccd82b2c05950358b106ec8ceb83411d1a020 \
+ --hash=sha256:cbc8738fd8526d80f35cb3a40d41f41a2e7030bb3b18b09a6778ef63d291c2fd \
+ --hash=sha256:ce47f66801c20ec6c6632453bb5960fe38939e9306970b48b3a5a26de7745d94 \
+ --hash=sha256:d370b8d1dfcdf7130178137f6fbee6140774a1acc6cacefc4b42643ec11d0a3a \
+ --hash=sha256:d38cdff612d06fa6a32840d5e1b1f7a27cee4a349aa9085d94a67789d6bfd408 \
+ --hash=sha256:d8947001be83df1394050758ce0e745dd74fb134eef0a4b5124208dfc3a68c37 \
+ --hash=sha256:deb9fde5c60e437ee4821bc9bc39ff31b42135c27e1dc61ef0a629389c1de62e \
+ --hash=sha256:dfe9763530994147d9af1def057a5b9658b00e8f8fe8743d144d1e0911c2e454 \
+ --hash=sha256:e105ab60406787da31fccc883fc0f733af1efd78f0136a4599692c4083a73d0c \
+ --hash=sha256:e275096ea1e60cc595cda2836fd4a6c725d1125108b868be17f53684d164e2cc \
+ --hash=sha256:edc3342adf8f697fc5f59c887a304356f147b397809440ed64e2fa6af2f50f37 \
+ --hash=sha256:ee247f5c245c9a2fe7c8e2214e295918838e44e00a45a6718451e4004219e767 \
+ --hash=sha256:eef4c2f3423810b3070ab391f85436d2f8bbfcb286ac15cbc73190b3563b1f1a \
+ --hash=sha256:f21e8a22c8605750c7af886bab299a363721264061b4ac0a30efb73cfd58efc5 \
+ --hash=sha256:f265528741e048bce55c3463ed721fb0aa45a5888d8add8cfeccb3035451bbdc \
+ --hash=sha256:f2f9bd7f90c64fe89253f0a2c05e3c4856072660429ce8831b4235bf29403a67 \
+ --hash=sha256:f785f6161f202ab04d8ca194158968798e480ca058943907972da5f12e2881e8 \
+ --hash=sha256:f9f6143a8c75945eb960d9eb98905a441394abfa24afaae239d514ffb2586480 \
+ --hash=sha256:fa8f5efb344d6908a1ce62f4a24e2e5780f825d6f53f5f50ec5ffacac72936cb \
+ --hash=sha256:fdd28f912fccfec1846a94e2e1e8f9b0012f557f0c46fe4f3eb0d7a87afcf90b
+ # via
+ # pyopenssl
+ # rfc3161-client
+ # sigstore
+dnspython==2.9.0 \
+ --hash=sha256:9a4aedb833c3c1b49214d04d44d3032ab7a9135f7c1d29a549b4ff78fd82fda9 \
+ --hash=sha256:b44dc6b18f07a8b1c56676a19fbfdb5209415b046a9cece286baafa87ff3f7f1
+ # via email-validator
+email-validator==2.3.0 \
+ --hash=sha256:80f13f623413e6b197ae73bb10bf4eb0908faf509ad8362c5edeb0be7fd450b4 \
+ --hash=sha256:9fc05c37f2f6cf439ff414f8fc46d917929974a82244c20eb10231ba60c54426
+ # via pydantic
+id==1.6.1 \
+ --hash=sha256:d0732d624fb46fd4e7bc4e5152f00214450953b9e772c182c1c22964def1a069 \
+ --hash=sha256:f5ec41ed2629a508f5d0988eda142e190c9c6da971100612c4de9ad9f9b237ca
+ # via sigstore
+idna==3.20 \
+ --hash=sha256:a7db850025b95ded1eae8a46181a1a6c56c92c96f0e2b005d9ff8dc0210cab44 \
+ --hash=sha256:ab7ae7122974553370f0bdb919e1a960b2cd1bc1ef0276416d896db81c14582c
+ # via
+ # email-validator
+ # requests
+markdown-it-py==4.2.0 \
+ --hash=sha256:04a21681d6fbb623de53f6f364d352309d4094dd4194040a10fd51833e418d49 \
+ --hash=sha256:9f7ebbcd14fe59494226453aed97c1070d83f8d24b6fc3a3bcf9a38092641c4a
+ # via rich
+mdurl==0.1.2 \
+ --hash=sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8 \
+ --hash=sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba
+ # via markdown-it-py
+packaging==26.3 \
+ --hash=sha256:94edc256424af38762eb31306eed28beb9f0efc50a8837492c9d6fd6004aed79 \
+ --hash=sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c
+ # via -r .github/release-signing-requirements.in
+platformdirs==4.13.3 \
+ --hash=sha256:5e567f664eb087ab8521c0179cd8d1bd60857d271136567a39719e28e2d383ce \
+ --hash=sha256:f6ad7f447f24f8a3b82cce5976387428bff894a0eca6c3488f4a17f153c130c4
+ # via sigstore
+pyasn1==0.6.4 \
+ --hash=sha256:9c447d8431c947fe4c8febc4ed9e760bc29011a5b01e5c74b67025bd9fb8ce81 \
+ --hash=sha256:deda9277cfd454080ec40b207fb6df82206a3a2688735233cdcd8d3d565f088b
+ # via sigstore
+pycparser==3.11 \
+ --hash=sha256:51d5a8ba2be0bbe440b99d2112604c95bbbc3c2748a64260186c541e1729cd80 \
+ --hash=sha256:d875f09c3507d00e1aba0eecc6dcadc1352f30fff09dc6bff2f1c2935e97c2bc
+ # via cffi
+pydantic==2.14.1 \
+ --hash=sha256:9195d967ec791692a04438115466764fb8b9a27b31f14a760437694f40d6b454 \
+ --hash=sha256:94f478203dd03404682a1ada216965651dd74b1d2d5ffd62e00e0837caab5c26
+ # via
+ # sigstore
+ # sigstore-models
+ # sigstore-rekor-types
+pydantic-core==2.50.1 \
+ --hash=sha256:0036473f5583e6a60e50b8b21651511564277a3f05cc5dab8cf579f552cd5f6c \
+ --hash=sha256:0048b6dddc8ef4b64fccaad878bd143b0c3882ea9936279dc11d613f6b7dd1bc \
+ --hash=sha256:009634b83993777ddcd69cad0ffcace43dabde692109528e35f0fde91e386a8b \
+ --hash=sha256:028e2f212273d4a39b1ec1e0de8166b1165a65fc0f1111452a9d94fc7c625c63 \
+ --hash=sha256:062e891facce5ca296a1c37098e5e466780457f86413894b399f0cf22934f769 \
+ --hash=sha256:06e01fbbfdb9be777b316a71b6c49efaf4a08b615d0a98d678cda3023f79d019 \
+ --hash=sha256:06ead20d39ffd6f2f6f2a8f8a6de67ff8bb1b4f14a8a30e058502514ee2ac685 \
+ --hash=sha256:0b3a6f334c6a2345ca15318ff894502a90012536404b37c844a976c76c846e0b \
+ --hash=sha256:0c003c3b7f49debb893d2d85ae099ac5959c9839e2f330fadb1fcdf7a6594482 \
+ --hash=sha256:131059670f1d2444269b8585cb888963994871932447c08b39ac6a51fcfef658 \
+ --hash=sha256:132529c83901437ff642f585216831bf5fd7a91df66829907e155192ead62498 \
+ --hash=sha256:17e722e156d0444ecaefbe640bdb60928752bf2013e2b7a11cdb099aaae19bec \
+ --hash=sha256:1a9006395dece0e32e704c315eff8a00bede494f6108546cfc5539c89fef4f9a \
+ --hash=sha256:1c8632d4ac04e6f91128fca584b3a8a507d81604c24eeaaad00d4be42765c32b \
+ --hash=sha256:1c96fd793b73d1b92e65570132505498fe7b21eaef73cdf74e67e5dfba7ac9e4 \
+ --hash=sha256:1cf41f1ae3fa155cf167a72689ad044bcc1e3c97e064123677149bdfb5dafc4a \
+ --hash=sha256:1deeacb112d14d3f4fcb16b165f7dbaf76c70ba6e82f37ba042bdab51970a0b8 \
+ --hash=sha256:1ef800dd7d85bcdadf4c3076e4c94e43939493558a3b69a1ea830c706d4617bb \
+ --hash=sha256:1fa4c8bc12c1354c5550c0c35c1852c8c1901e89e06561724e03f8d0342e1f87 \
+ --hash=sha256:2005207aafe1231315718bf6ed5d064a7300fb4772754af35ee72fc68159492e \
+ --hash=sha256:23923ab9292c40da026330b1ecf4dc2618c8e86e0422e5d1fbf50d94d64ca4f8 \
+ --hash=sha256:23edad659e8dbd8ca7e4e877fe6c81573abbdf215bd25a68b53e1272f58b80c7 \
+ --hash=sha256:2ab756b72bd5054e4c7ef3ded331b35786cbd3cf931531a508f79a9537517064 \
+ --hash=sha256:2cbd1b75b09e976ed0d6b6ca297675632ca35df86130088457cdc60ef36970ae \
+ --hash=sha256:2cf91809d0721ab81592ba67bea7694821679c10b1a2e3c3460082b286c1918a \
+ --hash=sha256:2df1ff41884de2bc4b307bafd7c40a691094fad2ff8e767e5b45a319257bcf4e \
+ --hash=sha256:2eb75304506894a281d346220a4f7481a1b8729577c5ed2a05395991966a8396 \
+ --hash=sha256:2eedf82ee4753cdab8e50044c6bd569577eebc3859b11fecf4eb9223761ff966 \
+ --hash=sha256:30ddf019d082c117b5d309e5b86710c2a78909907ec1a9381feec3eec02eca0b \
+ --hash=sha256:325c23f3e35cfbf0fe3486fa5f7260d1e45885173002d30a28ca019994124255 \
+ --hash=sha256:32fad3a91e51b6d2039c572db04a5a873260b399f6bd62c3552671fa7a4a2899 \
+ --hash=sha256:36c426eac0af8d1529ff8467e612b933346caec1fdc0d774f78f67a1a11e16c1 \
+ --hash=sha256:3a5fce22f1e87d181e924e12da7d81cfe031fb3881a5ddf26ad28f141756ca43 \
+ --hash=sha256:3aa9de446b793de2beb6fa2d9d0961803126c4e2a99c2f25ab59b9fd6ea125c0 \
+ --hash=sha256:3e46a9eb0a0901dd6275e6b06ac3a464885ef350ec4121fe486869de8053e4bb \
+ --hash=sha256:3fde4fdc6487a58d944ca87cf5adc95d5f266e872c19599f5f4c0a8a1b1f9f9f \
+ --hash=sha256:409e0ea40ec30d9158f33574fd758e689f6045a0f2596701828c27816ca9687d \
+ --hash=sha256:40f523349960fa30f3ea51404308ff50f9997a90df639590f47a057c1f32b415 \
+ --hash=sha256:41bc8237121bd8dc8d888dfd6279fc166ffc88c1f1bf3a8bf00869680533ca4c \
+ --hash=sha256:42b54c2c90ad348b5e3a85e03e715d572c1fde357ef104cdfe3b03b697a404ea \
+ --hash=sha256:455a773617b5913bf5c20d0692e5787b119e52c4d40ea644ca31f5758fd31be2 \
+ --hash=sha256:45b11cac094aa25725581d9304eee93c9028516b9ea80dd9e175e13a5a2c840e \
+ --hash=sha256:45c6266d071c241f2a168d45bf8c54344f0effce35e7e6b73afdec11f3687568 \
+ --hash=sha256:46b3301d3b5c886f77de7546e47274a5842c622ea2020b8c6524c6b66913b4a6 \
+ --hash=sha256:476f6ed8e43cd1e0b460920e23571700872b284e77331cb30c4faf459cf48a4b \
+ --hash=sha256:48569b0ade9edfbe065cad1d700175546592aebbb42f02adcebcc26e75b896fe \
+ --hash=sha256:49c2cbb2397fe4d0987e84606e691af6cb87bc0ee1bd3e7b737f7e10b4c142f9 \
+ --hash=sha256:4a53d13cdfbedbfa87f08b83c1a0a5efcc767d785a4b41934fa9cb672670493a \
+ --hash=sha256:4be846f55c9477f5f3ddde8f2ce941137e16862a56d018ed885d422bb6ae02f2 \
+ --hash=sha256:4df197990c15b5a37c5a277d131d9f2c67de6133f2e5dafd80d9bba4b99f46f9 \
+ --hash=sha256:4e834f6a8e4ff772dcc34f58ef5504147a3ea5b0f4eeb13b0f8eb2ca75ac57f1 \
+ --hash=sha256:57f51b31ff826e2859120cf4737c5a758a48d96f3e97da40ccee1796d58078ff \
+ --hash=sha256:5958c72adb417c39b12ac87525ac60b0d73315fcdc59e21f44ee4a5e2512c9ef \
+ --hash=sha256:5dfe41f232befddb9c4377f6cfc702b51595e2d78ed082672adf8758d2c4619f \
+ --hash=sha256:5f3cae32fc46121f787cb2486de9cf95a8bf72aec5cc78f64c606fa1735a6ef5 \
+ --hash=sha256:64f6047f62a6c5ae08d0a6afb035667aa2d97c3d20d69762e034c5ea144d92a5 \
+ --hash=sha256:6a733778df2f7087ec1100ed0b41533e4f3001976e99570fa34f57c66e7f8e3e \
+ --hash=sha256:6b20a4bffabdad0db2927ac034ae3b8a681b1f7a0182f3e60b479ad2fde21ebb \
+ --hash=sha256:6dbcbee53bf17196a7f745aa9bf5a9603953a1e365b1f020be3207c676a3e7c4 \
+ --hash=sha256:6ed4f3cef55164b026fefb41341b7754cc6b624c75dfe7142d2ecceb5ad21c87 \
+ --hash=sha256:704075d10b74f2f3c6e15407c696d88701df35fc8953f434a431add0d0074db0 \
+ --hash=sha256:739dc730e6be3bd5ec2f4ab5cfc7eb047cc45fc1497b3bafec74ff2ed07df597 \
+ --hash=sha256:7456d699b13954e9c0164dcb267250a10ae0dfb03e6e26d6796ab0d46e189c84 \
+ --hash=sha256:756d669f04e62ec4148ecfe22be6a4484d9b1181a6ef32e205ebfd200540858b \
+ --hash=sha256:7689580e72a642ab5ec64d5f55b2e33636fa43b4ebe63c0c2c965ef307c7d1aa \
+ --hash=sha256:76e2e83fa6ec8cdc972d438dafc2522b3a47bee4ec0ae668b29cfb1977ab5242 \
+ --hash=sha256:7816e98acc08119dc0f340ab167048ecc54126316330c1f0caf7c6756c88e28f \
+ --hash=sha256:79490e33c4c0fcb933bbbcfc3a62184d8803b99f535863dfbb925e1bcb6945ad \
+ --hash=sha256:7f476456ac2bb0d937f75191494a09c83a30765fea4f70f3b404942fe25f6cdf \
+ --hash=sha256:844b869f118e22a41a091bdcedda8a71bc1b0f62c38d1a0c3211cece47e1d8fc \
+ --hash=sha256:84bc765b282a9d5b7fe0348b8648904f25a6a04b2139da52b1dd30c8ac3a2c8f \
+ --hash=sha256:84f34323a61a365b4e9295de6028474754829aaddd59c7bf1a040e7487ef8f3c \
+ --hash=sha256:8812592c85d0edf423f10eadcef42716d71e8219085ad9e85b775057b7306133 \
+ --hash=sha256:88e492e8b9d0312e7dc13667c30222abf284dc3b79b5302b3607b41a5784ce61 \
+ --hash=sha256:8a6791afa2245e6c6b180122d105941644f5bd410bb18623b408808cc41a3102 \
+ --hash=sha256:8b4c3df25bd323bf1d36a648d563cf1fc69d717451569927151bdad7cad07a77 \
+ --hash=sha256:8daa7ee75245d43ad7d747e5c9ecc1b1d06552f72b14887e9276f787d57375f4 \
+ --hash=sha256:93ba4e9d8210d941c200431a56b2c0400b131865947903937ed3ec5404307d2e \
+ --hash=sha256:94845ff54dc5193f228cab81b2662a04bfbb892e95bdc15edf7399000ce57d54 \
+ --hash=sha256:94be440c03fede26969a5ce75468e0e6a9927a1b46d9b679ee8adc1b057b0350 \
+ --hash=sha256:9572c1369e9c9da2d64a7b7992c786d90ff295abc93964cfe3125e4290768070 \
+ --hash=sha256:983a662de2571cb2502fc8ff47b6770b03d025d2eb314c92f77b3f07c74720ed \
+ --hash=sha256:992c3514ec891fa7858099183e4d64e6bd5a5d4ff452fae29df22faa77a006bb \
+ --hash=sha256:99ba9bc2b8062ea0c326a990f7f00e6530c23579de66dd246e72c4cafef950a5 \
+ --hash=sha256:9d1bed94af6a63835461f3cf7502058eb166c58c4778e11d0f433cfb1bd69e19 \
+ --hash=sha256:9e4472072de0137ee0d8e72d6620e85939c271d2f90f6bbb4b15c24638b79f92 \
+ --hash=sha256:a27c09d86600f1bf2fe3f37e1ae697faf3143931c09322cd799da94deee923b5 \
+ --hash=sha256:a29a061fec0b4e2d714f277e70a3a18125ecff803f2fea6eade2f2e53711d112 \
+ --hash=sha256:a3cda0e538208e5d722bbf3698b24f19c0a7d05bc8d5f8a7f9b121ea7fa243d9 \
+ --hash=sha256:a44101320cfe99432db74237545a63057dc7a88dfe792cbcad0647f2af56cb81 \
+ --hash=sha256:a4aaaa791bdae1c972a7e81765f4f3571c926b8e0b9b6e47346499fb80079665 \
+ --hash=sha256:a51eee75939cf811ac09b278745a6cee7dc873ccfbc8b9af3cc88fe4b7ce25b5 \
+ --hash=sha256:a7c58106de36ac6a56314182958de20db8d3a29dfd5db527192cc754e4f8e7fb \
+ --hash=sha256:aa8224f10880d9bf1b5993988ba153d42a8b4f3f4f511f93b1f09c93ff613c72 \
+ --hash=sha256:acbf31f37c53a5ac0c34706c80b4f5107ba20b05fdd3816124bf236ef0c57dd2 \
+ --hash=sha256:adc06d218a1cadfd2ec4628424d7d79ce4eba69c2965e7e7b55106f0da5208c8 \
+ --hash=sha256:ae28183297fb0d2b8dc46a1f01d51f5e45825fc5afe76a835a6cb7fb34821295 \
+ --hash=sha256:b0135bcdcaa0f23573f286e4cb5e0fd2962700964ed13df085b85f2b97aeab9e \
+ --hash=sha256:b087b1c5be7ac687cf22eabfe4b6b608d40df23610651e93611e1f49118baf84 \
+ --hash=sha256:b0d955195bbbe489ad343fcc956eacea9357b79cb22192c66cacdefcbc14b32f \
+ --hash=sha256:b281a3b0f0822618fe5e3e0d8a2048b6356b14388505dc9374ccffeb69989713 \
+ --hash=sha256:b6d0c2183008c188e19f4906d426b293bdc4f67ab17df8e180fe16cda208fa71 \
+ --hash=sha256:bbce99252ba3167b2b6277f1829d5bf4b43b754524bddf7f944707c3db7d2253 \
+ --hash=sha256:bc1f08f68dac9f9e83845a8039880aba2ab553eb9b2259c3243a313182c253fe \
+ --hash=sha256:bc94f474417604bd383d2cd445d071b07dd55fedceed3ce33407bf1fcc107290 \
+ --hash=sha256:bed5163e03b98bc1fa2eb05d74c63d9c5c95d8ed6254985481640fbf5e237dea \
+ --hash=sha256:c17799a62c142d61b8a3c51752a7cbc87fe2ad4ccfab10e628a77b405075c662 \
+ --hash=sha256:c18db21573bd2c6489f9a544b7499f0df2853958c568e5e783536ee1f690af41 \
+ --hash=sha256:c3ede305158e75510be50869b319550ab072008c13d64d4ab1e094fb286b6f44 \
+ --hash=sha256:c516cc5367ca3448995d42cb994bf3f4c9002d2a7c22eac9622551269ad1b807 \
+ --hash=sha256:c531166c42ea7bdfecc8c50049581f05dd1993b09cc7c52bb36a14e96deaec7d \
+ --hash=sha256:c73622ef819328873b53109ee4f77ceb598bffedd02daf916102be3228866b78 \
+ --hash=sha256:c8dce1f1e0e5358b682a6ad3fa5e31b31d4560997b8e61417e9217c8d60f8a0c \
+ --hash=sha256:cb57f304525a5e3c13333b772bf9a473f36326e9c821b2e8e1b2fd36f80ae2c3 \
+ --hash=sha256:ce8c25ca38cc0e3d7753ba180808de2c0c8cb24eae0df64491e40921454e9831 \
+ --hash=sha256:ceff0acc940be2715bd6ad17b24c0e5304abf44f6efd0f81ee8499e640f9dc86 \
+ --hash=sha256:cf356f70551d40374eaffb1aa63f1eb6d2006681cbd7a9faea173ce0f4dd7cd2 \
+ --hash=sha256:d2d82aa62521c55ddfb000ae70f88cdd8de974078f6024e821dfe5addd0c818f \
+ --hash=sha256:d32f3acc081cc3923386d88f422cde8892335e95f034e0104bb4cf9310d9915f \
+ --hash=sha256:d4193206b6587047437f6f11d7e776df23e1c1e23af2a54d9347275614791e10 \
+ --hash=sha256:d5c0e32fdbce7f1e8ef4d11f655694bf5f4175c757a9f1dc2be09b8864e5bcf5 \
+ --hash=sha256:d5e062c01286d861fd6a1c4ff6e063547b3e713067f2df033c0ff97ac2ca006b \
+ --hash=sha256:d8f9e8a6c4ab04b78d61f78627370d834eb004b2869dcb28cfffa647b4ea1980 \
+ --hash=sha256:d939de9c82e2126f7f48a7e658f8a85ed46d57662d53f44c49b8895fe94a3eb7 \
+ --hash=sha256:de531ce1e2a3364e8767878b58f4ff728a434b4fde089781fe30b1e08e2396e0 \
+ --hash=sha256:e50d7b94baac6c7d09927fa5ca5800a0c7ee5015c7fcff65beb3a1931b5a6e09 \
+ --hash=sha256:e5faeaee74a57d32b3ab3aebad2e348f06d3ba946fc5d28c1728455f00a3d13a \
+ --hash=sha256:e6f0cc1bb9900dc558960894adeb30b0c083366fc1d69b856209fb2ca5c36fe5 \
+ --hash=sha256:e8e1d6ce820aa23317e8209a86bd65a540973c12dc7552b48a4f6c8e9926815e \
+ --hash=sha256:ed1e728b39a383c81035b2459cfcb35d99dfb01f7d6ebe3a913bc1cc5b81e459 \
+ --hash=sha256:ee6db2fbed51a7991302e8fac498cd67e336246026d0dfa84cf5166ce1412760 \
+ --hash=sha256:efbecf43d321f7b9281441f1f213f7c21c66988b0e06c2730ba13ed47a46bb08 \
+ --hash=sha256:f2c634642694e6a0dad2ab1d375589fa671fd442edd5caf7d9737b8f6ca22906 \
+ --hash=sha256:f3377c8c2b3ce898423c5e5dd94c7982e30aa7717a7e6ab2470b9de364963709 \
+ --hash=sha256:f5187624823423e1d1b82b1072ac41dc837389e18d3d0572cc19bbee46cd550a \
+ --hash=sha256:f77ac30b19221cd9bd3fcfa3d4614eff93140d0572ab730cded17b64adca05f3 \
+ --hash=sha256:fe90228920fd8ff2be62622b6bb8a2b11acd65046d50c6b130614b5879605a20
+ # via pydantic
+pygments==2.21.0 \
+ --hash=sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9 \
+ --hash=sha256:610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c
+ # via rich
+pyjwt==2.15.1 \
+ --hash=sha256:42d59d631f7768a1028a64c7ff581a9bf7519804daf91fc5b6c56e30eec5e193 \
+ --hash=sha256:4f259e80cdfb6b3fc18a7de51fd1ef9ec79652f25019bae68975ca2468a34df8
+ # via sigstore
+pyopenssl==26.4.0 \
+ --hash=sha256:28dfcce0162b9211413e26dfbfdf1d24317fbeba18fc93c12400a1856b2a0bc7 \
+ --hash=sha256:f0eb0cb2d581d3ad2b9c489468485e7f2ab6727d08401bcf9d824c3caddf3c1c
+ # via sigstore
+requests==2.34.2 \
+ --hash=sha256:2a0d60c172f83ac6ab31e4554906c0f3b3588d37b5cb939b1c061f4907e278e0 \
+ --hash=sha256:f288924cae4e29463698d6d60bc6a4da69c89185ad1e0bcc4104f584e960b9ed
+ # via sigstore
+rfc3161-client==1.0.9 \
+ --hash=sha256:03be7ac7919c7f4c566076b07773b81b1f1b28d447fa91c6960fb5f82fac5bc1 \
+ --hash=sha256:0ac247d5aa22f3514d1e284bdc547d2ad5f101e1e5d7f6db25db2ab3a0c59f06 \
+ --hash=sha256:4d33f5aaec2974239e1c62a79a6fcf32506b09095482377a8b5be3a00fa67dfb \
+ --hash=sha256:5e619d7e28ffa3a46685923e6d6ba4ce2e74cb09a41c77995a0702cc1a533bc4 \
+ --hash=sha256:614da494c6f8850c5d6d98c23bc291a4e4dbf2c3c9082d9907fa156f9e4a75c6 \
+ --hash=sha256:66997415086d2c6e5d57a2d315157b32a9c3f4f1312877ca8eb55e2e0ddf8ce4 \
+ --hash=sha256:7b703b233dbee7228d117d5f1c118363c61d523fa6f018c9217c79e3c6684f86 \
+ --hash=sha256:8208999e94e1252e3f5f748f5efe59d3b9c308d04c7626be1becfbf3236c9de4 \
+ --hash=sha256:908f6a775da4bdce1d39f825a4431f389542696078ef3e4ed911a068bcaf1792 \
+ --hash=sha256:a7004edfbf1bb7ec7801978a39fa7a7fe385ca59673df90d7578079b6eba3b24 \
+ --hash=sha256:d3cbf1991b6f3457efcb25e1d31179cac556112e6d3e65ec9e0fd70c6e9af90d \
+ --hash=sha256:d4cf92f0e784ff02ff5ea1c574f8521f30953dc178092424126dbd8348034f93 \
+ --hash=sha256:fac3f440a507555e684dc5daba75e33dc08f0f45fdefa48448f19001233a6b21
+ # via sigstore
+rfc8785==0.1.4 \
+ --hash=sha256:520d690b448ecf0703691c76e1a34a24ddcd4fc5bc41d589cb7c58ec651bcd48 \
+ --hash=sha256:e545841329fe0eee4f6a3b44e7034343100c12b4ec566dc06ca9735681deb4da
+ # via sigstore
+rich==15.0.0 \
+ --hash=sha256:33bd4ef74232fb73fe9279a257718407f169c09b78a87ad3d296f548e27de0bb \
+ --hash=sha256:edd07a4824c6b40189fb7ac9bc4c52536e9780fbbfbddf6f1e2502c31b068c36
+ # via sigstore
+securesystemslib==1.5.1 \
+ --hash=sha256:4b8d00abd93707ead10b69eb2b8582376a1364de3b0a71077de534c2ef4985e0 \
+ --hash=sha256:ada8bdf817da29ece4ba91654f6a162ce7cfbadbc3ae3f840f7313f9d22675de
+ # via tuf
+sigstore==4.5.0 \
+ --hash=sha256:020d3e07f622b2916bf453e66ff6ff0711e1fdc5ab69e8bd8902f71d9fcb316f \
+ --hash=sha256:f045b207f2e12605cf775ec38e89c5eda625d71ffa7830477db65e47ec2bc8b2
+ # via -r .github/release-signing-requirements.in
+sigstore-models==0.0.6 \
+ --hash=sha256:5201a68f4d7d0f8bec1e2f4378eb646b084c52609a4e31db8c385095fff68b2e \
+ --hash=sha256:c766c09470c2a7e8a4a333c893f07e2001c56a3ff1757b1a246119f53169a849
+ # via sigstore
+sigstore-rekor-types==0.0.18 \
+ --hash=sha256:19aef25433218ebf9975a1e8b523cc84aaf3cd395ad39a30523b083ea7917ec5 \
+ --hash=sha256:b62bf38c5b1a62bc0d7fe0ee51a0709e49311d137c7880c329882a8f4b2d1d78
+ # via sigstore
+tuf==7.0.1 \
+ --hash=sha256:5ada1db78da3518fa851e28588f4b2249b8662a28ae528f54afa2a1de541fb31 \
+ --hash=sha256:d30434bda6e079ab303fb30d1b3006d939a10ca34783b1573d61cd9b802fa45c
+ # via sigstore
+typing-extensions==4.16.0 \
+ --hash=sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8 \
+ --hash=sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5
+ # via
+ # pydantic
+ # pydantic-core
+ # pyopenssl
+ # sigstore-models
+ # typing-inspection
+typing-inspection==0.4.4 \
+ --hash=sha256:547274fa6b0a561ccf549cc9524b999a578e737d015d8709d021f9d0d13bea47 \
+ --hash=sha256:65b8397ba37ccbce054456aaccddfc91e6e3083c92824df348d96ca832f3f147
+ # via pydantic
+urllib3==2.8.0 \
+ --hash=sha256:0cf3cae568d36aa9576b28dfb35f11328f1cb974ca7647d9475ebb86c75ac6e3 \
+ --hash=sha256:63bf2ead4c879426ebf22ef2a781eeb4aa3b4ae798a0435506f8687fd5bb9b63
+ # via
+ # id
+ # requests
+ # tuf
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index d8afd9dab..ccf6b152a 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -141,7 +141,9 @@ jobs:
needs: changes
if: needs.changes.outputs.python_required == 'true'
runs-on: ${{ matrix.os }}
- timeout-minutes: 20
+ # Windows runs real isolated update jobs before the complete compatibility
+ # suite; that suite was still progressing at the former 20-minute job cap.
+ timeout-minutes: ${{ matrix.os == 'windows-latest' && 30 || 20 }}
env:
PYTEST_ADDOPTS: "-o tmp_path_retention_policy=failed -p scripts.pytest_timing"
strategy:
@@ -152,22 +154,22 @@ jobs:
os: ubuntu-latest
python-version: "3.11"
coverage: false
- # CLI command tests assert exact Rich terminal output; run them
- # serially below so xdist cannot change terminal-width rendering.
- pytest_args: "-n auto --dist loadfile --ignore=tests/cli/test_commands.py"
+ # Keep exact Rich output and real prompt_toolkit pipes in a fresh
+ # CLI process: long-lived workers can exceed select()'s fd limit.
+ pytest_args: "-n auto --dist loadfile --ignore=tests/cli/test_commands.py --ignore=tests/cli/test_cli_input.py --ignore=tests/cli/test_desktop_target.py --ignore=tests/cli/test_desktop_target_entrypoints.py"
- name: latest, 3.14 + coverage
os: ubuntu-latest
python-version: "3.14"
coverage: true
- pytest_args: "-n auto --dist loadfile --ignore=tests/cli/test_commands.py"
+ pytest_args: "-n auto --dist loadfile --ignore=tests/cli/test_commands.py --ignore=tests/cli/test_cli_input.py --ignore=tests/cli/test_desktop_target.py --ignore=tests/cli/test_desktop_target_entrypoints.py"
- name: Windows, 3.14
os: windows-latest
python-version: "3.14"
coverage: false
- # Real PowerShell, browser-handoff, and process-tree tests run
- # serially so xdist workers do not compete for native processes.
- # Keep threaded storage work bounded without adding another runner.
- pytest_args: "-n 3 --dist loadfile --ignore=tests/cli/test_commands.py --ignore=tests/tools/test_exec_platform.py --ignore=tests/cli/test_wsl_browser.py"
+ # Process identities run serially; isolated update jobs use case-level
+ # scheduling below so one file cannot serialize all real venv work.
+ # Retain main's three-worker budget and the separate native-process job.
+ pytest_args: "-n 3 --dist loadfile --ignore=tests/cli/test_commands.py --ignore=tests/cli/test_cli_input.py --ignore=tests/cli/test_desktop_target.py --ignore=tests/cli/test_desktop_target_entrypoints.py --ignore=tests/tools/test_exec_platform.py --ignore=tests/cli/test_wsl_browser.py --ignore=tests/test_install_scripts.py --ignore=tests/test_update_jobs.py --ignore=tests/test_update_profiles.py"
steps:
- uses: actions/checkout@v4
@@ -200,6 +202,13 @@ jobs:
- name: Verify dependency consistency
run: uv pip check
+ - name: Install pipx for offline installer checks
+ if: runner.os == 'Linux'
+ shell: bash
+ run: |
+ uv tool install pipx==1.17.12
+ uv tool dir --bin >> "$GITHUB_PATH"
+
# Channel requirements live in manifests rather than uv.lock. Avoid a
# later uv run sync pruning the packages installed by the previous step.
- name: Lint with ruff
@@ -210,6 +219,27 @@ jobs:
if: matrix.coverage
run: uv run --no-sync basedpyright
+ - name: Check Windows update coordination before the full suite
+ if: runner.os == 'Windows'
+ run: >-
+ uv run --no-sync python -m pytest
+ tests/test_installation_lock.py
+ tests/test_update_profiles.py
+ tests/utils/test_helpers.py::test_atomic_record_reader_does_not_block_concurrent_replacement
+ tests/gateway/test_runtime.py::test_runtime_state_publish_keeps_existing_snapshot_readable
+ tests/gateway/test_runtime.py::test_runtime_state_reader_does_not_block_publish_while_decoding
+ -q --junitxml=test-results/coordination.xml --timing-report=test-results/coordination.json
+
+ # Each update job owns its venv, HOME, profile and lock directory. Preserve
+ # the real installation/restore checks, but avoid a loadfile straggler and
+ # disk contention with timing-sensitive runtime-registration checks.
+ - name: Run Windows isolated update jobs
+ if: runner.os == 'Windows'
+ run: >-
+ uv run --no-sync python -m pytest tests/test_update_jobs.py
+ -n 3 --dist load -vv --durations=25 --durations-min=1.0
+ --junitxml=test-results/update-jobs.xml --timing-report=test-results/update-jobs.json
+
- name: Run tests with coverage
if: matrix.coverage
run: >-
@@ -220,11 +250,12 @@ jobs:
--junitxml=test-results/main.xml --timing-report=test-results/main.json
--durations=25 --durations-min=1.0
- - name: Run serial CLI command tests with coverage
+ - name: Run serial CLI input and command tests with coverage
if: matrix.coverage
run: >-
uv run --no-sync python -m pytest
- tests/cli/test_commands.py
+ tests/cli/test_cli_input.py tests/cli/test_desktop_target.py
+ tests/cli/test_desktop_target_entrypoints.py tests/cli/test_commands.py
--cov=nanobot --cov-append --cov-report=term-missing:skip-covered
--junitxml=test-results/cli.xml --timing-report=test-results/cli.json
--durations=25 --durations-min=1.0
@@ -237,11 +268,12 @@ jobs:
--junitxml=test-results/main.xml --timing-report=test-results/main.json
--durations=25 --durations-min=1.0
- - name: Run serial CLI command compatibility tests
+ - name: Run serial CLI input and command compatibility tests
if: ${{ !matrix.coverage }}
run: >-
uv run --no-sync python -m pytest
- tests/cli/test_commands.py
+ tests/cli/test_cli_input.py tests/cli/test_desktop_target.py
+ tests/cli/test_desktop_target_entrypoints.py tests/cli/test_commands.py
--junitxml=test-results/cli.xml --timing-report=test-results/cli.json
--durations=25 --durations-min=1.0
@@ -293,6 +325,22 @@ jobs:
--junitxml=test-results/process.xml --timing-report=test-results/process.json
--durations=25 --durations-min=1.0
+ - name: Install pipx for offline installer checks
+ shell: bash
+ run: |
+ uv tool install pipx==1.17.12
+ uv tool dir --bin >> "$GITHUB_PATH"
+
+ # Installer subprocesses run here, parallel to the broad Windows suite.
+ # Each case owns an isolated manager/config root, so individual cases can
+ # run concurrently without sharing a console or package installation.
+ # Keep four workers: three exceed this job's budget on native Windows.
+ - name: Run Windows installer checks
+ run: >-
+ uv run --no-sync python -m pytest tests/test_install_scripts.py
+ -n 4 --dist load -x -vv --durations=10
+ --junitxml=test-results/installers.xml --timing-report=test-results/installers.json
+
- name: Upload Windows process test timings
if: always()
uses: actions/upload-artifact@v4
@@ -314,7 +362,7 @@ jobs:
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
- bun-version: 1.3.6
+ bun-version: 1.3.13
- name: Verify npm lockfile
working-directory: webui
@@ -361,7 +409,7 @@ jobs:
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
- bun-version: 1.3.6
+ bun-version: 1.3.13
- name: Install WebUI dependencies
working-directory: webui
@@ -391,10 +439,12 @@ jobs:
tui:
needs: changes
- if: needs.changes.outputs.tui_required == 'true'
+ if: needs.changes.outputs.tui_required == 'true' || needs.changes.outputs.python_required == 'true' || needs.changes.outputs.webui_required == 'true'
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
- timeout-minutes: 10
+ # Native build + clean install + recovery/next-update journeys on Windows.
+ # Each subprocess is separately bounded by the acceptance harness.
+ timeout-minutes: 60
strategy:
fail-fast: false
matrix:
@@ -439,11 +489,10 @@ jobs:
working-directory: tui
run: python3 scripts/pty_smoke.py
- - name: Set up Python for ConPTY smoke test
- if: runner.os == 'Windows'
+ - name: Set up Python for native package acceptance
uses: actions/setup-python@v5
with:
- python-version: '3.13'
+ python-version: '3.11'
- name: Test TUI in a real ConPTY terminal
if: runner.os == 'Windows'
@@ -472,6 +521,58 @@ jobs:
bun scripts/release-notices.ts win32-x64
python scripts/package-release.py win32-x64
+ - name: Build and install the native application package
+ shell: bash
+ env:
+ NATIVE_TARGET: ${{ runner.os == 'Windows' && 'win32-x64' || 'linux-x64' }}
+ run: |
+ python -m pip install --disable-pip-version-check build
+ python -m build --outdir "$RUNNER_TEMP/python-dist"
+ # Archive verification shares the installed launcher's dependencies.
+ # Install the intermediate in this build environment, not the separate
+ # clean-home environment used by the public-installer acceptance probe.
+ python -m pip install --disable-pip-version-check "$(find "$RUNNER_TEMP/python-dist" -name '*.whl' -print -quit)"
+ python -m scripts.build_tui_wheels \
+ --wheel "$(find "$RUNNER_TEMP/python-dist" -name '*.whl' -print -quit)" \
+ --tui-dir tui/dist --target "$NATIVE_TARGET" --out-dir "$RUNNER_TEMP/native-wheel"
+ version="$(python -c 'import tomllib; print(tomllib.load(open("pyproject.toml", "rb"))["project"]["version"])')"
+ python -I scripts/verify_installed_release.py \
+ --install-wheel "$(find "$RUNNER_TEMP/native-wheel" -name '*.whl' -print -quit)" \
+ --version "$version" --commit "$(git rev-parse HEAD)" --gateway \
+ --report "$RUNNER_TEMP/native-install-report.json"
+
+ - name: Exercise updates with the default Windows path policy
+ if: runner.os == 'Windows'
+ shell: pwsh
+ run: |
+ # Only this disposable runner changes. Do not require users to enable
+ # machine-wide long paths for an ordinary update's atomic temp files.
+ $key = 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem'
+ Set-ItemProperty -Path $key -Name LongPathsEnabled -Value 0
+ if ((Get-ItemPropertyValue -Path $key -Name LongPathsEnabled) -ne 0) {
+ throw 'Native update acceptance requires LongPathsEnabled=0'
+ }
+ Write-Output 'Packaged update/recovery acceptance: LongPathsEnabled=0'
+
+ - name: Verify packaged upgrades and automatic service recovery
+ shell: bash
+ run: |
+ python -I scripts/verify_packaged_update.py \
+ --wheel "$(find "$RUNNER_TEMP/native-wheel" -name '*.whl' -print -quit)" \
+ --commit "$(git rev-parse HEAD)" --output "$RUNNER_TEMP/packaged-update"
+
+ - name: Retain the native package acceptance report
+ if: always()
+ uses: actions/upload-artifact@v4
+ with:
+ name: native-install-${{ runner.os }}-${{ github.run_id }}-${{ github.run_attempt }}
+ path: |
+ ${{ runner.temp }}/native-install-report.json
+ ${{ runner.temp }}/packaged-update/packaged-update-report.json
+ ${{ runner.temp }}/packaged-update/*/result.json
+ if-no-files-found: error
+ retention-days: 3
+
docker:
needs: changes
if: needs.changes.outputs.docker_required == 'true'
diff --git a/.github/workflows/release-approve.yml b/.github/workflows/release-approve.yml
new file mode 100644
index 000000000..7da55a5fb
--- /dev/null
+++ b/.github/workflows/release-approve.yml
@@ -0,0 +1,87 @@
+name: Approve Exact Release
+
+# No schedule, release trigger or PR token. Repository administrators must first
+# protect main and release-approval, then explicitly enable the repository var.
+# This produces a signature only: it never uploads release assets or writes a feed.
+on:
+ workflow_dispatch:
+ inputs:
+ version:
+ description: Exact previously tested version (without v)
+ required: true
+ type: string
+ manifest_sha256:
+ description: SHA-256 from the independently reviewed candidate evidence
+ required: true
+ type: string
+ source_commit:
+ description: Reviewed full source SHA
+ required: true
+ type: string
+ candidate_commit:
+ description: Tested full candidate SHA
+ required: true
+ type: string
+
+permissions: {}
+
+concurrency:
+ group: release-approval
+ cancel-in-progress: false
+
+jobs:
+ approve:
+ if: >-
+ github.repository == 'HKUDS/nanobot' && github.ref == 'refs/heads/main' &&
+ vars.NANOBOT_RELEASE_SIGNING_ENABLED == 'true'
+ environment: release-approval
+ runs-on: ubuntu-latest
+ timeout-minutes: 10
+ permissions:
+ contents: read
+ id-token: write
+ env:
+ RELEASE_VERSION: ${{ inputs.version }}
+ MANIFEST_SHA256: ${{ inputs.manifest_sha256 }}
+ SOURCE_COMMIT: ${{ inputs.source_commit }}
+ CANDIDATE_COMMIT: ${{ inputs.candidate_commit }}
+ steps:
+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
+ with:
+ persist-credentials: false
+ - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
+ with:
+ python-version: '3.11'
+ - name: Install hash-locked signing tools, not the candidate
+ run: |
+ python -m pip install --require-hashes --only-binary=:all: -r .github/release-signing-requirements.txt
+ - name: Fetch only the proposed manifest
+ env:
+ GH_TOKEN: ${{ github.token }}
+ run: |
+ [[ "$RELEASE_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(\.dev[0-9]+|\.post[0-9]+)?$ ]]
+ gh release download "v$RELEASE_VERSION" --repo "$GITHUB_REPOSITORY" \
+ --pattern release-manifest.json --dir "$RUNNER_TEMP/approval"
+ - name: Bind the signature to reviewed evidence
+ run: |
+ python -m scripts.verify_release_approval \
+ --manifest "$RUNNER_TEMP/approval/release-manifest.json" \
+ --sha256 "$MANIFEST_SHA256" --version "$RELEASE_VERSION" \
+ --source-commit "$SOURCE_COMMIT" --candidate-commit "$CANDIDATE_COMMIT"
+ - name: Sign and verify the exact manifest
+ run: |
+ python -m sigstore sign --no-default-files \
+ --bundle "$RUNNER_TEMP/approval/release-manifest.json.sigstore.json" \
+ "$RUNNER_TEMP/approval/release-manifest.json"
+ python -m sigstore verify identity \
+ --cert-identity 'https://github.com/HKUDS/nanobot/.github/workflows/release-approve.yml@refs/heads/main' \
+ --cert-oidc-issuer 'https://token.actions.githubusercontent.com' \
+ --bundle "$RUNNER_TEMP/approval/release-manifest.json.sigstore.json" \
+ "$RUNNER_TEMP/approval/release-manifest.json"
+ - name: Retain small approval proof for the separate publication handoff
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
+ with:
+ name: release-approval-${{ github.run_id }}-${{ github.run_attempt }}
+ path: ${{ runner.temp }}/approval/*
+ if-no-files-found: error
+ retention-days: 3
diff --git a/.github/workflows/release-candidate.yml b/.github/workflows/release-candidate.yml
new file mode 100644
index 000000000..4884b97bb
--- /dev/null
+++ b/.github/workflows/release-candidate.yml
@@ -0,0 +1,188 @@
+name: Verify Release Candidate
+
+# Preparation only: no cron, tags, GitHub Releases, PyPI or channel-feed writes.
+on:
+ workflow_dispatch:
+ inputs:
+ next_stable:
+ description: Next stable base (for example 0.3.6); must not have a stable tag
+ required: true
+ type: string
+ retain_installable:
+ description: Retain this exact installable candidate and source for 1 day (~400 MB); not publication
+ required: false
+ default: false
+ type: boolean
+
+permissions:
+ contents: read
+
+concurrency:
+ group: release-candidate
+ cancel-in-progress: false
+
+jobs:
+ candidate:
+ runs-on: ubuntu-latest
+ timeout-minutes: 45
+ env:
+ SOURCE_COMMIT: ${{ github.sha }}
+ NEXT_STABLE: ${{ inputs.next_stable }}
+ PREVIEW_SEQUENCE: ${{ github.run_number }}
+
+ steps:
+ - name: Set candidate directory
+ run: echo "CANDIDATE_DIR=$RUNNER_TEMP/candidate" >> "$GITHUB_ENV"
+
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ persist-credentials: false
+
+ - uses: actions/setup-python@v5
+ with:
+ python-version: '3.11'
+
+ - uses: astral-sh/setup-uv@v4
+
+ - uses: oven-sh/setup-bun@v2
+ with:
+ bun-version: 1.3.13
+
+ - name: Install isolated build and verification tools
+ run: |
+ uv venv "$RUNNER_TEMP/release-tools"
+ uv pip install --python "$RUNNER_TEMP/release-tools/bin/python" -e '.[dev]' build twine
+ echo "$RUNNER_TEMP/release-tools/bin" >> "$GITHUB_PATH"
+
+ - name: Prepare an exact, separate candidate
+ run: |
+ python -m scripts.release_candidate prepare \
+ --source-commit "$SOURCE_COMMIT" --base "$NEXT_STABLE" \
+ --sequence "$PREVIEW_SEQUENCE" --output "$CANDIDATE_DIR" \
+ > "$RUNNER_TEMP/candidate.json"
+
+ - name: Verify packaging and selection contracts
+ working-directory: ${{ env.CANDIDATE_DIR }}
+ run: |
+ python -m pytest tests/test_release_candidate.py tests/test_releases.py \
+ tests/test_release_install_guide.py tests/test_installed_release_probe.py tests/cli/test_tui_wheels.py \
+ tests/cli/test_tui_release_packaging.py -q
+
+ - name: Check WebUI and build Python distributions
+ working-directory: ${{ env.CANDIDATE_DIR }}
+ run: |
+ cd webui
+ bun install --frozen-lockfile
+ bun run lint
+ bun run test
+ cd ..
+ uv build --out-dir "$RUNNER_TEMP/python-dist"
+
+ - name: Check and cross-build the five native targets
+ working-directory: ${{ env.CANDIDATE_DIR }}/tui
+ run: |
+ bun install --frozen-lockfile
+ bun run check
+ bun run test
+ for target in darwin-arm64 darwin-x64 linux-arm64 linux-x64 win32-x64; do
+ bun scripts/prepare-target.ts "$target"
+ bun run build -- "$target"
+ done
+
+ - name: Ad-hoc sign macOS arm64
+ uses: indygreg/apple-code-sign-action@44d0985b7f4363198e80b6fea63ac3e9dd3e9957
+ with:
+ input_path: ${{ env.CANDIDATE_DIR }}/tui/dist/nanobot-tui-darwin-arm64
+ rcodesign_version: 0.29.0
+
+ - name: Ad-hoc sign macOS x64
+ uses: indygreg/apple-code-sign-action@44d0985b7f4363198e80b6fea63ac3e9dd3e9957
+ with:
+ input_path: ${{ env.CANDIDATE_DIR }}/tui/dist/nanobot-tui-darwin-x64
+ rcodesign_version: 0.29.0
+
+ - name: Package licensed native archives
+ working-directory: ${{ env.CANDIDATE_DIR }}/tui
+ run: |
+ for target in darwin-arm64 darwin-x64 linux-arm64 linux-x64 win32-x64; do
+ bun scripts/prepare-target.ts "$target"
+ bun scripts/release-notices.ts "$target"
+ python scripts/package-release.py "$target"
+ done
+
+ - name: Assemble and verify the complete candidate
+ working-directory: ${{ env.CANDIDATE_DIR }}
+ run: |
+ version="${NEXT_STABLE}.dev${PREVIEW_SEQUENCE}"
+ python -m scripts.release_candidate assemble --source-commit "$SOURCE_COMMIT" \
+ --wheel "$RUNNER_TEMP/python-dist/nanobot_ai-${version}-py3-none-any.whl" \
+ --sdist "$RUNNER_TEMP/python-dist/nanobot_ai-${version}.tar.gz" \
+ --tui-dir tui/dist --output "$RUNNER_TEMP/release-artifacts"
+ python -m twine check "$RUNNER_TEMP/release-artifacts/"*.whl \
+ "$RUNNER_TEMP/release-artifacts/"*.tar.gz
+
+ - name: Install and probe the Linux wheel without frontend build tools
+ working-directory: ${{ env.CANDIDATE_DIR }}
+ run: |
+ version="${NEXT_STABLE}.dev${PREVIEW_SEQUENCE}"
+ uv_bin="$(command -v uv)"
+ uv venv --python 3.11 "$RUNNER_TEMP/installed-candidate"
+ mkdir "$RUNNER_TEMP/empty-install-path"
+ env PATH="$RUNNER_TEMP/empty-install-path" "$uv_bin" pip install \
+ --python "$RUNNER_TEMP/installed-candidate/bin/python" --only-binary :all: \
+ "$RUNNER_TEMP/release-artifacts/nanobot_ai-${version}-py3-none-manylinux_2_17_x86_64.whl"
+ uv pip check --python "$RUNNER_TEMP/installed-candidate/bin/python"
+ "$RUNNER_TEMP/installed-candidate/bin/python" -I scripts/verify_installed_release.py \
+ --version "$version" --commit "$(git rev-parse HEAD)" --gateway \
+ --report "$RUNNER_TEMP/installed-candidate-report.json"
+
+ - name: Generate the exact candidate installation handoff
+ working-directory: ${{ env.CANDIDATE_DIR }}
+ run: |
+ python -m scripts.release_candidate instructions --source-commit "$SOURCE_COMMIT" \
+ --artifacts "$RUNNER_TEMP/release-artifacts" \
+ --output "$RUNNER_TEMP/install-candidate.md"
+
+ - name: Verify packaged Linux upgrades and service recovery
+ working-directory: ${{ env.CANDIDATE_DIR }}
+ run: |
+ version="${NEXT_STABLE}.dev${PREVIEW_SEQUENCE}"
+ python -I scripts/verify_packaged_update.py \
+ --wheel "$RUNNER_TEMP/release-artifacts/nanobot_ai-${version}-py3-none-manylinux_2_17_x86_64.whl" \
+ --commit "$(git rev-parse HEAD)" --output "$RUNNER_TEMP/packaged-update"
+
+ # Keep the default preflight cheap: no ~400 MB archive upload per manual run.
+ # These reports are not installable releases or publication approvals.
+ - name: Retain identity, structural and native Linux probe reports
+ uses: actions/upload-artifact@v4
+ with:
+ name: candidate-report-${{ github.run_number }}-${{ github.run_attempt }}
+ path: |
+ ${{ runner.temp }}/candidate.json
+ ${{ runner.temp }}/release-artifacts/release-manifest.json
+ ${{ runner.temp }}/installed-candidate-report.json
+ ${{ runner.temp }}/packaged-update/packaged-update-report.json
+ ${{ runner.temp }}/install-candidate.md
+ if-no-files-found: error
+ retention-days: 3
+
+ # Explicit, short-lived release handoff only. This is the documented
+ # exception to report-only preflight; never enable it on a daily schedule.
+ - name: Preserve the verified bytes and independent candidate source
+ if: ${{ inputs.retain_installable }}
+ working-directory: ${{ env.CANDIDATE_DIR }}
+ run: |
+ python -m scripts.release_candidate retain --source-commit "$SOURCE_COMMIT" \
+ --artifacts "$RUNNER_TEMP/release-artifacts" \
+ --output "$RUNNER_TEMP/retained-candidate"
+
+ - name: Retain installable candidate for approved release handoff
+ if: ${{ inputs.retain_installable }}
+ uses: actions/upload-artifact@v4
+ with:
+ name: installable-candidate-${{ github.run_number }}-${{ github.run_attempt }}
+ path: ${{ runner.temp }}/retained-candidate
+ if-no-files-found: error
+ compression-level: 0
+ retention-days: 1
diff --git a/.github/workflows/tui-release.yml b/.github/workflows/tui-release.yml
index 43e4e0e23..b44d00048 100644
--- a/.github/workflows/tui-release.yml
+++ b/.github/workflows/tui-release.yml
@@ -92,5 +92,4 @@ jobs:
if [[ "$TARGET" == win32-* ]]; then asset="${asset}.exe"; fi
gh release upload "$TAG" \
"tui/dist/${asset}.zip" \
- "tui/dist/${asset}.zip.sha256" \
- --clobber
+ "tui/dist/${asset}.zip.sha256"
diff --git a/README.md b/README.md
index 016c61f23..fb648bc7a 100644
--- a/README.md
+++ b/README.md
@@ -77,7 +77,12 @@ You need **Python 3.11 or newer** and access to a [supported model provider or l
Choose the **stable release** for everyday use or **current source** for development and the latest features. This README describes current source; [published documentation](https://nanobot.wiki/docs/latest/getting-started/nanobot-overview) covers the released version.
-New to terminals or model credentials? Follow [Start Without Technical Background](./docs/start-without-technical-background.md). Updating an existing instance? Stop every old nanobot process using that workspace, back up its config directory and workspace, then update and restart through the original launcher or service. See [session storage and version changes](./docs/cli-reference.md#session-storage).
+New to terminals or model credentials? Follow [Start Without Technical Background](./docs/start-without-technical-background.md). Updating an existing instance? Follow [updates and recovery](./docs/updating.md) for your installation method, backup steps and restart checks.
+
+| Track | Install with | Update with | What runs |
+|---|---|---|---|
+| Stable | installer, `uv`, or pip | managed installer: WebUI update; other installs: original package tool | one released Python/WebUI/TUI version |
+| Current source | editable Git checkout | `git pull --ff-only` + editable dependency sync | Python, WebUI, and TUI from that checkout |
**Stable release: automatic setup (recommended)**
@@ -104,7 +109,9 @@ irm https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.ps1 | i
Installer details, preview, and script review
-The installer installs or upgrades `nanobot-ai` using an active virtual environment, `uv`, `pipx`, or a managed venv under `~/.nanobot/venv`. Fresh local desktops open the WebUI; SSH, headless, existing-config, and older-release paths use the terminal setup wizard. Keep the printed command: it identifies the environment that owns the installation.
+The default command installs or upgrades the stable PyPI release. Fresh installations use a dedicated environment under `~/.nanobot/venv`. On a fresh local desktop it opens the WebUI for model setup. That gateway keeps running after the browser or terminal closes; use the printed `gateway stop` command to stop it. SSH, headless, existing-config and older-release installs use terminal setup.
+
+Existing installations keep their package manager, extras and constraints. An active ordinary venv remains an explicit target, not an installer-managed environment. The installer avoids system-wide pip and prints the command to reuse if `nanobot` is not on `PATH`.
To preview the plan without changing your environment, pass `--dry-run`.
@@ -197,7 +204,7 @@ Verify the install:
nanobot --version
```
-If `nanobot` is not on `PATH`, invoke it through the method that installed it: reuse the recommended installer's command, use `uv tool run --from nanobot-ai nanobot ...` or `pipx run --spec nanobot-ai nanobot ...`, or use the Python executable from the environment where pip installed the package.
+If `nanobot` is not on `PATH`, reuse the installer's printed command or run the Python executable from the existing installation with `-I -m nanobot`. For uv/pipx, locate that environment with the original manager. Do not use a temporary tool environment to manage an existing installation.
@@ -308,7 +315,9 @@ After model setup, keep channels and automations running when interactive launch
nanobot gateway --background
```
-This starts or promotes the shared gateway to a detached process. From the TUI, `/detach` does the same before closing that client. Background mode does not configure startup after a machine reboot or restart after a crash; use an [OS-managed service](./docs/deployment.md#switch-an-existing-gateway-to-a-service) for that. Interrupted subagent tasks are not automatically relaunched after a restart, and missed scheduled times are not replayed; see [subagent recovery](./docs/concepts.md#subagents) and [automation delivery](./docs/automations.md#delivery-and-reliability).
+This starts or promotes the shared gateway to persistent background mode. Fresh official-installer environments already use that lifetime when you open `nanobot webui`; other Python installations can explicitly use `nanobot webui --detach`. Channels and automations remain active after local clients exit. Complete first-time model setup in the WebUI, and use the gateway commands below to manage the same instance.
+
+From the TUI, `/detach` does the same before closing that client. Background mode does not configure startup after a machine reboot or restart after a crash; use an [OS-managed service](./docs/deployment.md#switch-an-existing-gateway-to-a-service) for that. Interrupted subagent tasks are not automatically relaunched after a restart, and missed scheduled times are not replayed; see [subagent recovery](./docs/concepts.md#subagents) and [automation delivery](./docs/automations.md#delivery-and-reliability).
Manage the background gateway with:
diff --git a/docs/README.md b/docs/README.md
index a53d6a384..e24103836 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -58,6 +58,7 @@ For shorter, outcome-focused walkthroughs, browse the [task guide index](./guide
| Need | Read |
|---|---|
| Commands and flags | [CLI Reference](./cli-reference.md) |
+| Update an installation or recover an interrupted update | [Updating nanobot](./updating.md) |
| In-chat slash commands | [In-Chat Commands](./chat-commands.md) |
| Config, workspace, gateway, sessions, tools, and memory in plain language | [Concepts](./concepts.md) |
| Provider/model matching and selection | [Providers and Models](./providers.md) |
@@ -90,5 +91,7 @@ These pages explain implementation and extension points. You do not need them to
| Set up a development environment | [Development](./development.md) and [CONTRIBUTING.md](../CONTRIBUTING.md) |
| Add a channel package | [Channel Package Guide](./channel-package-guide.md) |
| Build the WebUI source | [WebUI Development](../webui/README.md) |
+| Change update APIs, execution or recovery | [Update protocol](./update-protocol.md) |
+| Prepare and publish a release | [Release checklist](./releasing.md) |
If a command or screen no longer matches these docs, please [open an issue](https://github.com/HKUDS/nanobot/issues) with your nanobot version, operating system, and the page that needs correction.
diff --git a/docs/cli-reference.md b/docs/cli-reference.md
index 17528dca4..e628a5fb4 100644
--- a/docs/cli-reference.md
+++ b/docs/cli-reference.md
@@ -7,6 +7,7 @@ Use this page when you know what you want to run and need the command shape. For
| Goal | Command | Notes |
|---|---|---|
| Check the install | `nanobot --version` | If this fails, try `python -m nanobot --version` |
+| Update an ordinary Python venv | `nanobot update` | Latest stable PyPI release; use the [installation-specific route](./updating.md#installation-owners) for other methods |
| Create or refresh config | `nanobot onboard` | Creates `~/.nanobot/config.json` and `~/.nanobot/workspace/` |
| Refresh config non-interactively | `nanobot onboard --refresh` | Preserves existing values and adds missing default fields without prompting |
| Use guided setup | `nanobot onboard --wizard` | Best when you prefer prompts over hand-editing JSON |
@@ -52,6 +53,27 @@ Desktop-only distributions use the narrow `nanobot-desktop-tui` entrypoint insid
## Common Patterns
+### Updating
+
+```bash
+nanobot update --check # Check the latest stable PyPI release; do not install
+nanobot update # Install it in an ordinary Python venv
+nanobot update --dev # Update source and prepare its matching interfaces
+nanobot update --plan # Save an exact review; do not install or restart
+```
+
+The first two commands target stable PyPI releases, not the saved Preview subscription. `--dev` (`--update-dev`) selects source, not Preview. `--plan --channel stable` or `--plan --channel preview` inspects that channel without changing the subscription; `--channel` requires `--plan`. Saved plans are not executed by `nanobot update`.
+
+Before an in-place update, back up configuration, workspace files and chat history, then stop all processes sharing that Python environment. New versions may migrate stored data. Use the original [installation-specific route](./updating.md#installation-owners) for uv, pipx, containers, system packages and Desktop; do not overwrite a manager-owned environment with pip. Already-satisfying dependencies remain installed.
+
+Source updates require Git. Existing editable checkouts fast-forward their current branch to its upstream; resolve local changes, detached HEADs and divergence manually. Updating a package with `--dev` creates an editable checkout under `~/.nanobot/src/` on the official `main` branch. nanobot downloads its pinned Bun when needed; Node is not required. To return to a release, install it in a separate environment and launch outside the checkout; in-place source-to-release switching is refused.
+
+After installation, restart nanobot and verify the **running** gateway's version and behavior. The CLI checks the installation, not the live process. Downgrading requires `--allow-downgrade` and compatible data; back up before using it.
+
+In-place CLI updates have no automatic rollback. A failed or interrupted installation leaves an incomplete-update marker under `~/.nanobot/run/`. Stop nanobot and retry the same update from that environment. On Windows, stop processes holding installation files and retry with that environment's `python -m nanobot update` (add `--dev` for source).
+
+The WebUI's **Settings → About** uses a separate reviewed update-and-restart flow for supported installations and shows owner-specific instructions for others. See [Updating nanobot](./updating.md) for Preview selection, recovery and permission limits. Source updates remain CLI-only. To inspect a saved WebUI job, use `nanobot update --job `; [explicit handoff retry](./updating.md#explicit-recovery-before-package-mutation) requires additional consent and an intact installation, not a post-install repair.
+
Most day-to-day commands use the default config and workspace. Advanced or multi-instance runs usually pass both paths explicitly:
```bash
@@ -141,17 +163,19 @@ Interactive mode exits with `exit`, `quit`, `/exit`, `/quit`, `:q`, or `Ctrl+D`.
| Command | Description |
|---|---|
-| `nanobot webui` | Create config/workspace if needed, enable the local WebUI channel after confirmation, start the gateway, open `http://127.0.0.1:8765`, and follow new gateway logs |
+| `nanobot webui` | Prepare local WebUI settings and open the browser; installer-managed environments launch persistently, other installations remain attached and follow gateway logs |
+| `nanobot webui --detach` | Explicitly start or join a persistent gateway, open the browser and return control to the terminal |
| `nanobot webui --background` | Deprecated; prints the equivalent explicit `nanobot gateway --background` command and exits |
| `nanobot webui --dev` | Start the gateway and Vite together at `http://127.0.0.1:5173`, with live frontend updates |
| `nanobot webui --no-open` | Prepare and start the WebUI without opening a browser |
+| `nanobot webui --no-dock` | Suppress the macOS Dock icon; detached mode remembers this choice until the next WebUI launch |
| `nanobot webui --port ` | Set the WebUI/WebSocket port |
| `nanobot webui --gateway-port ` | Override the gateway health port |
| `nanobot webui --yes` | Apply safe localhost WebUI defaults without confirmation; configure provider credentials in **Settings → Models** |
First-run WebUI setup binds to `127.0.0.1` by default. Use manual configuration and a WebUI password before exposing the WebSocket channel beyond localhost.
-`--dev` is a foreground source-checkout workflow. For shell-based lifecycle management, use `nanobot gateway --background` (or `/detach` from an interactive TUI); `nanobot webui --background` prints migration guidance instead of silently changing process ownership. It installs frontend dependencies when `webui/node_modules` is missing, proxies to the configured WebSocket channel port, and stops Vite when the launcher exits. The shared on-demand gateway stops only when no other interactive client still holds it.
+`--dev` is a foreground source-checkout workflow and cannot be combined with `--detach`. It installs frontend dependencies when `webui/node_modules` is missing, proxies to the configured WebSocket channel port, and stops Vite when the launcher exits. The shared on-demand gateway stops only when no other interactive client still holds it. Installer-managed normal WebUI launches and explicit `--detach` use the gateway's persistent lifecycle; manage that same instance with the `gateway` commands below. The old `webui --background` spelling remains deprecated and prints migration guidance.
## Gateway
diff --git a/docs/quick-start.md b/docs/quick-start.md
index 1438c5032..96630cb7c 100644
--- a/docs/quick-start.md
+++ b/docs/quick-start.md
@@ -12,7 +12,7 @@ These repository docs describe `main`, which can be newer than the released pack
- Access to one supported AI provider, company endpoint, or local model server.
- The credential, endpoint URL, and model ID required by that service. Local providers such as Ollama may not require a key.
-Git and [Bun](https://bun.sh/) are only needed if you want to install from editable source code. The published installer supports macOS 13+ (Apple Silicon and Intel), Linux with glibc 2.17+ (ARM64 and x64), and Windows x64. On other platforms, use the WebUI or `nanobot --classic`. See the [terminal requirements](./cli-reference.md#agent-cli) for native TUI availability and the [release notes](https://nanobot.wiki/docs/latest/getting-started/quick-start) for package details.
+Official platform packages include the WebUI and matching native TUI for macOS 13+ (Apple Silicon and Intel), glibc 2.17+ Linux (ARM64 and x64), and Windows x64; no frontend build tools are needed. Other platforms can use the WebUI or `nanobot --classic`; see [terminal requirements](./cli-reference.md#agent-cli). Source installs need Git and use Bun, which nanobot downloads when needed.
## 1. Install nanobot
@@ -30,13 +30,13 @@ curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.
irm https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.ps1 | iex
```
-The installer chooses an active virtual environment, `uv`, `pipx`, or a managed environment under `~/.nanobot/venv`. It installs the stable PyPI release. At the end it prints the exact command it used to run nanobot; if `nanobot` is not on `PATH`, reuse that full command in the examples below.
+A fresh install uses a dedicated environment under `~/.nanobot/venv`, even if uv or pipx is on PATH. Existing installations keep their original manager; an active ordinary virtual environment remains an explicit target and is not adopted. The installer installs the stable PyPI release and prints the exact command it used to run nanobot. If `nanobot` is not on `PATH`, reuse that full command below.
If you prefer to inspect the scripts first, open [`install.sh`](../scripts/install.sh) or [`install.ps1`](../scripts/install.ps1).
## 2. Configure Your Model
-Keep the installer terminal open. The browser opens the local WebUI; go to **Settings → Models** and:
+Wait for installation and startup to finish. The browser opens the local WebUI; go to **Settings → Models** and:
1. Choose **New preset** and give it a name. If **Convert to presets** appears, choose it first.
2. Open **Provider** and select your provider. To add one, choose **Add provider** from the same menu, then enter and save its connection details or complete sign-in.
@@ -79,7 +79,7 @@ Most other providers can say `not set`. This command validates local setup but d
## 4. Get the First Reply
-If the installer-started WebUI is no longer running, run `nanobot webui` again. Leave that launcher open; the first-run WebUI is bound to localhost, so other devices on your network cannot reach it.
+If the installer-started WebUI is no longer running, run `nanobot webui` again. The first-run WebUI is bound to localhost, so other devices on your network cannot reach it.
Send:
@@ -89,7 +89,9 @@ Hello!
Any normal assistant answer is success. It proves that nanobot can load the config, reach the selected model, use the workspace, and serve the browser UI.
-Interactive WebUI and TUI launchers share one on-demand gateway. Closing one launcher leaves it running for the others; closing the last launcher stops it. If you prefer a persistent background process, press `Ctrl+C`, then run:
+Fresh official-installer environments start a persistent gateway: closing the browser or terminal does not stop it. Other installations keep their on-demand lifetime unless you explicitly use `nanobot webui --detach` or the gateway command below. An attached on-demand launcher must stay open; closing its last local client stops that gateway.
+
+To start or inspect a persistent gateway:
```bash
nanobot gateway --background
@@ -163,7 +165,7 @@ If pip reports `externally-managed-environment`, use the recommended installer,
**Current source**
-Clone the repository and install it in editable mode. Bun is required so the checkout can run its matching native TUI instead of mixing current Python with an older release binary.
+Clone the repository and install it in editable mode. nanobot downloads the pinned Bun runtime to run the checkout's matching TUI; Node is not required.
```bash
git clone https://github.com/HKUDS/nanobot.git
@@ -180,15 +182,19 @@ nanobot webui
The source path follows current `main` and can be newer than the published package. The editable install keeps Python pointed at the checkout; `nanobot` runs `tui/` with Bun, and `nanobot webui` automatically rebuilds `webui/` when its bundled assets are stale. All normal commands remain the same as a stable install. For development details, follow [`../CONTRIBUTING.md`](../CONTRIBUTING.md).
-If the package is installed but the shell cannot find `nanobot`, use the runner that owns the installation. The recommended installer prints the exact command to reuse. Common forms are:
+If the shell cannot find `nanobot`, reuse the installer's printed command or run Python from the existing installation. For uv or pipx, locate that environment with the original manager; do not start a temporary tool environment to manage it. The official installer's default paths are:
```bash
-uv tool run --from nanobot-ai nanobot --version
-pipx run --spec nanobot-ai nanobot --version
-~/.nanobot/venv/bin/python -m nanobot --version
+~/.nanobot/venv/bin/python -I -m nanobot --version
```
-On Windows, the managed-environment form is `& "$HOME\.nanobot\venv\Scripts\python.exe" -m nanobot --version`. Replace `--version` with `webui`, `onboard --wizard`, or any other arguments you need. Use plain `python -m nanobot` only when that Python executable belongs to the environment where nanobot was installed.
+Windows PowerShell:
+
+```powershell
+& "$HOME\.nanobot\venv\Scripts\python.exe" -I -m nanobot --version
+```
+
+Replace `--version` with `webui`, `onboard --wizard`, or the arguments you need. Use plain `python -m nanobot` only when that Python belongs to the installed environment.
## Manual Configuration Fallback
@@ -227,26 +233,16 @@ Replace the provider, endpoint, and model together. Do not pair a credential fro
## Updating
-Upgrade with the same method you used to install:
+Open **Settings → About → Update**. Supported installations can update and restart there; others show instructions for their original package manager or deployment. Follow [Updating nanobot](./updating.md) for Preview selection, backups and recovery. Do not switch installation methods to work around an error.
+
+For an ordinary Python virtual environment, the [CLI updater](./cli-reference.md#updating) is also available:
```bash
-# Recommended installer
-curl -fsSL https://raw.githubusercontent.com/HKUDS/nanobot/main/scripts/install.sh | sh
-
-# Or one of these
-uv tool upgrade nanobot-ai
-pipx upgrade nanobot-ai
-python -m pip install -U nanobot-ai
+nanobot update --check
+nanobot update
```
-For a source checkout:
-
-```bash
-git pull --ff-only
-python -m pip install -e .
-```
-
-Because the install is editable, normal source changes are visible immediately. Re-running the install synchronizes any changed Python dependencies; the TUI and WebUI refresh their own dependencies/assets when launched. Then check `nanobot --version`. Run `nanobot onboard --refresh` when you want to add newly introduced default fields while preserving existing settings.
+Stop affected processes and back up configuration and data first; restart and verify the running version afterward. Source checkouts should preserve local changes and follow the [development instructions](../CONTRIBUTING.md).
## If the First Reply Fails
diff --git a/docs/releasing.md b/docs/releasing.md
index 7be416529..875c00eda 100644
--- a/docs/releasing.md
+++ b/docs/releasing.md
@@ -1,29 +1,74 @@
# Release checklist
-Use this checklist with the [Release Packaging Contract](../CONTRIBUTING.md#release-packaging-contract). Preparing a release does not publish it. Pushing a Git tag, publishing a GitHub Release, uploading to PyPI, and deploying the documentation are separate operations.
+Use this checklist with the [Release Packaging Contract](../CONTRIBUTING.md#release-packaging-contract). Preparation does not authorize publication. Pushing tags, publishing GitHub Releases, uploading to PyPI and deploying documentation are separate operations.
+
+## Release cadence
+
+Stable is the default feed; Preview is opt-in. Both use one update flow and require confirmation before installation. Neither a faster cadence nor a subscription permits stopping tasks or restarting a gateway automatically. See [Updating nanobot](./updating.md) for user instructions.
+
+| Release | When to prepare it | Public destination | User experience |
+| --- | --- | --- | --- |
+| Stable feature release | At the planned feature milestone | Final GitHub Release and PyPI; also index its manifest for Preview subscribers | Normal update notice |
+| Stable patch | When a reviewed fix or small, compatible improvement is ready; do not wait for the next monthly milestone | Same stable destinations and checks | Normal update notice, no Preview opt-in required |
+| Preview | On maintainer request, from reviewed changes with passing checks; potentially daily | GitHub prerelease and protected `release-index` catalogue; not PyPI | Same update notice for subscribers, with risk shown before installation |
+
+Packaging is maintainer-triggered, not scheduled or push-triggered. Record the requested channel, exact source and candidate identity; preparation does not authorize publication. Unchanged source, failed checks, missing assets, incomplete acceptance or absent approval leaves the last verified release in place. There is no daily-release promise. Acceptance must cover the supported stable baseline and an earlier Preview, including skipped previews, not just the previous build.
+
+### Stable patch procedure
+
+1. Select the supported stable baseline and reviewed fixes. If `main` contains unfinished features, branch from that baseline and backport only the required fixes. Do not relabel an unverified Preview as stable.
+2. Allocate an unused final version, update both version declarations, and follow **Prepare a candidate**. Patches require the same packaging, licensing, native startup, data-preservation and update/recovery gates as feature releases.
+3. Publish approved immutable files in order: GitHub, PyPI, public-download checks, then the catalogue's `stable` pointer. Preserve `preview` and withdrawal history. A stable patch older than an installed Preview must not be offered as a downgrade.
+4. Publish concise fix notes and required operator actions. Users without this updater need their original installation method for the first upgrade; external package/deployment owners retain their route.
+
+### Maintainer-triggered Preview procedure
+
+1. Select an exact reviewed `main` commit with passing required CI; skip it if its source SHA matches the last accepted candidate. Record the next unreleased stable base and an unused increasing Preview sequence.
+2. Run **Verify Release Candidate** for that ref and base. It prepares a version-only candidate, builds the WebUI and five native TUI bundles, and verifies the package set without publication. Users receive built packages, not a checkout requiring Bun.
+3. Select `retain_installable` and preserve the handoff before expiry. Complete native and packaged old-to-new update/recovery acceptance against those exact bytes. Keep candidate SHA, manifest hash, coverage, known issues and source-offer approval together; CI reports alone are neither installable artifacts nor publication consent.
+4. With separate approval, publish immutable `v` at the **candidate** commit and a GitHub prerelease, never the latest stable release. Upload the complete verified set, manifest and notes; make the pinned installer source publicly reachable.
+5. Verify all public sizes/hashes and clean public install/update acceptance before advancing `preview` with a new catalogue generation. Validate against the latest catalogue, preserve `stable` and withdrawals, and serialize stable, Preview and withdrawal writes. A stale publisher must reread and revalidate.
+6. After partial upload, leave the feed unchanged and resume only from the original verified files. Lost or changed bytes require a new version and repeated acceptance. Withdraw unsafe candidates with a reason and offer a newer fix; never rewind the feed or restore user data.
+
+Use Python version ordering: `0.3.6.dev42 < 0.3.6.dev43 < 0.3.6 < 0.3.7.dev1` (illustrative versions). Once a final base ships, previews need a later base; allocate it after accounting for stable patches. The workflow uses `github.run_number` for `N` in `X.Y.Z.devN`; do not reset the sequence without checking published versions. Reruns cannot replace published bytes. Rebuild and test final releases under their final identity; never rename `.devN` wheels.
+
+### Launch gates and automation boundary
+
+Before offering public Preview, obtain approval for index ownership/protection, publication credentials, source retention and exact packaged/public-download acceptance. Candidate preparation does not activate a public channel, schedule, protected publisher or PyPI upload. Preserve approved release bytes and source outside expiring CI storage for their required lifetime.
+
+Automate steps within an explicitly requested run, not the decision to build or publish. Keep builds read-only, publication permissions in a protected stage, the last accepted source/version recorded and one serialized catalogue writer. Announce Preview availability only after verifying its public feed. Any discovery hint must be dismissible; do not show an update badge for an unavailable channel or enroll users merely because they check.
## Prepare a candidate
-1. Choose the previous release and the exact candidate commit. Work in a clean worktree; do not include local configuration, session data, credentials, or unrelated changes.
-2. Update `project.version` in `pyproject.toml` and the final source-only fallback in `nanobot/__init__.py`. Private WebUI/TUI package versions are not the Python release version.
-3. Review the changes since the previous tag. Write highlights, upgrade and rollback guidance, contributor acknowledgements, and the full changelog. Verify counts against the final range; commit counts are not merged-PR counts. Coordinate security disclosures separately.
-4. Run the Python, WebUI, and TUI checks from CI. Confirm the final commit's CI status, not just an earlier PR head. Review installation, configuration, session, and API changes.
-5. Build in a clean output directory with `uv build --out-dir `. Do not set `NANOBOT_SKIP_WEBUI_BUILD`. The build hook bundles the WebUI in the sdist and wheel; the wheel is built from the sdist.
-6. Check the intermediate distributions with `twine check`, inspect their contents, and record SHA-256 hashes. Test installation in an isolated environment outside the source checkout, then test upgrading from the previous stable version using disposable configuration and sessions. Do not use a maintainer's live workspace for migration tests.
-7. Prepare the matching documentation PR in `Re-bin/nanobot-web`, following its `MAINTAINING.md`. Review English and all nine translations, preserve Nightly and previous releases, update the latest-version redirects, and run the complete site quality gate. Pin source links to the checked candidate commit; confirm those source files match the eventual tag before deploying. Never advertise an unpublished version as publicly available.
-8. Review the pinned Bun/OpenTUI licenses, corresponding-source materials, and relinking instructions now, not after pushing the tag. Verify the exact upstream revisions are retrievable and the runtime versions match the lockfile and notices. Obtain the maintainer's commitment to honor `tui/SOURCE_OFFER.md` for its entire stated period; tests cannot grant it.
-9. Build all five native TUI targets using the same scripts as the publication workflow. Include ad-hoc signatures for macOS before packaging. Verify every archive's checksum, manifest, executable architecture, required notices/licenses, and embedded source contents. Run platform-specific smoke tests where supported; record cross-compiled-only targets as such and link exact-head CI evidence instead of claiming native execution everywhere. Bundle these archives into the five platform wheels using the command below. Check all final wheels with `twine check`, validate their RECORDs, tags and installed executable permissions, and test first launch with an empty cache and `NANOBOT_TUI_NO_DOWNLOAD=1`. The installed executable must come from `site-packages/nanobot/tui/bin/`, not the checkout or a cache.
-10. Merge the release-preparation PR only after its current checks and reviews pass. Confirm the merged source tree matches the tested candidate; if it does not, rebuild and recheck before tagging. Reconcile the final changelog and documentation source references. The tag must point to this verified commit, not an unchecked later `main` tip.
+1. Choose the previous release and exact candidate commit. Use a clean worktree without local configuration, sessions, credentials or unrelated changes.
+2. Update `project.version` in `pyproject.toml` and the final source-only fallback in `nanobot/__init__.py`. Private WebUI/TUI versions are not the Python release version.
+3. Review the final tag range; prepare highlights, upgrade/rollback guidance, acknowledgements and full changelog. Verify counts: commits are not merged PRs. Coordinate security disclosures separately.
+4. Run Python, WebUI and TUI CI checks against the final commit, not an earlier PR head. Review installation, configuration, session and API changes.
+5. Run `uv build --out-dir ` in a clean output directory without `NANOBOT_SKIP_WEBUI_BUILD`. The build hook bundles WebUI in sdist and wheel; the wheel is built from the sdist.
+6. Run `twine check` on intermediates, inspect contents and record SHA-256 hashes. Test installation in an isolated environment outside the checkout and upgrade from previous stable with disposable configuration/sessions, never a maintainer's live workspace.
+7. Prepare the documentation PR in `Re-bin/nanobot-web` under its `MAINTAINING.md`: review English and all nine translations, preserve Nightly and previous releases, update latest-version redirects and run the full site quality gate. Pin source links to the candidate and confirm they match the eventual tag. Do not advertise an unpublished version.
+8. Review pinned Bun/OpenTUI licenses, corresponding source and relinking instructions. Check upstream revision availability and runtime/lockfile/notice agreement. Obtain the maintainer's commitment to the [source offer](../tui/SOURCE_OFFER.md) for its full stated period, at least three years after release; tests cannot grant it.
+9. Build all five native targets with publication scripts, ad-hoc signing macOS before packaging.
+ - Verify archive checksums, manifests, architecture, licenses/notices and embedded source. Run supported native smoke tests, record coverage and exact-head CI evidence, and label cross-compiled-only targets.
+ - Build platform wheels below, check them with `twine check`, validate RECORDs/tags/permissions and test pip selection on all five platforms.
+ - Test first launch with an empty cache and `NANOBOT_TUI_NO_DOWNLOAD=1`; the executable must come from `site-packages/nanobot/tui/bin/`, not checkout or cache.
+10. Merge release preparation only after current checks/reviews pass. Compare the merged source tree with the tested candidate; rebuild/recheck changes. Reconcile changelog and documentation links, then tag the verified commit, not an unchecked later `main` tip.
+
+### Protected updater handoff compatibility
+
+Restart-capable packages include `nanobot/update_contract.json`: schema version 1, with `handoff_protocols` listing positive integer protocol IDs. Protocol 1's request, protected startup and activation requirements are defined in the [update protocol](./update-protocol.md), independently of package and WebUI versions.
+
+Before advertising protocol 1, run preparation, frozen-worker and actual-gateway restart tests against packaged code; verify the declaration is in both sdist and wheel. Retain an ID only while its entire contract is supported; incompatible request, startup or activation behavior needs a new ID. Older updaters may install a future package only if protocols overlap. Missing, malformed or non-overlapping declarations must be refused before shutdown and require the installation owner's external update route.
### OpenAI API selector compatibility window
-The temporary `providers.openai.apiType` / `api_type` conversion is supported for exactly two consecutive releases: the first release containing `nanobot/config/provider_api_migration.py` and the next release. Record the first release tag and the final supported tag in release notes. Config saves write the new `api` declaration; there is no legacy runtime selector.
+The temporary `providers.openai.apiType` / `api_type` conversion lasts exactly two consecutive releases: the first containing `nanobot/config/provider_api_migration.py` and the next. Record the first and final supported tags in release notes. Config saves write `api`; there is no legacy runtime selector.
-Before publishing the third release, remove `provider_api_migration.py`, its import and `ProvidersConfig._migrate_legacy_api_type`, and the legacy settings query conversion in `nanobot/webui/settings_models.py`. Remove the migration-specific tests and update the configuration documentation and release notes to require the current format. Keep the current-format routing, settings, and persistence regressions.
+Before the third release, remove `provider_api_migration.py`, its import, `ProvidersConfig._migrate_legacy_api_type`, the legacy settings query conversion in `nanobot/webui/settings_models.py` and migration-specific tests. Update configuration docs and release notes to require the current format. Keep current-format routing, settings and persistence regressions.
### TUI preflight without a release tag
-Use Bun 1.3.13 and a clean checkout. The local build and packaging scripts do not require a tag or GitHub Release. Run targets sequentially because native dependency preparation modifies the shared `node_modules` directory:
+Use Bun 1.3.13 and a clean checkout; no tag or GitHub Release is required. Run targets sequentially because native dependency preparation modifies shared `node_modules`:
```bash
cd tui
@@ -35,11 +80,11 @@ bun scripts/release-notices.ts
python3 scripts/package-release.py
```
-Repeat for `darwin-arm64`, `darwin-x64`, `linux-arm64`, `linux-x64`, and `win32-x64`. On macOS, use `codesign --force --sign - ` and verify the signature. The publication workflow uses pinned `rcodesign` on Linux. Keep the ten `.zip`/`.zip.sha256` outputs in a candidate-specific directory, alongside the Python build intermediates and provenance manifest. Do not include local configuration, instance backups, or test environments in upload selections.
+Repeat for `darwin-arm64`, `darwin-x64`, `linux-arm64`, `linux-x64` and `win32-x64`. On macOS, run `codesign --force --sign - ` and verify it; the publication workflow uses pinned `rcodesign` on Linux. Keep the ten `.zip`/`.zip.sha256` files with Python intermediates and provenance manifest in a candidate-specific directory, excluding configuration, backups and test environments from upload selections.
### Build the PyPI platform wheels
-From the exact release checkout, after `uv build` and the native archive checks:
+After `uv build` and native archive checks, from the exact release checkout:
```bash
uv run python -m scripts.build_tui_wheels \
@@ -48,23 +93,170 @@ uv run python -m scripts.build_tui_wheels \
--out-dir
```
-The script verifies the Python version and RECORD, native checksums, architecture, notices and embedded source against the checkout, then writes five wheels with complete TUI bundles and regenerated RECORDs. It refuses to overwrite an existing candidate. `--target ` builds one platform for a targeted check. Minimum tags are macOS 13, manylinux glibc 2.17 and Windows x64; x64 builds use Bun's baseline (SSE4.2) runtime instead of requiring AVX2. Recheck both Bun and OpenTUI when upgrading either dependency. No musl or Windows ARM64 wheel is provided. Native execution checks must still validate the actual binaries; tags alone do not prove compatibility. Test pip selection for all five supported platforms.
+The script checks Python version/RECORD and native checksums, architecture, notices and source against the checkout, then writes five bundled wheels with regenerated RECORDs. It refuses existing candidates; `--target ` selects one platform. Minimum tags are macOS 13, manylinux glibc 2.17 and Windows x64; x64 uses Bun's baseline SSE4.2 runtime, not AVX2. Recheck Bun/OpenTUI requirements when upgrading either. There are no musl or Windows ARM64 wheels; tags do not substitute for native execution.
-The final PyPI upload set is **five platform wheels plus one source distribution**. Do not upload the intermediate `py3-none-any.whl` or native ZIPs to PyPI. Keep the source distribution produced by the same build; it remains usable for Python/classic and WebUI installations on other platforms.
+PyPI receives **five platform wheels and one sdist**, not the intermediate universal wheel or native ZIPs. Keep the same build's platform-neutral sdist for Python/classic and WebUI on other platforms. Record source commit, version, files, hashes, checks and remaining gates; source changes require rebuilding and rechecking.
-Keep an artifact manifest with the source commit, version, filenames, hashes, checks performed, and any remaining release gates. Rebuild and recheck if the packaged source changes.
+Final releases also require `release-manifest.json` for `stable`. Run `scripts.release_candidate assemble` as shown below from the clean final-version checkout, using that final commit as `--source-commit` without Preview preparation. GitHub receives the same wheels/sdist, ten archive/checksum files and manifest; PyPI receives only wheels/sdist. Verify final source and public bytes before catalogue advancement. A TUI-only GitHub Release cannot deliver the final release to Preview subscribers.
## Publish, with maintainer approval
-1. Confirm all pre-tag gates above are complete. Create and push exactly `vX.Y.Z`; do not move or reuse a published version tag.
-2. Create the matching GitHub Release. A draft may be used while assembling its attachments. Pushing the tag alone does not run `Publish Terminal UI` or upload anything to PyPI.
-3. Attach the already verified five TUI archives and their `.sha256` files, after confirming the tag's packaged sources match the artifact manifest. Verify the uploaded bytes match their preflight hashes; never upload a naked executable.
-4. If instead rebuilding through **Publish Terminal UI**, use `tag=vX.Y.Z` and confirm the already completed compliance review. Wait for all five targets and repeat artifact checks on those new outputs. Do not substitute their new bytes under the old artifact hashes.
-5. Make the GitHub Release and all TUI attachments publicly available. Verify their public downloads for fallback/source-built installations. Supported platform-wheel installs do not need these downloads to start the TUI.
-6. Upload only the checked `nanobot_ai-X.Y.Z.tar.gz` and the five final platform wheels to PyPI. Do not upload the intermediate universal wheel or stale files from a shared `dist/` directory. This repository has no automatic PyPI publication workflow.
-7. Verify installation from PyPI, bundled WebUI startup, and bundled TUI startup without downloads in clean environments. Merge the prepared wiki PR only when the stable package is available: merging its `main` deploys the site automatically. Confirm all localized `/docs/latest/` routes select the new version and old version links still work.
-8. Publish the release announcement and add the dated entry to [Release Archive](./release-archive.md). Complete any coordinated advisory publication and reporter notification. Record links and completion status in the release tracking issue.
+### Release approval proof
+
+Both Stable and Preview automatic installs require `release-manifest.json.sigstore.json` beside the manifest on the exact GitHub release. Clients verify Sigstore's production certificate chain/transparency proof and accept only `HKUDS/nanobot`'s manual `release-approve.yml` on `main`. The signed manifest must match version, wheel size/digest and, for Preview, catalogue commit/manifest binding. Verification runs before download and before shutdown, with no unsigned fallback. Unsigned historical releases remain discoverable but cannot be automatically installed; existing installations keep running.
+
+Before setting the repository variable `NANOBOT_RELEASE_SIGNING_ENABLED=true`, an administrator must protect `main` and the `release-approval` environment: require independent review, prevent self-review, allow deployment only from `main`, and restrict bypass and changes to the workflow/signing requirements. Signing is disabled without that variable. No long-lived signing key or Apple Developer ID is required.
+
+After candidate tests and dependency review, take version, manifest SHA-256, source SHA and candidate SHA from retained acceptance evidence, not public downloads. Upload the proposed manifest through the separately authorized release handoff, then manually run **Approve Exact Release** from `main` with those values and obtain environment review. The hash-locked job checks/signs the exact manifest without installing candidate code or writing releases, PyPI or the catalogue. Separately authorize attaching its proof, verify the public proof before advancing either channel, and preserve it with candidate evidence before its three-day CI expiry.
+
+Regenerate the signing lock only in a reviewed dependency update:
+
+```bash
+uv pip compile .github/release-signing-requirements.in --python-version 3.11 \
+ --python-platform x86_64-manylinux_2_17 --generate-hashes --no-header \
+ --output-file .github/release-signing-requirements.txt
+```
+
+Review resolved dependencies; hashes are not malware review. Before the first release, prove a supported real old updater can install the signed candidate and that the candidate can install the next signed version. Private packaged recovery fixtures substitute publication authority and are not signature evidence.
+
+The proof authenticates release approval, not reproducible builds or harmless code. Compromised authorized workflows/reviewers, malicious source that passes review and compromised runtime dependencies remain risks. The signing lock does not lock runtime resolution, which retains the installation owner's policy. A reviewed runtime dependency inventory, public signed upgrade continuity and verified repository protection settings remain security-release gates; do not claim comprehensive supply-chain protection without them. The first installer and checksum source also need a trusted distribution channel.
+
+1. Complete pre-tag gates, then create and push exactly `vX.Y.Z`; never move or reuse a published tag.
+2. Create the matching GitHub Release. A tag push alone runs neither **Publish Terminal UI** nor PyPI publication.
+3. Attach five platform wheels, sdist, five TUI archives, their `.sha256` files and `release-manifest.json`. Confirm tag sources match the manifest and uploaded hashes match preflight. Complete approval proof before offering automatic updates; never upload a naked executable.
+4. If rebuilding via **Publish Terminal UI**, use `tag=vX.Y.Z` with compliance review confirmed. Wait for all five targets, recheck outputs, and assemble/recheck wheels and manifest from those exact archives. Never mix rebuilt archives with old wheel bytes/hashes; replacing public assets requires a new version.
+5. Make the release and complete artifact set public. Verify every file against the accepted manifest, including native fallback/source-install archives. Platform-wheel TUI startup must not need downloads.
+6. Upload only the checked `nanobot_ai-X.Y.Z.tar.gz` and five final wheels to PyPI, not the universal intermediate or stale shared `dist/` files. There is no automatic PyPI publication workflow.
+7. Verify clean PyPI installation, bundled WebUI and download-free TUI startup. After all public GitHub/PyPI files pass, advance `stable`, preserving Preview and withdrawals; check discovery for both subscriptions. Only then merge the wiki PR: its `main` deploys automatically. Confirm all localized `/docs/latest/` routes select the new version and old-version links still work.
+8. Announce the release, add its dated [Release Archive](./release-archive.md) entry, complete coordinated advisories/reporter notifications, and record links/status in the release tracking issue.
## If a gate fails
-Do not publish to PyPI while a required TUI artifact or verification is missing. Keep the documentation's public `latest` on the previous stable version until the new version is usable. If a published package needs a correction, prepare a new version; do not silently replace the code behind an existing release tag. Stop all old processes and follow the documented session rollback procedure before downgrading a migrated installation.
+Do not publish to PyPI with missing TUI artifacts or verification. Keep public documentation's `latest` on the usable stable version. Correct published packages with a new version, never replacement code behind an existing tag. Before downgrading a migrated installation, stop all old processes and follow the documented session rollback procedure.
+
+## Installer identity checks
+
+Fresh base-package installs use the official installer's dedicated venv regardless of optional managers on PATH. `nanobot-install.json` is written before venv/download work so failed first installs retain their owner; it is not readiness proof. Existing venv/uv/pipx installations are not adopted or moved. The receipt records extras for update planning and opts `webui` into persistent background launch; unrecorded installs retain their lifecycle. Include this distinction and the instance-specific stop command in release notes.
+
+Linux/Windows native CI builds a platform wheel and runs the public installer in a private home without Bun/Node/Git on PATH, then checks the managed receipt, installed WebUI, native TUI and gateway. Python/WebUI changes also require these jobs. CI retains small reports, not candidate binaries. Startup probes and offline installer fixtures do not replace packaged upgrade/recovery or public-download acceptance.
+
+Run `pytest tests/test_install_scripts.py` with `uv` and `pipx` available. It uses private homes, offline fixture wheels and real managers, without a gateway or real application install: `install.sh` on Unix and Windows PowerShell with `install.ps1` on Windows. CI provisions pipx outside application dependencies. Verify these owner-preservation requirements:
+
+- Launch the selected persistent environment's isolated Python, not `pipx run`, disposable tools or an arbitrary PATH executable. Existing recognized installations take priority over newly available managers; multiple recognized installs require explicit choice. An ordinary active venv is explicit; uv/pipx environments must use their manager.
+- Preserve uv constraints. Generic pipx upgrades can drop constraints/options; the installer must refuse pipx records with those settings, lock workflows or unconfirmed sources. The owner must review and preserve them. Exact wheels may replace a wheel source, not registry constraints/options; pipx upgrades must retain requested extras and refuse wheels missing recorded extras.
+- A failed selected manager must not fall through to another installation, even on first install. Verify the exact persistent package version before onboarding: a successful pinned/locked skip is not target installation. Restarted gateway identity is a separate check.
+
+Verify the exact-handoff options against the pinned installer, not an older script: `install.sh --wheel --sha256 ` / `install.ps1 -Wheel -Sha256 `, or `install.sh --release --manifest-sha256 ` / `install.ps1 -Release -ManifestSha256 `. Wheel mode verifies checksum/package/version; release mode selects one of five native tags for the target Python and verifies size/hash/identity before invoking the original owner. No frontend toolchain or extra selector package is installed; the manager still checks Python/dependencies. Hashes must come from trusted metadata, not an unknown publisher.
+
+Release downloads use official GitHub HTTPS hosts and configured HTTPS proxy; retain wheel sources at their recorded paths, including `~/.nanobot/downloads/releases` or `NANOBOT_RELEASE_CACHE`. Failed partial downloads are removed. Wheel-mode `--dry-run` / `-DryRun` verifies without installation/setup; release-mode dry-run checks only the manifest, creating no wheel/cache/environment/setup and proving neither wheel bytes nor dependency resolution.
+
+These exact-version handoffs do not discover Preview, change subscriptions, stop gateways or back up data. Require stopped writers and backup first. Review extras and recorded options for plain pip, suffixed/custom installs and external owners; see the [user guide](./updating.md) and [update protocol](./update-protocol.md). Installer fixtures alone do not establish live maintenance, backup or restart safety.
+
+### Packaged upgrade and recovery acceptance
+
+Linux/Windows native CI runs `scripts/verify_packaged_update.py` against its wheel; manual candidate preparation uses the assembled Linux wheel. Run macOS acceptance against the candidate's macOS wheel:
+
+```bash
+ -I scripts/verify_packaged_update.py \
+ --wheel --commit \
+ --output
+```
+
+Build tools need project Python dependencies. The probe creates disposable venv/account/configuration/workspace and loopback gateways, without maintainer data, models or credentials. It records the unchanged healthy target's SHA-256 and candidate commit; faulted private wheels must never be uploaded.
+
+On a local macOS desktop, add `--dock` to verify the real AppKit helper alongside these journeys. The managed receipt must make `nanobot webui --yes --no-open` detach automatically; each applicable running version must have one helper, preserve desktop intent through upgrade/recovery and a second start, and remove its helper on stop. Historical packages without Dock support gain the icon only after their first healthy upgrade and an explicit WebUI launch. This is process/lifecycle acceptance, not a visual Dock-click test; do not enable it on headless CI or claim native Windows/Linux icon coverage.
+
+Require normal and consecutive upgrades, skipped Preview, import/startup failure, backup failure after shutdown, worker termination, partial metadata loss and interruption between program-restoration renames. Each successful journey must show the expected version in a new gateway run, a retained verified backup, authenticated history reads, continued writes and a second ordinary start. Each recovered service must then update to the healthy target with the same account/conversations. Faults affect the first job; backup failure must survive its automatic retry, while a separately confirmed next update can make a healthy backup. The instrumented intermediate Preview's second hop installs the unchanged final wheel.
+
+Compare configuration, retained legacy-source bytes, canonical SQLite records, WebUI transcripts and pending `delivery/outbox.sqlite3` records separately. Cover canonical-only, display-only and mixed history without inventing canonical records for display-only chats; SQLite checkpoint byte changes alone are not data loss. Retain the protocol-1 parked-gateway regression across old/new protected-store inventories: no outbox initialization, migration or writes outside the old grant before activation. See the [update protocol](./update-protocol.md) for scope and lease requirements.
+
+Default baselines are labelled target-derived fixtures, not historical compatibility evidence. For release acceptance, add `--baseline-wheel ` and repeat with supported stable and older Preview packages, including skipped Preview. Baseline feed transport is instrumented; the healthy target is unchanged. Include a retained pre-SQLite updater to check JSONL migration's canonical message bodies separately from display history. If recovery restores JSONL code, mark SQLite checks not applicable, not passed. Packages without this updater need separately recorded installation-owner bootstrap acceptance.
+
+Exercise consecutive updates in the same disposable account with existing conversations through each applicable owner: official installer, uv tool, pipx, ordinary pip venv and source. Check recorded constraints/options before/after, execute the offered command, verify the restarted gateway, append a message and start again. Policy refusal must leave installation unchanged; custom owner-reviewed updates do not prove automatic recovery. Container replacement requires a real engine and retained data volumes, not a mocked marker.
+
+For installer-owned background recovery, verify one exact-target repair, then original-program restoration only before activation and only with unchanged protected data, including restart/health verification without browser or terminal intervention. Data changes, activation, live owners or changed installation ownership must prevent unsafe rollback. Other owners retain their repair route. Never delete jobs/fences or automatically restore old configuration/chat data. Exercise native Windows locks/renames. Loss of both supervisor and worker, permanent storage damage and incompatible data writes are not automatically recoverable; retain these limits in release notes and the operator guide.
+
+Keep private evidence until review; it can contain program generations/backups and is not an upload set. CI retains small reports, including completed cases after a later failure; only all selected journeys passing produces aggregate success. Partial reports or a timeout are not an overall pass. Record actual native OS/CPU coverage separately from installer/startup fixtures: Linux x64, Windows x64 and macOS arm64 do not establish macOS x64 or Linux arm64 coverage. Controlled release transport and fault injection prove neither public downloads nor interactive UI; complete those gates before claiming them.
+
+## Stable and Preview subscriptions
+
+Use [Updating nanobot](./updating.md) for Settings → About and CLI instructions. Release acceptance must preserve opt-in consent: Preview is off even on development builds; switching saves/checks a feed, not installation approval. Require separate exact-version confirmation and a Preview risk warning. Profiles sharing an environment/account share its subscription; other installations/accounts do not. Environment replacement may require reselection; browser storage is not authoritative.
+
+| Current install / requested channel | Required acceptance result |
+| --- | --- |
+| Stable → Preview, a newer verified preview exists | Offer that exact preview; install only after confirmation. |
+| Preview → Preview | Offer only a higher verified version, including a final release. |
+| Preview → Stable, stable is newer | Offer the final release; keep Stable selected. |
+| Preview → Stable, stable is older | Save Stable and wait for a newer final release; keep running the preview. |
+| Preview subscriber installs a final release | Keep Preview selected for the next development cycle. |
+| Current preview was withdrawn | Warn even without a safe newer replacement; never silently downgrade. |
+| Feed offline, incomplete, missing or incompatible | Return non-success; retain subscription and allow rechecking. |
+
+Stable checking/planning requires complete PyPI wheels/sdist. Preview uses `release-index/catalogue.json` and exact GitHub manifests, never PyPI `--pre` or arbitrary branches. Validate targets against the gateway interpreter/platform, not the browser. Index final releases for Preview subscribers too; advance only after verifying all referenced public assets.
+
+Versions, tags and manifest hashes are immutable. Increment generation; never rewind or clear published pointers, remove withdrawals or reuse bad versions. To stop offering a version, retain its pointer and withdraw it. Serialize writers and validate `ReleaseCatalogue.validate_successor(previous)` against the latest catalogue. Clients reject rewrites relative to their last accepted catalogue; that check is not cryptographic signing.
+
+Acceptance must invalidate reviews on every channel change, including Stable → Preview → Stable; cancel inactive staged work through normal stop checks and retain diagnostics. Active preparation, committed shutdown, admitted installation or failed mutation blocks switching until settled/recovered. Reject stale-tab writes and reread after lost responses, never automatically retry installation. Detailed transaction rules belong in the [update protocol](./update-protocol.md).
+
+Discovery grants no installation authority. Only the official managed venv and supported POSIX uv transactions support the reviewed stop/install/restart flow; pipx, source, container, system-managed, unsupported uv/platform and desktop distributions retain their owner/distributor route. Remote browsers without package-install permission may read status but not change subscription. Older clients must get actionable failures for unrepresentable statuses, never false “up to date.” Verify these boundaries before announcing a public channel.
+
+## Non-publishing preview preflight
+
+**Verify Release Candidate** is manual, read-only preparation: no tags/releases, PyPI or catalogue writes. It builds/checks five platform wheels, sdist and licensed fallback archives. Cross-compilation is neither native execution nor release approval.
+
+Default retention is small identity/manifest/probe reports and installation guide for **three days**, without installable binaries. `retain_installable` preserves those exact checked artifacts plus a self-contained shallow Git repository for **one day** (about 400 MB). Keep this storage exception off for routine preflight or schedules; assess storage and call it out explicitly in workflow-change PRs before merge. Preserve approved handoffs before expiry; rebuilding expired files cannot reuse their verification. The source contains only candidate/source-parent history, not configuration or untracked files. `handoff.json` is written only after copied artifacts verify; interruption is not an accepted handoff.
+
+After assembly, the workflow installs the Linux x64 wheel and binary dependencies into a separate venv without Bun/Node/Git on the install PATH. Isolated Python checks version/commit/import identity, all Vite-manifest assets including lazy chunks through the installed handler, and bundled TUI `--desktop-protocol` with downloads disabled and empty private HOME. With `--gateway`, it starts a private foreground CLI gateway with no provider/MCP configuration, disabled heartbeat and two loopback ports, then checks readiness, protected version identity, HTML and process/listener cleanup. Unix shutdown must be graceful; Windows termination is labelled, not graceful-shutdown evidence. No model task or external channel is exercised.
+
+On another supported platform, check a disposable native installation without changing its package:
+
+```bash
+ -I scripts/verify_installed_release.py \
+ --version --commit \
+ --gateway --report
+```
+
+Use the candidate commit, not its parent. The probe rejects checkout imports/unisolated invocation and avoids user configuration/credentials. Omit `--gateway` for assets/TUI only. Reports identify OS/CPU/probes and are success-only, never overwritten; failure cleans up children and prints a bounded redacted log tail. This is package/startup evidence, not interactive UI, managed restart, migration, public-download or five-platform E2E acceptance.
+
+For local preparation, use a full source SHA and new output outside the checkout (illustrative base/sequence):
+
+```bash
+python -m scripts.release_candidate prepare \
+ --source-commit --base 0.3.6 --sequence 42 \
+ --output
+```
+
+Preparation leaves the checkout untouched and deterministically creates a version-only commit for identical inputs. Build Python distributions and all native targets from it, then run from the candidate:
+
+```bash
+python -m scripts.release_candidate assemble --source-commit \
+ --wheel /nanobot_ai-0.3.6.dev42-py3-none-any.whl \
+ --sdist /nanobot_ai-0.3.6.dev42.tar.gz \
+ --tui-dir tui/dist --output
+```
+
+Assembly refuses existing output and emits the manifest only after complete-set, version/commit, WebUI, RECORD, native/source and permissions checks. It compares sdist sources/resources against tracked candidate files with packaging exclusions, and all wheels' application/WebUI bytes against the sdist. Commit markers and RECORDs alone are insufficient; these comparisons do not prove reproducible frontend/native compilation. Recheck with `python -m scripts.release_candidate verify --source-commit --artifacts `; it may reuse an identical manifest, never replace different bytes.
+
+Generate the handoff from the same candidate:
+
+```bash
+python -m scripts.release_candidate instructions --source-commit \
+ --artifacts --output
+```
+
+The generator rechecks artifacts/manifest and writes a non-overwriting guide outside the immutable upload directory. When both installers match the supported implementation, commands fetch the exact candidate's installer with the retained manifest hash for automatic platform selection; older candidates keep manual commands, never mutable `main` or assumed flags. Publication must make pinned installer source reachable.
+
+The guide records version, source/candidate commits, five hash-bound wheel URLs and separate new/existing base-package commands for uv, pipx and pip venv. Commands verify local size/SHA-256 with the standard library before manager invocation; URL hash fragments alone are insufficient for the tested uv commands. Retain wheel paths recorded by managers. Manual commands move to an advanced section when automatic entry is supported; no new manifest schema or installer executable is introduced.
+
+Before offering the guide, publish/verify exact public files and add release changes, native coverage, migration/recovery instructions and stop/backup prerequisites. Review extras and locked/suffixed/external-owner options; independently verify installed version and restarted gateway. Manager fixtures do not prove restart/migration, and the guide is neither publication approval nor channel selection.
+
+The candidate clone borrows source Git objects; preserve its source repository until retained in an approved permanent ref. Partial assembly has no accepted manifest and must not be uploaded. Source-offer commitment, native launch, clean install, upgrade/recovery and publication gates still apply. Missing public assets must be recovered from original verified files, never overwritten by rebuilds.
+
+Retain an exact local handoff outside temporary build storage:
+
+```bash
+python -m scripts.release_candidate retain --source-commit \
+ --artifacts --output
+```
+
+Only `artifacts/` is the upload set; `source.git/`, `install.md` and `handoff.json` are maintenance evidence, not PyPI packages. Restore with `git clone --no-local /source.git `, check HEAD against `handoff.json`, and rerun `release_candidate verify` on retained artifacts before separately approved publication. Keep native reports and release notes alongside them; retention adds no native, migration, interactive UI or public-download evidence.
diff --git a/docs/start-without-technical-background.md b/docs/start-without-technical-background.md
index ba1215d01..5889adbc2 100644
--- a/docs/start-without-technical-background.md
+++ b/docs/start-without-technical-background.md
@@ -102,13 +102,13 @@ If the installer finishes without opening the browser and `nanobot` is available
nanobot webui
```
-If the terminal cannot find `nanobot`, take the exact command printed by the installer and replace its final arguments with `webui`. That command may begin with `uv tool run`, `pipx run`, or the full path to nanobot's private Python environment.
+If the terminal cannot find `nanobot`, take the exact command printed by the installer and replace its final arguments with `webui`. It uses the Python executable from the persistent installation, not a temporary tool environment.
On SSH, a computer without a desktop, an existing configuration, or an older nanobot release, the installer may open the terminal wizard instead. Choose **Quick Start** there and follow its prompts.
## 5. Get the First Reply
-Leave the WebUI terminal open. If the browser did not open automatically, copy the complete login link printed in that terminal, including everything after `#`, into your browser. The bare `http://127.0.0.1:8765` address does not sign a new browser in. Keep the login link private: it contains a credential.
+Wait for the startup summary. If the browser did not open automatically, copy the complete login link printed in that terminal, including everything after `#`, into your browser. The bare `http://127.0.0.1:8765` address does not sign a new browser in. Keep the login link private: it contains a credential. Fresh official-installer environments keep running in the background; if the launcher remains attached, leave that terminal open.
Send this message:
@@ -137,7 +137,7 @@ You can also follow the steps yourself using the controls and guides below. Add
Repository docs show the current development version. If your stable package does not yet show **Channels**, use the [Chat Apps guide](./chat-apps.md) or update to a release that includes it.
-Some runtime changes ask you to restart nanobot. Use the restart action shown by the WebUI, or return to the terminal, press `Ctrl+C`, and run `nanobot webui` again.
+Some runtime changes ask you to restart nanobot. Use the restart action shown by the WebUI or `nanobot gateway restart` for a background gateway. For an attached on-demand launcher, press `Ctrl+C` and run `nanobot webui` again.
For a chat platform's account, bot, token, or permission prerequisites, use the [Chat Apps guide](./chat-apps.md). For local models and provider-specific recipes, use the [Provider Cookbook](./provider-cookbook.md).
@@ -166,7 +166,7 @@ nanobot agent -m "Hello!"
| `nanobot: command not found` | Reuse the exact nanobot command printed by the installer; it points to the isolated environment that contains the package |
| `401`, unauthorized, or invalid API key | The key is wrong, expired, or belongs to a different provider |
| Model not found | The model ID is misspelled or unavailable to your provider account |
-| Browser does not open | Copy the complete login link printed by the launcher, including the fragment after `#`, and keep the terminal running |
+| Browser does not open | Copy the complete login link printed by the launcher, including the fragment after `#`; keep the terminal open if the launcher is attached |
| Browser opens but messages fail | Test `nanobot agent -m "Hello!"` to separate a model problem from a WebUI problem |
| A change was saved but nothing changed | Restart nanobot so the running process reloads the config |
@@ -182,4 +182,4 @@ Run:
nanobot webui
```
-Leave that launcher open while you use nanobot. Pressing `Ctrl+C` disconnects it; the shared gateway stops when it was the last local WebUI or TUI client. After the normal foreground start and model setup work, use `nanobot gateway --background` when you want the gateway to stay online with no clients; then manage it with `nanobot gateway status`, `logs`, `restart`, and `stop`.
+A fresh official-installer environment starts a background gateway and returns control to the terminal. Closing the browser does not stop it. Manage it with `nanobot gateway status`, `logs`, `restart`, and `stop`; use the exact commands printed for your instance. Other installation methods keep their attached on-demand launch: leave that launcher open, or explicitly use `nanobot webui --detach` after setup. The last attached client stops an on-demand gateway, not a background gateway. See [updates and recovery](./updating.md) for the matching installation method.
diff --git a/docs/update-protocol.md b/docs/update-protocol.md
new file mode 100644
index 000000000..bf4474ef0
--- /dev/null
+++ b/docs/update-protocol.md
@@ -0,0 +1,88 @@
+# Update protocol
+
+This document is for gateway, client and updater maintainers. For installation choices, WebUI steps and recovery commands, see the [user update guide](updating.md). Release approval, catalogue and artifact schemas belong to the [release contract](releasing.md).
+
+## Ownership and approval boundaries
+
+The gateway owns policy, installation inspection and durable update state; clients present reviews and explicit consent. Reviewing a release, preparing files, approving shutdown, admitting package mutation and activating a gateway are separate decisions. None can be inferred from another's progress, a lost response or elapsed time.
+
+An [immutable plan](../nanobot/update_plan.py) binds an exact release artifact to the interpreter/environment snapshot, ownership receipts, extras, channel revision and known gateway profiles. Its lifetime is at most fifteen minutes. Preparation and shutdown preflight revalidate that target, never substitute a new latest version. Changed environment metadata, ownership, profiles, channel revision, expiry or release eligibility blocks progress. Planning and preflight share the installation's `releases` history: catalogue rollback or changed contents under the same generation must not become acceptable through a fresh per-job cache. A network failure is not a fresh successful check. See [release discovery](../nanobot/release_feed.py) and the [release contract](releasing.md) for approval and download rules.
+
+[Manager policy](../nanobot/update_manager.py) comes from the owner's receipt, not dependency-based guesses. Its hash binds the complete private settings; the review uses a credential-free summary of extras, constraints, source, pins/locks and additional package names. An absent `owner_restriction` is not execution eligibility. Supported pipx receipt schemas are `0.5` and `0.12`; reading them does not enable pipx execution or newer manager flags. The native uv transaction is limited to compatible POSIX uv `0.11.16` registry tools and preserves receipt policy. Unfrozen external resolver policy requires the owner's workflow. A plain-venv transaction requires explicit extras, including `[]` for the base package; installer- or manager-recorded extras cannot be replaced by a client.
+
+## Client interface
+
+Capabilities are optional additions to the [WebUI contract](../nanobot/webui/client_contract.py), not package-version comparisons or a higher protocol floor. Action names below have the prefix `settings.nanobot.update.`; read paths have the prefix `/api/settings/nanobot-update/`.
+
+| Capability | Interface |
+| --- | --- |
+| `webui.update-plans.v1` | `plan`; `GET plan?id=` |
+| `webui.update-jobs.read.v1` | `GET job?id=` |
+| `webui.update-jobs.prepare.v1` | `prepare`, `settle` for interrupted preparation |
+| `webui.update-jobs.execute.v1` | `execute` |
+| `webui.update-jobs.retry-handoff.v1` | `retry` |
+| `webui.update-jobs.settle-handoff.v1` | `settle` also retires inactive, uncommitted handoffs |
+| `webui.update-channels.v1` | `channel` with the saved revision |
+| `webui.update-flow.v1` | Client flow using review, preparation, execution and reconnection |
+
+All routes require authentication. Actions require an authenticated WebSocket; plain HTTP cannot create plans or mutate jobs. Preparation, settlement, execution, retry and channel changes also require the existing local-browser or explicit remote package-install permission and runtime admission checks. Review does not require installation permission. Desktop's native surface retains its distributor's updater. [Transport routing](../nanobot/webui/settings_routes.py) and the [settings handler](../nanobot/webui/settings_system.py) own these checks; update responses are `no-store`.
+
+`plan` accepts only `channel`, `restart_running` (default `false`) and optional `extras`. The default channel is the installation preference, or Stable when absent. It cannot accept a download URL, command, environment path or caller-supplied plan. `restart_running=true` selects known running background gateways with explicit lifetime and cooperative shutdown support, not stopped profiles or unknown supervisors. Inline eligibility requires the requesting gateway and every running peer in the reviewed stop/restart selection, with no unconfirmed owner.
+
+The review separates `installation_allowed` (caller policy) from `execution_available` and `execution_blocked_reason` (exact-plan eligibility). Neither authorizes execution. `validity` is a local snapshot result: `current`, `expired`, `installation_changed`, `profiles_changed` or `channel_changed`. Reading a saved review can inspect the current installation and profiles, but does not contact the release feed or choose another target.
+
+Job actions use `id`; execution additionally requires `confirm_restart: true`, and retry requires `previous_confirmation_id`. A job read returns durable facts including `recorded_phase`, `attempt`, `mutation_started`, `updated_at` and `execution_confirmation_id`, not worker liveness or permission to retry. Missing jobs return 404, invalid identifiers 400, and corrupt or misbound records 409. Reads do not start the installation's Python, contact release services or take its runtime lease; an active writer or incomplete-install marker does not hide history. Environment-path scoping can retain history after a reinstall, but does not authorize resuming the predecessor's job. Raw logs, resolver credentials and diagnostic messages are not exposed. Recovery flags distinguish automatic recovery selection, supervisor ownership and restored service. A returned recovery command is display-only.
+
+[Record publication](../nanobot/utils/atomic_file.py) is atomic, never delete-then-copy. Windows snapshot readers share deletion so polling can coexist with POSIX-style replacement on supported filesystems. Sharing and permission failures remain errors, not permission to publish partial records.
+
+Channel changes use revision checks, invalidate old reviews and retire only safely settled inactive jobs. They never install, downgrade or discard active work. Consumers recover lost preparation/execution responses by reading the same job; a missing journal or transport timeout alone is not authority to submit a replacement operation.
+
+## Preparation leases and settlement
+
+[Preparation](../nanobot/update_jobs.py) saves the immutable plan and a preparation journal before native inspection or resolution. It compares fresh environment metadata before and after staging, verifies the exact nanobot wheel and stages the resolved dependency transaction without changing installed files. Pip preparation retains its configured package-source trust policy; credential-bearing resolver files remain private and temporary. There is no source-build or global-manager fallback. For uv, a sealed private preparation cache and recorded dependency versions bind the offline transaction without rewriting the shared cache or saved policy.
+
+The frozen worker and helpers are standard-library-only and stored outside the installation. [Preparation children](../nanobot/update_process.py) start with `-I -S`, acquire their own runtime and native-preparation leases, validate the preparation generation, then initialize the target's site. Those leases cover `.pth`/site hooks, the actual probe or pip command and `atexit` cleanup, even if the parent disappears. Python commands run in the lease-owning process on POSIX and Windows. Native uv uses POSIX `exec` with retained descriptors; inherited handles do not transfer Windows byte-range lock ownership. Failed `exec` restores descriptor inheritance flags. These leases do not contain arbitrary descendants spawned by custom hooks.
+
+Cancellation does not release preparation ownership until native work actually returns. An orphan native child blocks another preparation and coordinated shutdown. A `preparing` record alone proves neither liveness nor completion. Settlement requires both parent and native preparation leases, revokes that generation and records `preparation_failed`; it neither deletes staging nor starts an install. Late children from the revoked generation cannot run. Older parent-only lease records cannot establish this proof. Retrying preparation must retain the same immutable plan; changed consent needs a new ID.
+
+The immutable `request.json`, written after inputs and initial status are flushed, is the preparation commit record. A `ready` journal alone is insufficient. Preparation grants no package-mutation authority.
+
+## Confirmation generations and offline execution
+
+The [job service](../nanobot/update_service.py) persists execution confirmation before launching a detached owner. Each confirmation may claim the operation once. Replaying execute, repeating a retry or presenting a stale predecessor returns history, not another attempt. Explicit retry replaces exactly `previous_confirmation_id` while worker and preflight leases are free; delayed launchers with the replaced confirmation cannot start. The original target, artifacts, plan expiry, release checks and selected runtime identities still apply. Retry cannot extend the review or repair mutation.
+
+Confirmation identity and expiry are separate checks. Launch consent is short-lived and bound to the immutable request. Under its lease, the supervisor validates that identity before publishing even its first journal or launching work. Completion and bounded recovery, including restoration, retain the same identity without reapplying the launch-window expiry. Fresh local repair can renew approval only for an already admitted exact job, not prepared files alone; it rechecks inputs and environment, preserves and verifies the original backup once created, and never resolves or downloads a release.
+
+The [offline worker](../nanobot/update_worker.py) uses the base Python with `-I -S`. Its actual installer child owns exclusive installation/data leases before target site initialization and rechecks ownership, environment, inputs and approval before mutation. Pip's CLI runs in that same single-use Python process on both POSIX and Windows, retaining locks through exit cleanup. It accepts only staged wheels with network resolution, builds and destination/configuration overrides disabled. Native uv retains its leases through POSIX `exec` and applies the sealed transaction offline.
+
+A pending-install fence and data reservation survive interrupted mutation. Repair cannot overwrite unrelated package changes or a different target installed by another updater. Restart-phase recovery retries restart, not installation. Installed-package verification uses a separately lease-owning child and a completion checkpoint: the target must import from the correct environment, application files including bundled assets must match the wheel, and dependency checks must pass. Without restart participants the result is `installed`, not a verified running gateway.
+
+## Shutdown and maintenance
+
+[Installation leases](../nanobot/installation_lock.py) are account-scoped by the real environment path, independent of profile home and symlink aliases. Cooperating runtimes hold shared OS locks; mutation needs exclusive access. Lock files must never be removed or replaced: a PID file is not ownership. Ordinary startup refuses an active updater or pending-install fence. These leases do not discover older runtimes, arbitrary imports, other accounts or external supervisors.
+
+The detached owner's [old-runtime preflight](../nanobot/update_handoff.py) owns a shared lease before application imports, revalidates the exact release using shared release history, closes the release client and requests [cooperative shutdown](../nanobot/update_stop.py). Every selected gateway must hold its idle admission gate before any stop is committed. Refusal before commit reopens intake; a durable commit is irrevocable and is not undone by a later failure. The owner waits for actual gateway and preflight process exit, not inactive receipts, before acquiring exclusive installation/data leases and admitting installation. Shutdown consent alone is not mutation approval.
+
+[Runtime admission](../nanobot/runtime_admission.py) accounts for accepted and detached work through cleanup without cancelling active tasks. Channel setup and provider sign-in owners must stay busy until native workers, callbacks and cleanup actually exit; cancelling an awaiter, expiring a flow or returning a QR/browser response does not establish idle. Failed cleanup retains ownership for retry. See the [connector lifecycle](../nanobot/channels/connect.py) and [sign-in registry](../nanobot/webui/settings_services.py). A loaded connector without that lifecycle cannot claim coordinated-update idleness.
+
+Handoff settlement requires free worker, preflight and stop-coordinator leases and refuses committed shutdown, installation admission or mutation. It records `cancelled` without deleting saved files or launching work; repeated settlement is safe. An uncertain response is resolved by reading the old job.
+
+## Data protection and protected restart
+
+[Profile receipts](../nanobot/update_profiles.py) preserve known stopped profiles for backup and retain original launch selectors, paths and process/run identities, not configuration contents or arbitrary environment variables. A PID alone is not liveness. A new run, changed inventory or unconfirmed owner invalidates review; inventory does not authorize stopping a supervisor or starting a previously stopped profile.
+
+[Data leases](../nanobot/data_access.py) protect overlapping named stores even across cooperating Python installations. Reservations bind the exact job and scope across crashes. [Backups](../nanobot/update_backup.py) cover recorded nanobot stores and required receipts, not entire homes, arbitrary projects or external services. Redirected paths, symlinks/reparse points, special files, changing data or insufficient space block backup. The original backup is verified and retained across retries, never replaced by post-mutation data. Automatic data rollback is unavailable.
+
+[Protected restart](../nanobot/update_restart.py) launches only reviewed participants through lease-owning frozen entrypoints using their saved selectors. A startup grant permits initialization of one participant's exact reserved data scope, not agent/tool/scheduler work or broader paths; its bearer is removed before normal runtime configuration. Grants cannot expand an older updater's reservation. For protocol-1 grants predating the lazy delivery store, that store takes an ordinary lease and cannot initialize, migrate or write before activation.
+
+Gateways remain in maintenance until their actual run identities, target versions and readiness are verified. Durable activation names those exact runs; a generic HTTP success or receipt is insufficient. Verification after intake opens precedes fence/reservation cleanup and `succeeded`. A crash during finalization resumes cleanup only, not reinstall or activation. Clients additionally require authenticated reconnection to the target-running gateway before reporting update completion.
+
+The optional macOS Dock helper belongs to the gateway, starts only after activation and exits when its owner stops. It holds no installation/data lease and is not loaded by the frozen updater or recovery supervisor. Its instance-scoped visibility intent survives reviewed restart/recovery; the helper does not own update execution or completion.
+
+## Recovery and compatibility limits
+
+For installer-owned dedicated venvs with selected background participants, [automatic recovery](../nanobot/update_fallback.py) preserves a verified sibling program/dependency snapshot before mutation. An independent supervisor can try the already admitted exact target once, then restore only the original program before candidate activation and only if protected user-file contents still match the original backup. Backup failure before mutation can restart the intact original program. Restoration uses journaled same-filesystem renames, retains the failed generation and replays one transient filesystem failure; duplicate launches do not gain another recovery budget.
+
+Restored service is not update success: the wire result remains `failed` for older clients and adds `service_restored`. Successful upgrades may remove their redundant program snapshot but retain the data backup. Changed data or durable activation forbids older-program restoration; only same-target completion remains safe. Corrupt snapshots, changed ownership, persistent filesystem faults, missing base Python or loss of both supervisor and worker can require operator recovery. This is neither malware remediation nor an OS boot-time recovery service.
+
+Compatibility is explicit, not inferred from versions. Protocol 1 covers worker request schema 4, frozen `-I -S` startup with child-owned installation leases, scoped data-startup grants and activation bound to the exact restarted run. The target must declare a supported protected-handoff contract; see [release compatibility](releasing.md#protected-updater-handoff-compatibility) for its schema and publication requirements. External managers, unsupported layouts and older jobs are not silently adopted. Hosts without settlement/retry capabilities retain their existing status/recovery route rather than accepting unsupported actions. The [standalone launcher](../nanobot/update_recovery.py) uses the saved worker and original base Python independently of a broken application environment; user commands and operational limits remain in the [update guide](updating.md).
diff --git a/docs/updating.md b/docs/updating.md
new file mode 100644
index 000000000..ebc3fa5e0
--- /dev/null
+++ b/docs/updating.md
@@ -0,0 +1,109 @@
+# Updating nanobot
+
+Use the update method that owns your installation. If your version does not include the WebUI updater, first upgrade through the original installer or package manager. This does not convert an existing installation into an installer-managed one.
+
+## Update from the WebUI
+
+1. Open the blue update entry in the sidebar or **Settings → About → Update**. Opening the dialog only checks the installation; it does not install or restart anything.
+2. Review the exact version and affected gateways. Active work must finish before shutdown. Gateways that were already stopped are not started by the update.
+3. Choose **Update & restart**. nanobot downloads and verifies the required files, backs up affected profiles, installs the update, and restarts the selected background gateways—not your computer or browser.
+4. Wait for **Update complete**, which requires a reconnected gateway running the target version. Choose **Done** to reload the updated interface. If you hide the dialog, reopen it through **Settings → About → View details**.
+
+Inline updates support fresh official-installer environments and compatible POSIX uv 0.11.16 registry tool installations running a background gateway. Other installations show their own update instructions in the dialog; see [Installation owners](#installation-owners). Remote browsers need the gateway's explicit package-install permission.
+
+On a local macOS desktop, the background WebUI's Dock icon stays available after closing the terminal and disappears when the gateway stops. A restarted or restored gateway recreates it after activation; it may disappear during package replacement and is not an update progress indicator. `--no-dock` remembers your choice for that instance. See the [Dock controls](webui.md#macos-dock-icon).
+
+Automatic installation requires official release approval and verified package checksums for both Stable and Preview. If verification fails, keep using the current version, retry later, and report persistent errors to a maintainer. Do not disable verification or install a replacement file from an error message. Verification confirms release approval; it is not a guarantee that all application or dependency code is harmless.
+
+## Stable and Preview
+
+**Settings → About → Receive preview updates** is off by default. Enable it to try new features earlier, with a higher risk of bugs. The preference applies to this installation, not just the browser; changing it requires the same local or remote permission as installing packages. It never downloads, installs, or restarts on its own.
+
+Turn it off to receive only stable updates. If your Preview is newer than the latest stable release, nanobot keeps it until a newer stable release is available; it does not downgrade or restore old data. Installing a final release while Preview is enabled keeps Preview enabled for the next development cycle. You can skip intermediate previews.
+
+Stable fixes can arrive between feature releases. Preview availability depends on verified publication, not a promise of daily updates. Package-manager commands outside nanobot do not read this preference; choose their version or channel explicitly.
+
+## Installation owners
+
+When inline installation is unavailable, the update dialog identifies the installation method and guides you through its update. Run copied commands **on the gateway computer, as the original installation account**. For containers, use the deployment host rather than treating a container path as a host path.
+
+| Installation | Update route |
+| --- | --- |
+| Fresh official installer | Use WebUI **Update & restart** for a compatible release. Existing unrecorded environments are not automatically adopted. |
+| uv registry tool | Use the supported inline flow above, or `uv tool upgrade nanobot-ai` in its original environment. Keep recorded extras, constraints and additional packages; a pin needs an explicitly reviewed new constraint. |
+| pipx | Use `pipx upgrade nanobot-ai` only for an unconstrained registry install without recorded pip options. Otherwise preserve the original requirement, index/options, suffix and injected packages through the owner's workflow. |
+| Ordinary pip venv | Use that environment's Python with `-m pip install --upgrade 'nanobot-ai[]'`; omit brackets for the base package. Do not guess optional extras. |
+| Source checkout | Preserve local changes, update the selected ref and environment, and follow the [development instructions](../CONTRIBUTING.md). Source is not the Preview release channel. |
+| Docker / Compose | Pull or build the selected image and recreate the service with its existing data volumes. Do not pip-install into a running container. |
+| OS package, service manager or Desktop | Use the distributor or deployment's updater and launcher. |
+
+For an external update, stop all affected writers, back up configuration and data, update through the original installation method, then restart the same profiles through their original launcher. New versions may migrate stored data. Verify the **running** version in **About** and check that configuration and conversations remain available. Package-manager success alone does not verify the gateway, and manual updates do not inherit the managed updater's automatic recovery.
+
+Do not switch package managers to work around an error. Fixed wheel sources, locked requirements and custom installations need their original settings reviewed. If a fresh official installation fails, fix the reported prerequisite or network error and rerun the same installer command.
+
+## Recover an interrupted update
+
+Refreshing restores saved progress, **not installation consent**. A staged update may ask you to review and confirm it again. A disconnected page cannot tell whether the worker stopped: do not start another installation while it reconnects. Closing the browser does not stop the managed update or its recovery.
+
+**Check again** only reads saved status. **Review update** asks the gateway to settle an interrupted preparation or failed handoff before opening a fresh review. Settlement is refused while an owner is active or the operation has progressed too far to discard safely. It does not prepare or install another update; that requires a separate **Update & restart** confirmation.
+
+If settlement is refused or its response is lost, the saved job remains available for status checks and recovery. A timeout or missing response is not permission to create a second update. After package changes have begun, use recovery rather than trying another installation.
+
+## Automatic service recovery
+
+For installer-owned dedicated environments with supported background gateways, the update confirmation also authorizes bounded recovery of that exact operation. nanobot retains a separate copy of the original program and dependencies before changing packages; insufficient space aborts installation.
+
+If installation fails, recovery tries the already approved target once using saved files. If that also fails before the new gateway is activated, it can restore the original program and restart the reviewed gateways **only if protected user data is unchanged**. The dialog reports **Previous version restored**, not update success. A restored service needs a fresh review before another update.
+
+Recovery never replaces current configuration or conversations with an old backup. Changed user data, missing or corrupt saved files, changed installation ownership, persistent disk errors, a missing base Python, or loss of both recovery processes can require operator help. Keep the saved job and backup; do not delete recovery markers or install over them. This is not recovery after every power loss or a guarantee against malicious code. Other installation methods retain their original recovery route.
+
+## Standalone recovery
+
+When automatic recovery is unavailable or reports failure, the WebUI can show a repair command containing the saved job ID and exact Python and launcher paths. Copy that command and run it **on the gateway computer, as the original OS user**. It does not require a working nanobot environment, but it does need the original base Python.
+
+The following examples assume the gateway uses your terminal's normal home directory and a Python 3.11+ command. Prefer the exact paths shown by the WebUI when they differ.
+
+macOS / Linux:
+
+```sh
+python3 -I -S ~/.nanobot/updates/recover.py
+python3 -I -S ~/.nanobot/updates/recover.py --repair
+```
+
+Windows PowerShell:
+
+```powershell
+python -I -S "$env:USERPROFILE\.nanobot\updates\recover.py"
+python -I -S "$env:USERPROFILE\.nanobot\updates\recover.py" --repair
+```
+
+The first command only inspects the job. `--repair` shows its saved version, environment and backup, then asks for confirmation; `--yes` skips that prompt only when used with `--repair`. Repair reuses the same verified files without downloading another release. If installation finished but restart failed, it retries restart rather than reinstalling packages. Merely preparing files does not make a job eligible for repair.
+
+Keep the original job directory and backup until recovery is verified. Missing or changed files and an independently modified environment require operator repair. Do not restore backups over live data. Downgrading and restoring user data are separate, owner-managed operations.
+
+## Review an exact release
+
+```bash
+nanobot update --plan
+nanobot update --plan --channel preview
+```
+
+These commands save a plan showing the installation method, installed and running versions, exact target, download details and expected action. They may write plan and metadata-cache files, but do not install, stop tasks or restart gateways. `--channel` is a one-time inspection; it does not change your saved subscription.
+
+Plans expire after fifteen minutes. Execution rechecks the reviewed release and refuses changed installations, withdrawn releases or changed artifacts. A plan is not installation permission. The separate `nanobot update`, `--check` and `--dev` commands do not execute saved plans; see the [CLI reference](cli-reference.md#updating).
+
+## Explicit recovery before package mutation
+
+If shutdown failed **before package changes began** and the application environment is still intact, you can inspect the saved job and explicitly retry its reviewed operation:
+
+```bash
+nanobot update --job
+nanobot update --job --retry-handoff \
+ --previous-confirmation --confirm-restart
+```
+
+Read the saved facts and original plan before running the second command: it approves shutdown, installation and restart, not just a connection check. The same plan must still be valid, and live owners prevent retry. An accepted request is not proof of completion; check the saved result and running gateway.
+
+These commands cannot repair a broken installation or packages already changed by an interrupted update. Use [standalone recovery](#standalone-recovery) instead.
+
+For contributor-facing APIs, ownership and execution rules, see [Update protocol](update-protocol.md). Maintainers should use the [release checklist](releasing.md).
diff --git a/docs/webui.md b/docs/webui.md
index 5e3ca5aa7..f9c8942ad 100644
--- a/docs/webui.md
+++ b/docs/webui.md
@@ -16,17 +16,17 @@ Use the launcher:
nanobot webui
```
-`nanobot webui` asks for one confirmation on a new installation, creates the config/workspace, enables the local WebSocket channel, and generates a WebUI bootstrap secret when one is missing. It starts or joins the same on-demand gateway used by the native TUI and opens the browser. With a fresh config, it can open before a model is configured so you can finish setup in **Settings → Models**. The first-run path binds the WebUI to `127.0.0.1` by default, so it is not available from other devices on your LAN. The startup summary groups the login link, model setup guidance, config, and exit controls with blank lines. While attached, the launcher displays new gateway warnings and errors; use the printed logs command for full output.
+`nanobot webui` asks for one confirmation on a new installation, creates the config/workspace, enables the local WebSocket channel, and generates a WebUI bootstrap secret when one is missing. It starts or joins the same gateway used by the native TUI and opens the browser. Fresh official-installer environments start it persistently and return control to the terminal; other installations keep the attached on-demand launch. With a fresh config, it can open before a model is configured so you can finish setup in **Settings → Models**. The first-run path binds the WebUI to `127.0.0.1` by default, so it is not available from other devices on your LAN. The startup summary groups the login link, model setup guidance, config, and exit controls with blank lines. While attached, the launcher displays new gateway warnings and errors; use the printed logs command for full output.
-After model setup, explicitly promote the shared gateway when you do not want to keep a client open:
+Outside an installer-managed environment, use `nanobot webui --detach` to open the browser and keep the gateway running after the terminal closes. Alternatively, start or promote the same shared gateway explicitly:
```bash
nanobot gateway --background
```
-`nanobot webui --background` is retained only to print migration guidance. This keeps one unambiguous owner for persistent process lifecycle.
+`nanobot webui --background` remains deprecated and prints migration guidance. All launch routes use the same gateway lifecycle owner and state.
-Each foreground WebUI or TUI launcher releases only its own client. The last interactive launcher stops an on-demand gateway. `nanobot gateway --background` makes the gateway persistent; manage it with `nanobot gateway status`, `nanobot gateway logs`, `nanobot gateway restart`, and `nanobot gateway stop`.
+Each foreground WebUI or TUI launcher releases only its own client. The last interactive launcher stops an on-demand gateway, but not a persistent one. Manage the persistent gateway with `nanobot gateway status`, `nanobot gateway logs`, `nanobot gateway restart`, and `nanobot gateway stop`. Use the printed instance-specific commands when you selected a custom config or workspace. `--detach --dev` is unsupported; development remains attached.
The browser signs in automatically using the generated credential in the launch URL. The terminal also prints the complete login link: if automatic opening fails, copy that link into your browser, including the fragment after `#`. In WSL, the launcher opens your Windows default browser through Windows PowerShell; an explicit `BROWSER` setting takes precedence. If Windows integration is unavailable, open the printed link in your Windows browser. The plain page address does not sign in a new browser. Treat the login link as a credential and do not share it.
@@ -56,6 +56,16 @@ Manual config still works. Same-machine localhost WebUI access can run without a
The WebUI is served by the WebSocket channel on port `8765` by default. The gateway health endpoint, `18790` by default, is not the browser UI.
+### macOS Dock icon
+
+In a local macOS desktop session, `nanobot webui` shows the nanobot cat in the Dock. Click it to open the current local WebUI in your default browser. `--no-open` keeps the icon but does not open a page automatically. SSH, headless, Windows and Linux launches keep their existing behavior. A one-shot connection to an unmanaged gateway does not leave an icon behind.
+
+Ordinary foreground launchers for the same instance, browser address and installation share an icon. The last WebUI launcher removes it when it exits, including after a terminal crash. For `--detach` and official-installer automatic background launch, the gateway owns the icon instead: closing the terminal does not remove it. An ordinary restart, successful update or supported automatic restoration shows it again once that gateway is activated. The icon can disappear while the service is stopped for an update; it is not an update-progress indicator. `nanobot gateway stop` removes it without changing configuration or chats.
+
+Use `--no-dock` to disable the icon for a launcher. In detached mode this also remembers the choice for that instance's later restarts; running `nanobot webui` without it enables the background icon again. The request is stored beside the runtime state as a small `.dock` file, without a URL or credentials. Choosing **Hide Dock Icon** or quitting the icon hides only this shortcut, not the gateway or its tasks. It stays hidden until another explicit launch or service restart. The icon is not a standalone launcher to keep pinned when nanobot is stopped.
+
+The helper uses the installed Python and macOS frameworks, with no Xcode, extra Python dependency, executable download or separate updater. Its temporary application wrapper is private to the OS user. The login URL stays in memory and a private socket, never in process arguments or a file. The helper holds no installation or data lease, and protected restart does not start it until activation. A missing image or unavailable desktop does not prevent WebUI startup, updates or independent recovery. Non-loopback browser addresses continue to use the normal browser launcher.
+
## Navigate a long conversation
On wide screens, use the message rail on the left to browse saved prompts; click one to jump to it. You can also search prompt summaries from the header. The WebUI loads messages near the selected prompt rather than the entire conversation. Scroll backward or forward to browse, or use the bottom arrow to return to the latest messages. If loading fails, your current content stays visible and you can retry. Older compatible hosts may only support navigation among messages that are already loaded.
diff --git a/hatch_build.py b/hatch_build.py
index 3bec76066..881621fdd 100644
--- a/hatch_build.py
+++ b/hatch_build.py
@@ -15,8 +15,8 @@ WebUI behavior:
- Skips when `NANOBOT_SKIP_WEBUI_BUILD=1` is set.
- Reuses `nanobot/web/dist/` only when it is already fresh, unless
`NANOBOT_FORCE_WEBUI_BUILD=1` is set.
-- Uses `bun` when available, otherwise falls back to `npm`. The chosen tool
- performs `install` followed by `run build`.
+- Uses `bun` when available, otherwise falls back to `npm`, or provisions Bun
+ when neither is available. Bun builds use `--bun` so Node is not required.
"""
from __future__ import annotations
diff --git a/nanobot/agent/loop.py b/nanobot/agent/loop.py
index 1b7a09d8d..ae1d56e99 100644
--- a/nanobot/agent/loop.py
+++ b/nanobot/agent/loop.py
@@ -65,6 +65,7 @@ from nanobot.events import NO_EVENTS, AgentEvent, EventSink
from nanobot.llm_usage.context import source_from_request
from nanobot.providers.base import LLMProvider, LLMUsage, ProviderConversationState
from nanobot.providers.factory import ProviderSnapshot
+from nanobot.runtime_admission import RuntimeMaintenanceError
from nanobot.runtime_context import (
RUNTIME_CONTEXT_HISTORY_META,
RUNTIME_CONTEXT_MESSAGE_META,
@@ -970,13 +971,14 @@ class AgentLoop:
async def discard_session(self, key: str) -> None:
"""Stop active work for *key* and forget its cached session."""
- self._discarding_sessions.add(key)
- try:
- await self.sessions.state.discard(key)
- await self._cancel_active_tasks(key)
- finally:
- self.discard_session_file_state(key)
- self._discarding_sessions.discard(key)
+ with self.bus.admission.activity():
+ self._discarding_sessions.add(key)
+ try:
+ await self.sessions.state.discard(key)
+ await self._cancel_active_tasks(key)
+ finally:
+ self.discard_session_file_state(key)
+ self._discarding_sessions.discard(key)
def discard_session_file_state(self, key: str) -> None:
"""Forget ephemeral file-read state for a reset or removed session."""
@@ -1393,16 +1395,19 @@ class AgentLoop:
async def _check_expired_sessions_if_due(self) -> None:
"""Scan idle sessions without blocking the event loop."""
+ if self.bus.admission.paused:
+ return
now = time.monotonic()
if now < self._next_idle_compact_check_at:
return
self._next_idle_compact_check_at = now + self._idle_compact_check_interval_s
try:
- await self.auto_compact.check_expired(
- self.schedule_background,
- self.runtime_for_session,
- active_session_keys=self._pending_queues.keys(),
- )
+ with self.bus.admission.activity():
+ await self.auto_compact.check_expired(
+ self.schedule_background,
+ self.runtime_for_session,
+ active_session_keys=self._pending_queues.keys(),
+ )
except SessionOperationQueueFullError:
logger.debug("Skipping idle archival while session storage is busy")
@@ -1414,7 +1419,10 @@ class AgentLoop:
while self._running:
try:
- msg = await asyncio.wait_for(self.bus.consume_inbound(), timeout=1.0)
+ # Keep dequeue and admission in this task. wait_for would
+ # dequeue in another task, leaving a false-idle handoff gap.
+ async with asyncio.timeout(1.0):
+ msg = await self.bus.consume_inbound()
except asyncio.TimeoutError:
await self._check_expired_sessions_if_due()
continue
@@ -1431,14 +1439,15 @@ class AgentLoop:
logger.warning("Error consuming inbound message: {}, continuing...", e)
continue
- try:
- await self._dispatch_inbound(msg)
- except (SessionOperationQueueFullError, SessionConflictError) as exc:
- key = self._effective_session_key(msg)
- logger.warning("Session input rejected for {}: {}", key, exc)
- if msg.is_user_input:
- delivery = self.turn_delivery_factory.unrouted(msg, key)
- await delivery.fail(publish_completion=key not in self._pending_queues)
+ with self.bus.admission.activity():
+ try:
+ await self._dispatch_inbound(msg)
+ except (SessionOperationQueueFullError, SessionConflictError) as exc:
+ key = self._effective_session_key(msg)
+ logger.warning("Session input rejected for {}: {}", key, exc)
+ if msg.is_user_input:
+ delivery = self.turn_delivery_factory.unrouted(msg, key)
+ await delivery.fail(publish_completion=key not in self._pending_queues)
finally:
await self.aclose()
@@ -1491,6 +1500,23 @@ class AgentLoop:
return
await self._enqueue_session_message(routed_msg)
+ def maintenance(self) -> AbstractContextManager[None]:
+ """Close task intake only when this runtime's accepted work is finished.
+
+ The gateway shares the bus gate with cron and local trigger intake.
+ This does not stop other processes or channel/configuration writes;
+ those must be shut down before an updater takes a data backup.
+ """
+ return self.bus.admission.pause_if_idle(self._has_pending_work)
+
+ def _has_pending_work(self) -> bool:
+ return bool(
+ self.bus.inbound_size or self._pending_queues or self._deferred_automation_turns
+ or self.bus.has_pending_events or self._active_tasks or self._background_tasks
+ or self._close_lock.locked()
+ or self.subagents.has_pending_work or self._exec_session_manager.has_pending_work
+ )
+
def preserve_inflight_turns_on_shutdown(self) -> None:
"""Keep durable checkpoints when the owning gateway exits.
@@ -1523,6 +1549,7 @@ class AgentLoop:
async def _enqueue_session_message(self, msg: InboundMessage) -> None:
"""Admit session work without waiting for its execution or result."""
+ self.bus.admission.check()
session_key = self._effective_session_key(msg)
if not self.subagents.accepts_result(msg, session_key):
return
@@ -1808,6 +1835,11 @@ class AgentLoop:
def schedule_background(self, coro: Coroutine[Any, Any, Any]) -> None:
"""Schedule a coroutine as a tracked background task (drained on shutdown)."""
+ try:
+ self.bus.admission.check()
+ except RuntimeMaintenanceError:
+ coro.close()
+ raise
task = asyncio.create_task(coro)
self._background_tasks.add(task)
task.add_done_callback(self._background_task_done)
@@ -2657,53 +2689,54 @@ class AgentLoop:
)
# Share the dispatch lock so direct calls serialize with bus turns.
lock = self._get_session_lock(session_key)
- temporary_parent = False
- try:
- async with lock:
- kwargs: dict[str, Any] = {
- "session_key": session_key,
- "on_progress": on_progress,
- "on_stream": on_stream,
- "on_stream_end": on_stream_end,
- "ephemeral": ephemeral,
- }
- if _session_policy is not None:
- # Isolate per-run state before any early save or checkpoint;
- # the cached conversation must survive a temporary SDK turn.
- session = (await self.sessions.state.read(session_key) or Session(key=session_key)
- if not _session_policy.persist
- else await self.sessions.state.get(session_key))
- temporary_parent = not _session_policy.persist and not session.persisted
- session.policy = SessionPolicy(
- persist=session.policy.persist and _session_policy.persist,
- log_content=session.policy.log_content and _session_policy.log_content,
- disabled_tools=session.policy.disabled_tools | _session_policy.disabled_tools,
- )
- kwargs["session"] = session
- if _run_extra_hooks_for_ephemeral:
- kwargs["run_extra_hooks_for_ephemeral"] = True
- if hooks is not None:
- kwargs["hooks"] = hooks
- if hook_factories is not None:
- kwargs["hook_factories"] = hook_factories
- if tools is not None:
- kwargs["tools"] = tools
- if runtime is not None:
- kwargs["runtime"] = runtime
- if on_runtime_admitted is not None:
- kwargs["on_runtime_admitted"] = on_runtime_admitted
- if attributes is not None:
- kwargs["attributes"] = dict(attributes)
- try:
- return await self._process_message(msg, **kwargs)
- finally:
- if temporary_parent:
- parent = self.sessions.state.peek_header(session_key)
- if parent is not None and not parent.policy.persist:
- await self.sessions.state.delete(session_key, expected_generation=parent.generation)
- finally:
- await self.runtime_event_publisher.run_status_changed(msg, session_key, "idle")
- self.runtime_event_publisher.clear_turn(session_key)
+ with self.bus.admission.activity():
+ temporary_parent = False
+ try:
+ async with lock:
+ kwargs: dict[str, Any] = {
+ "session_key": session_key,
+ "on_progress": on_progress,
+ "on_stream": on_stream,
+ "on_stream_end": on_stream_end,
+ "ephemeral": ephemeral,
+ }
+ if _session_policy is not None:
+ # Isolate per-run state before any early save or checkpoint;
+ # the cached conversation must survive a temporary SDK turn.
+ session = (await self.sessions.state.read(session_key) or Session(key=session_key)
+ if not _session_policy.persist
+ else await self.sessions.state.get(session_key))
+ temporary_parent = not _session_policy.persist and not session.persisted
+ session.policy = SessionPolicy(
+ persist=session.policy.persist and _session_policy.persist,
+ log_content=session.policy.log_content and _session_policy.log_content,
+ disabled_tools=session.policy.disabled_tools | _session_policy.disabled_tools,
+ )
+ kwargs["session"] = session
+ if _run_extra_hooks_for_ephemeral:
+ kwargs["run_extra_hooks_for_ephemeral"] = True
+ if hooks is not None:
+ kwargs["hooks"] = hooks
+ if hook_factories is not None:
+ kwargs["hook_factories"] = hook_factories
+ if tools is not None:
+ kwargs["tools"] = tools
+ if runtime is not None:
+ kwargs["runtime"] = runtime
+ if on_runtime_admitted is not None:
+ kwargs["on_runtime_admitted"] = on_runtime_admitted
+ if attributes is not None:
+ kwargs["attributes"] = dict(attributes)
+ try:
+ return await self._process_message(msg, **kwargs)
+ finally:
+ if temporary_parent:
+ parent = self.sessions.state.peek_header(session_key)
+ if parent is not None and not parent.policy.persist:
+ await self.sessions.state.delete(session_key, expected_generation=parent.generation)
+ finally:
+ await self.runtime_event_publisher.run_status_changed(msg, session_key, "idle")
+ self.runtime_event_publisher.clear_turn(session_key)
def _get_session_lock(self, session_key: str) -> asyncio.Lock:
"""Return the shared lock while allowing idle session entries to expire."""
diff --git a/nanobot/agent/subagent.py b/nanobot/agent/subagent.py
index 084899127..20d9d177f 100644
--- a/nanobot/agent/subagent.py
+++ b/nanobot/agent/subagent.py
@@ -544,6 +544,7 @@ class SubagentManager:
runtime: LLMRuntime | None, *, announce: bool, origin_turn_id: str | None,
session_policy: SessionPolicy | None,
) -> _SubagentTask:
+ self.bus.admission.check()
if runtime is None:
runtime = self._compat_spawn_runtime()
if temperature is not None:
@@ -1003,6 +1004,11 @@ class SubagentManager:
"""Return the number of currently running subagents."""
return len(self._running_tasks)
+ @property
+ def has_pending_work(self) -> bool:
+ """Completed turns may still own exec cleanup, including failed cleanup."""
+ return bool(self._tasks) or self._exec_session_manager.has_pending_work
+
def get_running_count_by_session(self, session_key: str) -> int:
"""Return the number of currently running subagents for a session."""
return sum(
diff --git a/nanobot/agent/tools/exec_session.py b/nanobot/agent/tools/exec_session.py
index dce775e88..6e4022ece 100644
--- a/nanobot/agent/tools/exec_session.py
+++ b/nanobot/agent/tools/exec_session.py
@@ -238,7 +238,10 @@ class _ExecSession:
finally:
stopped.cancel()
await asyncio.gather(stopped, return_exceptions=True)
- from nanobot.agent.tools.shell import ExecTool, _reap_pid # pyright: ignore[reportPrivateUsage]
+ from nanobot.agent.tools.shell import (
+ ExecTool,
+ _reap_pid, # pyright: ignore[reportPrivateUsage]
+ )
ExecTool._release_process_tree(self.process) # pyright: ignore[reportPrivateUsage]
_reap_pid(self.process.pid)
@@ -253,6 +256,18 @@ class _ExecSession:
self._state_changed.clear()
await self._state_changed.wait()
+ @property
+ def has_pending_work(self) -> bool:
+ """Include pipe draining and failed/in-flight process-tree cleanup."""
+ cleanup = self._kill_task
+ return (
+ self.finished_at is None
+ or not self._stdout_task.done() or not self._stderr_task.done()
+ or (cleanup is not None and (
+ not cleanup.done() or cleanup.cancelled() or cleanup.exception() is not None
+ ))
+ )
+
async def _watch_timeout(self) -> None:
"""Supervise execution budgets independently of tool waits and log reads."""
while not self._completion_task.done():
@@ -371,13 +386,16 @@ class _ExecSession:
await asyncio.shield(self._completion_task)
async def _begin_stop(self, reason: FinishReason) -> None:
- if self.finished_at is not None:
+ if not self.has_pending_work:
return
if self._execution_exited and self._stop_reason is None:
return
if self._stop_reason is None:
self._stop_reason = reason
- if self._kill_task is None:
+ if self._kill_task is None or (
+ self._kill_task.done()
+ and (self._kill_task.cancelled() or self._kill_task.exception() is not None)
+ ):
self.cleanup_error = None
self._kill_task = asyncio.create_task(self._kill())
self._kill_task.add_done_callback(self._on_kill_done)
@@ -391,8 +409,8 @@ class _ExecSession:
logger.opt(exception=error if tool_log_content_allowed() else False).error(
"Failed to terminate exec session {}", self.session_id,
)
- if (task.cancelled() or error is not None) and self._kill_task is task:
- self._kill_task = None
+ # Retain failed cleanup as unsettled work, even if the parent exited.
+ # kill() replaces it on an explicit retry.
async def _kill(self) -> None:
from nanobot.agent.tools.shell import ExecTool
@@ -410,9 +428,18 @@ class ExecSessionManager:
self.result_retention = result_retention
self._sessions: dict[str, _ExecSession] = {}
self._starting: dict[str, tuple[str | None, asyncio.Task[_ExecSession]]] = {}
+ self._stopping_launches: set[asyncio.Task[_ExecSession]] = set()
self._lock = asyncio.Lock()
self._closed = False
+ @property
+ def has_pending_work(self) -> bool:
+ """Inspect owned work without polling, terminating or removing sessions."""
+ return bool(
+ self._lock.locked() or self._starting or self._stopping_launches
+ or any(s.has_pending_work for s in self._sessions.values())
+ )
+
async def start(
self,
*,
@@ -574,7 +601,6 @@ class ExecSessionManager:
async with self._lock:
self._closed = True
sessions: list[_ExecSession] = list(self._sessions.values())
- self._sessions.clear()
launches = [task for _, task in self._starting.values()]
self._starting.clear()
return await self._stop_owned(sessions, launches, "shutdown")
@@ -583,9 +609,9 @@ class ExecSessionManager:
"""Terminate all sessions owned by owner_session_key. Returns count."""
async with self._lock:
victims: list[_ExecSession] = []
- for sid, s in list(self._sessions.items()):
+ for s in self._sessions.values():
if s.owner_session_key == owner_session_key:
- victims.append(self._sessions.pop(sid))
+ victims.append(s)
launches = [
task for owner, task in self._starting.values() if owner == owner_session_key
]
@@ -598,6 +624,10 @@ class ExecSessionManager:
self, sessions: list[_ExecSession], launches: list[asyncio.Task[_ExecSession]],
reason: FinishReason,
) -> int:
+ # Removed startup reservations must stay visible until cancellation drains.
+ self._stopping_launches.update(launches)
+ for task in launches:
+ task.add_done_callback(self._stopping_launches.discard)
results: list[None | BaseException] = list(await asyncio.gather(
*(session.kill(reason) for session in sessions),
self._cancel_launches(launches),
@@ -609,10 +639,10 @@ class ExecSessionManager:
for session, result in zip(sessions, results, strict=True)
if isinstance(result, BaseException)
]
- if failures:
- async with self._lock:
- for session, _ in failures:
- self._sessions[session.session_id] = session
+ async with self._lock:
+ for session, result in zip(sessions, results, strict=True):
+ if not isinstance(result, BaseException):
+ self._sessions.pop(session.session_id, None)
errors = [result for _, result in failures]
if isinstance(startup_error, BaseException):
errors.append(startup_error)
diff --git a/nanobot/bun.py b/nanobot/bun.py
new file mode 100644
index 000000000..ebf04f6a7
--- /dev/null
+++ b/nanobot/bun.py
@@ -0,0 +1,122 @@
+"""Provision the Bun runtime used by source installations and package builds."""
+
+from __future__ import annotations
+
+import hashlib
+import io
+import os
+import platform
+import shutil
+import subprocess
+import tempfile
+import urllib.request
+import zipfile
+from collections.abc import Callable, Generator
+from contextlib import contextmanager
+from pathlib import Path
+
+from filelock import FileLock
+
+BUN_VERSION = "1.3.13"
+# SHA-256 of the official bun-v1.3.13 release archives.
+_ARCHIVES = {
+ "linux-x64-baseline": "9d8a24292a7068090205daac0a5a223f5f69736f5287e37bf88d3b4031edc750",
+ "linux-x64-musl-baseline": "88ca7c7ad235b498f549eea2f770f434e9f0f5e9ba95168a2d3a1f235184c394",
+ "linux-aarch64": "70bae41b3908b0a120e1e58c5c8af30e74afae3b8d11b0d3fdd8e787ddfb4b22",
+ "linux-aarch64-musl": "5385e978107ce4934298d8d6afe9bfbb898683f6cc23e6753a0da60bc60c5b81",
+ "darwin-x64-baseline": "a98ba6a480f22fda9b343626b906a4e26aa53618bf85d2bc5928ecf2ba45f0ed",
+ "darwin-aarch64": "5467e3f65dba526b9fea98f0cce04efafc0c63e169733ec27b876a3ad32da190",
+ "windows-x64-baseline": "c68c7903c1190101590cc1b2129835f47211b3b37ae87759f2b97d6534aa3ad1",
+}
+
+
+class BunUnavailableError(RuntimeError):
+ """The required runtime could not be prepared for this platform."""
+
+
+@contextmanager
+def bun_environment(executable: str) -> Generator[dict[str, str]]:
+ """Run lifecycle scripts' `node` commands with Bun, without a global Node shim."""
+ env = os.environ.copy()
+ runtime = Path(shutil.which(executable) or executable).resolve()
+ if os.name == "nt" and runtime.suffix.lower() in {".cmd", ".bat"}:
+ runtime = Path(subprocess.check_output(
+ [str(runtime), "-p", "process.execPath"], text=True, timeout=10,
+ ).strip())
+ # `bun --bun install` does not alias node in dependency lifecycle scripts.
+ # Only this subprocess tree sees the alias; Windows hardlinks need no admin rights.
+ with tempfile.TemporaryDirectory(prefix="nanobot-bun-") as temporary:
+ node = Path(temporary) / ("node.exe" if os.name == "nt" else "node")
+ try:
+ node.hardlink_to(runtime)
+ except OSError:
+ shutil.copy2(runtime, node)
+ env["PATH"] = os.pathsep.join((temporary, str(runtime.parent), env.get("PATH", "")))
+ yield env
+
+
+def _matches_version(executable: str) -> bool:
+ try:
+ result = subprocess.run(
+ [executable, "--version"], capture_output=True, text=True, timeout=10,
+ )
+ return result.returncode == 0 and result.stdout.strip() == BUN_VERSION
+ except (OSError, subprocess.TimeoutExpired):
+ return False
+
+
+def _target() -> str:
+ system = {"Linux": "linux", "Darwin": "darwin", "Windows": "windows"}.get(
+ platform.system(), "unknown",
+ )
+ arch = {"x86_64": "x64", "amd64": "x64", "arm64": "aarch64", "aarch64": "aarch64"}.get(
+ platform.machine().lower(), "unknown",
+ )
+ musl = system == "linux" and (
+ platform.libc_ver()[0] == "musl" or any(Path("/lib").glob("ld-musl-*.so.1"))
+ )
+ target = f"{system}-{arch}" + ("-musl" if musl else "")
+ if arch == "x64":
+ target += "-baseline"
+ if target not in _ARCHIVES:
+ raise BunUnavailableError(f"Automatic Bun setup is not supported on {system}/{arch}.")
+ return target
+
+
+def ensure_bun(
+ *, cache_dir: Path | None = None, output: Callable[[str], None] = print,
+) -> str:
+ """Return the pinned runtime, downloading a verified executable when missing."""
+ existing = shutil.which("bun")
+ if existing and _matches_version(existing):
+ return existing
+ target = _target()
+ root = cache_dir or Path.home() / ".nanobot" / "tools" / "bun"
+ directory = root / BUN_VERSION / target
+ executable = directory / ("bun.exe" if os.name == "nt" else "bun")
+ directory.mkdir(parents=True, exist_ok=True)
+ with FileLock(str(directory / "install.lock"), timeout=180):
+ if executable.is_file() and _matches_version(str(executable)):
+ return str(executable)
+ output(f"Downloading Bun {BUN_VERSION} ({target})…")
+ url = f"https://github.com/oven-sh/bun/releases/download/bun-v{BUN_VERSION}/bun-{target}.zip"
+ try:
+ with urllib.request.urlopen(url, timeout=60) as response:
+ raw = response.read(128 * 1024 * 1024 + 1)
+ if hashlib.sha256(raw).hexdigest() != _ARCHIVES[target]:
+ raise BunUnavailableError("Bun download failed checksum verification. Retry the download.")
+ with zipfile.ZipFile(io.BytesIO(raw)) as archive:
+ member = archive.getinfo(f"bun-{target}/{executable.name}")
+ if member.file_size > 256 * 1024 * 1024:
+ raise BunUnavailableError("Bun archive contains an oversized executable.")
+ content = archive.read(member)
+ with tempfile.TemporaryDirectory(prefix=".install-", dir=directory) as temporary:
+ candidate = Path(temporary) / executable.name
+ candidate.write_bytes(content)
+ candidate.chmod(0o755)
+ if not _matches_version(str(candidate)):
+ raise BunUnavailableError("Downloaded Bun cannot run on this system.")
+ os.replace(candidate, executable)
+ except (OSError, ValueError, KeyError, zipfile.BadZipFile) as exc:
+ raise BunUnavailableError(f"Could not prepare Bun {BUN_VERSION}: {exc}") from exc
+ return str(executable)
diff --git a/nanobot/bus/queue.py b/nanobot/bus/queue.py
index 8a344a82a..cfe216e1c 100644
--- a/nanobot/bus/queue.py
+++ b/nanobot/bus/queue.py
@@ -11,6 +11,7 @@ from loguru import logger
from nanobot.bus.events import InboundMessage, OutboundMessage
from nanobot.bus.outbound_events import outbound_message_for_event
from nanobot.events import AgentEvent
+from nanobot.runtime_admission import RuntimeAdmission
_EventT = TypeVar("_EventT", bound=AgentEvent)
EventHandler = Callable[[AgentEvent], Awaitable[None] | None]
@@ -28,7 +29,8 @@ class MessageBus:
``publish_event``. Local state transitions never wait for network sends.
"""
- def __init__(self):
+ def __init__(self, *, admission: RuntimeAdmission | None = None):
+ self.admission = admission if admission is not None else RuntimeAdmission()
self.inbound: asyncio.Queue[InboundMessage] = asyncio.Queue()
self.outbound: asyncio.Queue[OutboundMessage] = asyncio.Queue()
self._handlers: list[EventHandler] = []
@@ -37,7 +39,9 @@ class MessageBus:
async def publish_inbound(self, msg: InboundMessage) -> None:
"""Publish a message from a channel to the agent."""
- await self.inbound.put(msg)
+ self.admission.check()
+ # This queue is unbounded. Admission and enqueue must not yield apart.
+ self.inbound.put_nowait(msg)
async def consume_inbound(self) -> InboundMessage:
"""Consume the next inbound message (blocks until available)."""
@@ -81,6 +85,11 @@ class MessageBus:
"""Number of pending outbound messages."""
return self.outbound.qsize()
+ @property
+ def has_pending_events(self) -> bool:
+ """Scheduled local subscribers may still start agent background work."""
+ return bool(self._pending)
+
@overload
def subscribe(
self, handler: Callable[[_EventT], Awaitable[None] | None],
diff --git a/nanobot/channels/base.py b/nanobot/channels/base.py
index a9466c46e..ea4a6dde2 100644
--- a/nanobot/channels/base.py
+++ b/nanobot/channels/base.py
@@ -107,6 +107,16 @@ class BaseChannel(ABC):
"""
pass
+ @property
+ def has_pending_delivery(self) -> bool:
+ """Whether delivery outlives an awaited ``send``/streaming call.
+
+ The manager already accounts for awaited sends and retries. Channels
+ that enqueue their own writes must expose that work here, including
+ transport cleanup, before a gateway can be considered idle.
+ """
+ return False
+
def progress_transport_defaults(self) -> tuple[bool, bool] | None:
"""Return channel-owned defaults for progress and tool-hint messages.
diff --git a/nanobot/channels/connect.py b/nanobot/channels/connect.py
index 92d411e78..96850a593 100644
--- a/nanobot/channels/connect.py
+++ b/nanobot/channels/connect.py
@@ -3,10 +3,32 @@
from __future__ import annotations
from collections.abc import Mapping
+from typing import Any, Protocol, runtime_checkable
QueryParams = Mapping[str, list[str]]
+class ChannelConnector(Protocol):
+ """Channel-owned setup actions called by the settings request owner."""
+
+ async def handle(self, action: str, query: QueryParams) -> dict[str, Any]: ...
+
+
+@runtime_checkable
+class ManagedChannelConnector(ChannelConnector, Protocol):
+ """Setup whose detached work can participate in gateway maintenance.
+
+ The synchronous property must stay true through awaited cleanup. ``close``
+ returns only after owned writers have stopped; failure retains ownership.
+ Settings requests account for their own awaited work separately.
+ """
+
+ @property
+ def has_pending_work(self) -> bool: ...
+
+ async def close(self) -> None: ...
+
+
class ChannelConnectError(Exception):
"""User-facing channel connection failure."""
@@ -21,4 +43,6 @@ def query_first(query: QueryParams, key: str) -> str | None:
return values[0] if values else None
-__all__ = ["ChannelConnectError", "QueryParams", "query_first"]
+__all__ = [
+ "ChannelConnectError", "ChannelConnector", "ManagedChannelConnector", "QueryParams", "query_first",
+]
diff --git a/nanobot/channels/feishu/connect.py b/nanobot/channels/feishu/connect.py
index b41e57fae..14e9fa5df 100644
--- a/nanobot/channels/feishu/connect.py
+++ b/nanobot/channels/feishu/connect.py
@@ -46,6 +46,20 @@ class FeishuConnectStore:
self._sessions: dict[str, FeishuConnectSession] = {}
self._completion_lock = threading.Lock()
+ @property
+ def has_pending_work(self) -> bool:
+ # Registration only advances inside an owned settings request. Expired
+ # QR records have no listener or detached writer to keep alive.
+ now = time.monotonic()
+ return any(session.deadline > now for session in tuple(self._sessions.values()))
+
+ async def close(self) -> None:
+ def clear() -> None:
+ with self._completion_lock:
+ self._sessions.clear()
+
+ await asyncio.to_thread(clear)
+
async def handle(self, action: str, query: QueryParams) -> dict[str, Any]:
"""Handle one generic settings connection action."""
if action == "start":
diff --git a/nanobot/channels/feishu/tests/test_connect.py b/nanobot/channels/feishu/tests/test_connect.py
index 433a8db0b..67f8884f2 100644
--- a/nanobot/channels/feishu/tests/test_connect.py
+++ b/nanobot/channels/feishu/tests/test_connect.py
@@ -11,8 +11,10 @@ from nanobot.channels.feishu.connect import FeishuConnectStore
@pytest.mark.asyncio
+@pytest.mark.parametrize("shutdown", [False, True])
async def test_feishu_cancel_wins_over_inflight_confirmation(
monkeypatch: pytest.MonkeyPatch,
+ shutdown: bool,
) -> None:
poll_started = threading.Event()
release_poll = threading.Event()
@@ -52,15 +54,20 @@ async def test_feishu_cancel_wins_over_inflight_confirmation(
store = FeishuConnectStore()
started = await store.handle("start", {})
+ assert store.has_pending_work is True
query = {"session_id": [started["session_id"]]}
poll_task = asyncio.create_task(store.handle("poll", query))
assert await asyncio.to_thread(poll_started.wait, 5)
- cancelled = await store.handle("cancel", query)
+ if shutdown:
+ await store.close()
+ else:
+ cancelled = await store.handle("cancel", query)
+ assert cancelled["status"] == "cancelled"
release_poll.set()
completed = await poll_task
- assert cancelled["status"] == "cancelled"
+ assert store.has_pending_work is False
assert completed["status"] == "cancelled"
assert saved_results == []
diff --git a/nanobot/channels/linear/connect.py b/nanobot/channels/linear/connect.py
index ced9e8713..d69c3a39d 100644
--- a/nanobot/channels/linear/connect.py
+++ b/nanobot/channels/linear/connect.py
@@ -28,9 +28,10 @@ class LinearConnectSession:
flow: LinearOAuthFlow
config: LinearConfig
state: LinearStateStore
- server: LinearServerLease
+ server: LinearServerLease | None
completion_lock: asyncio.Lock = field(default_factory=asyncio.Lock, repr=False)
result: dict[str, Any] | None = None
+ expiry_task: asyncio.Task[None] | None = None
class LinearConnectStore:
@@ -39,6 +40,16 @@ class LinearConnectStore:
def __init__(self) -> None:
self._sessions: dict[str, LinearConnectSession] = {}
+ @property
+ def has_pending_work(self) -> bool:
+ # A deadline alone does not close the callback/webhook listener. Cached
+ # success, however, is retained only after releasing that listener.
+ return any(session.server is not None for session in self._sessions.values())
+
+ async def close(self) -> None:
+ for session_id in tuple(self._sessions):
+ await self.cancel(session_id)
+
async def handle(self, action: str, query: QueryParams) -> dict[str, Any]:
await self._cleanup()
if action == "start":
@@ -103,12 +114,19 @@ class LinearConnectStore:
f"Unable to start the Linear callback listener on {config.host}:{config.port}: {exc}",
status=502,
) from exc
- self._sessions[flow.session_id] = LinearConnectSession(
+ session = LinearConnectSession(
flow=flow,
config=config,
state=state,
server=lease,
)
+ self._sessions[flow.session_id] = session
+ session.expiry_task = asyncio.create_task(
+ self._expire_session(session), name=f"linear-connect-expire-{flow.session_id}",
+ )
+ session.expiry_task.add_done_callback(
+ lambda task: task.exception() if not task.cancelled() else None,
+ )
return {
"session_id": flow.session_id,
"status": "pending",
@@ -129,6 +147,7 @@ class LinearConnectStore:
if self._sessions.get(session_id) is not session:
return _terminal(session_id, "cancelled", "Linear authorization cancelled.")
if session.result is not None:
+ await self._release_listener(session)
return dict(session.result)
flow = session.flow
if time.monotonic() >= flow.deadline:
@@ -169,8 +188,7 @@ class LinearConnectStore:
}
# A browser may miss the first successful poll while switching tabs.
# Retain its result until the session expires, but release the callback listener.
- OAUTH_FLOWS.remove(flow)
- await asyncio.to_thread(session.server.close)
+ await self._release_listener(session)
return dict(session.result)
async def cancel(self, session_id: str) -> dict[str, Any]:
@@ -291,11 +309,26 @@ class LinearConnectStore:
await self.cancel(session_id)
async def _close_session(self, session_id: str) -> None:
- session = self._sessions.pop(session_id, None)
+ session = self._sessions.get(session_id)
if session is None:
return
+ expiry_task = session.expiry_task
+ if expiry_task is not None and expiry_task is not asyncio.current_task():
+ expiry_task.cancel()
+ await asyncio.gather(expiry_task, return_exceptions=True)
+ await self._release_listener(session)
+ self._sessions.pop(session_id, None)
+
+ async def _expire_session(self, session: LinearConnectSession) -> None:
+ await asyncio.sleep(max(0, session.flow.deadline - time.monotonic()))
+ await self.cancel(session.flow.session_id)
+
+ @staticmethod
+ async def _release_listener(session: LinearConnectSession) -> None:
OAUTH_FLOWS.remove(session.flow)
- await asyncio.to_thread(session.server.close)
+ if session.server is not None:
+ await asyncio.to_thread(session.server.close)
+ session.server = None
def _load_linear_config() -> LinearConfig:
diff --git a/nanobot/channels/linear/server.py b/nanobot/channels/linear/server.py
index 1d0992627..4415d27f0 100644
--- a/nanobot/channels/linear/server.py
+++ b/nanobot/channels/linear/server.py
@@ -37,7 +37,8 @@ class LinearWebhookError(ValueError):
class _ReusableThreadingHTTPServer(ThreadingHTTPServer):
allow_reuse_address = True
- daemon_threads = True
+ # server_close() must join request writers, not only stop accepting sockets.
+ daemon_threads = False
class SharedLinearHttpServer:
@@ -65,6 +66,10 @@ class SharedLinearHttpServer:
class Handler(BaseHTTPRequestHandler):
protocol_version = "HTTP/1.1"
+ def setup(self) -> None:
+ super().setup()
+ self.connection.settimeout(5)
+
def do_GET(self) -> None: # noqa: N802
parsed = urlparse(self.path)
if parsed.path == owner.config.oauth_callback_path:
@@ -99,6 +104,7 @@ class SharedLinearHttpServer:
self.send_response(status.value)
self.send_header("Content-Type", content_type)
self.send_header("Content-Length", str(len(body)))
+ self.send_header("Connection", "close")
self.send_header("Cache-Control", "no-store")
self.send_header("X-Content-Type-Options", "nosniff")
self.end_headers()
@@ -124,7 +130,7 @@ class SharedLinearHttpServer:
self._server.server_close()
self._server = None
if self._thread is not None and self._thread.is_alive():
- self._thread.join(timeout=2)
+ self._thread.join()
self._thread = None
def _handle_oauth_callback(
@@ -192,10 +198,11 @@ class LinearServerLease:
self._closed = False
def close(self) -> None:
- if self._closed:
- return
- self._closed = True
- _release_server(self._server)
+ with _SERVER_GUARD:
+ if self._closed:
+ return
+ _release_server(self._server)
+ self._closed = True
_SERVER_GUARD = threading.RLock()
@@ -222,10 +229,10 @@ def _release_server(server: SharedLinearHttpServer) -> None:
with _SERVER_GUARD:
if _shared_server is not server:
return
- server._references -= 1 # pyright: ignore[reportPrivateUsage]
- if server._references <= 0: # pyright: ignore[reportPrivateUsage]
+ if server._references == 1: # pyright: ignore[reportPrivateUsage]
server.close()
_shared_server = None
+ server._references -= 1 # pyright: ignore[reportPrivateUsage]
def _handler_response(
@@ -237,6 +244,7 @@ def _handler_response(
handler.send_response(status.value)
handler.send_header("Content-Type", content_type)
handler.send_header("Content-Length", str(len(body)))
+ handler.send_header("Connection", "close")
handler.send_header("Cache-Control", "no-store")
handler.send_header("X-Content-Type-Options", "nosniff")
handler.end_headers()
diff --git a/nanobot/channels/linear/tests/test_linear.py b/nanobot/channels/linear/tests/test_linear.py
index c4f3a6cc8..7b3160f63 100644
--- a/nanobot/channels/linear/tests/test_linear.py
+++ b/nanobot/channels/linear/tests/test_linear.py
@@ -6,6 +6,7 @@ import hmac
import http.client
import json
import socket
+import threading
import time
from dataclasses import replace
from datetime import datetime, timezone
@@ -287,12 +288,14 @@ def test_oauth_callback_does_not_report_cancelled_authorization_as_connected(
lease.close()
-@pytest.mark.parametrize("concurrent", [False, True])
+@pytest.mark.parametrize("concurrent, close_fails_once", [(False, False), (True, False), (False, True)])
async def test_successful_authorization_survives_repeated_polls(
- tmp_path: Path, monkeypatch: pytest.MonkeyPatch, concurrent: bool,
+ tmp_path: Path, monkeypatch: pytest.MonkeyPatch, concurrent: bool, close_fails_once: bool,
) -> None:
state = LinearStateStore(tmp_path / "linear.sqlite3")
lease = Mock(spec=LinearServerLease)
+ if close_fails_once:
+ lease.close.side_effect = [RuntimeError("listener close failed"), None]
async def exchange_code(_code: str, _verifier: str) -> LinearInstallation:
await asyncio.sleep(0)
@@ -310,11 +313,16 @@ async def test_successful_authorization_survives_repeated_polls(
store = linear_connect.LinearConnectStore()
started_at = time.monotonic()
started = await store.handle("start", {})
+ assert store.has_pending_work is True
session_id = started["session_id"]
query = {"session_id": [session_id]}
oauth_state = parse_qs(urlparse(started["authorization_url"]).query)["state"][0]
try:
assert OAUTH_FLOWS.complete(oauth_state, code="authorization-code", error=None)
+ if close_fails_once:
+ with pytest.raises(RuntimeError, match="listener close failed"):
+ await store.handle("poll", query)
+ assert store.has_pending_work is True
if concurrent:
first, repeated = await asyncio.gather(
store.handle("poll", query), store.handle("poll", query),
@@ -323,11 +331,12 @@ async def test_successful_authorization_survives_repeated_polls(
first = await store.handle("poll", query)
repeated = await store.handle("poll", query)
assert first["status"] == "succeeded"
+ assert store.has_pending_work is False
assert repeated == first
assert (await store.handle("poll", query)) == first
assert state.has_installations("client-id")
client.exchange_code.assert_awaited_once()
- lease.close.assert_called_once()
+ assert lease.close.call_count == (2 if close_fails_once else 1)
assert (await store.handle("poll", {"session_id": ["unknown"]}))["status"] == "expired"
monkeypatch.setattr(
@@ -340,6 +349,73 @@ async def test_successful_authorization_survives_repeated_polls(
await store.cancel(session_id)
+@pytest.mark.asyncio
+async def test_connect_shutdown_joins_real_webhook_writer(tmp_path, monkeypatch) -> None:
+ port = _free_port()
+ state = LinearStateStore(tmp_path / "linear.sqlite3")
+ write_entered, allow_write, listener_stopped = threading.Event(), threading.Event(), threading.Event()
+ enqueue = state.enqueue_webhook
+ monkeypatch.setattr(linear_connect, "_load_linear_config", lambda: _config(port))
+ monkeypatch.setattr(linear_connect, "LinearStateStore", lambda: state)
+
+ def enqueue_after_release(delivery, payload):
+ write_entered.set()
+ assert allow_write.wait(3)
+ return enqueue(delivery, payload)
+
+ monkeypatch.setattr(state, "enqueue_webhook", enqueue_after_release)
+ store = linear_connect.LinearConnectStore()
+ started = await store.start()
+ lease = store._sessions[started["session_id"]].server
+ server = lease._server._server
+ shutdown_listener = server.shutdown
+
+ def shutdown_and_signal():
+ shutdown_listener()
+ listener_stopped.set()
+
+ monkeypatch.setattr(server, "shutdown", shutdown_and_signal)
+ request = asyncio.create_task(asyncio.to_thread(_post_webhook, port, _agent_webhook()))
+ closing = None
+ try:
+ assert await asyncio.to_thread(write_entered.wait, 1)
+ closing = asyncio.create_task(store.close())
+ assert await asyncio.to_thread(listener_stopped.wait, 1)
+ assert not closing.done()
+ assert store.has_pending_work is True
+ finally:
+ allow_write.set()
+ response = await request
+ if closing is not None:
+ await closing
+ else:
+ await store.close()
+ assert response[0] == 200
+ assert store.has_pending_work is False
+ assert not store._sessions
+
+
+@pytest.mark.asyncio
+async def test_abandoned_authorization_releases_listener_without_poll(tmp_path, monkeypatch) -> None:
+ state = LinearStateStore(tmp_path / "linear.sqlite3")
+ lease = Mock(spec=LinearServerLease)
+ monkeypatch.setattr(linear_connect, "_load_linear_config", _config)
+ monkeypatch.setattr(linear_connect, "LinearStateStore", lambda: state)
+ monkeypatch.setattr(linear_connect, "acquire_http_server", lambda *_args: lease)
+ monkeypatch.setattr("nanobot.channels.linear.oauth.FLOW_TTL_SECONDS", 0.02)
+ store = linear_connect.LinearConnectStore()
+ started = await store.start()
+ task = store._sessions[started["session_id"]].expiry_task
+ assert task is not None
+ try:
+ await asyncio.wait_for(asyncio.shield(task), timeout=1)
+ assert store.has_pending_work is False
+ assert not store._sessions
+ lease.close.assert_called_once()
+ finally:
+ await store.close()
+
+
@pytest.mark.asyncio
async def test_connect_store_lists_and_disconnects_workspaces(
tmp_path: Path,
diff --git a/nanobot/channels/linear/tests/webui/LinearPanel.test.tsx b/nanobot/channels/linear/tests/webui/LinearPanel.test.tsx
index a8e0b5dbc..02be7a010 100644
--- a/nanobot/channels/linear/tests/webui/LinearPanel.test.tsx
+++ b/nanobot/channels/linear/tests/webui/LinearPanel.test.tsx
@@ -787,7 +787,7 @@ describe("Linear channel UI", () => {
fireEvent.click(await screen.findByRole("menuitem", { name: "Remove workspace" }));
const confirm = await screen.findByRole("alertdialog", { name: "Remove nanobot?" });
fireEvent.click(within(confirm).getByRole("button", { name: "Remove workspace" }));
- expect(await screen.findByRole("button", { name: "Connect Linear" })).toBeEnabled();
+ await waitFor(() => expect(screen.getByRole("button", { name: "Connect Linear" })).toBeEnabled());
expect(screen.queryByText("Linear authorization cancelled.")).not.toBeInTheDocument();
expect(screen.queryByRole("link", { name: "Continue in Linear" })).not.toBeInTheDocument();
});
diff --git a/nanobot/channels/manager.py b/nanobot/channels/manager.py
index 1f21b7d5b..6700f69cb 100644
--- a/nanobot/channels/manager.py
+++ b/nanobot/channels/manager.py
@@ -152,8 +152,11 @@ class ChannelManager:
self._channel_errors: dict[str, str] = {}
self._channel_tasks: dict[str, asyncio.Task[None]] = {}
self._dispatch_task: asyncio.Task[None] | None = None
+ self._restart_notice_task: asyncio.Task[None] | None = None
self._outbound_tasks: dict[asyncio.Task[None], tuple[str, str]] = {}
self._outbound_tails: dict[tuple[str, str], asyncio.Task[None]] = {}
+ self._outbound_pending: list[OutboundMessage] = []
+ self._outbound_dispatching = False
self._outbound_slots = asyncio.Semaphore(_OUTBOUND_PENDING_LIMIT)
self._outbound_sends = asyncio.Semaphore(_OUTBOUND_CONCURRENCY)
self._stopping_channels: set[str] = set()
@@ -161,9 +164,12 @@ class ChannelManager:
self._origin_reply_fingerprints: OrderedDict[tuple[str, str, str], str] = OrderedDict()
self._outbox = DeliveryOutbox(self._config_path.parent / "delivery" / "outbox.sqlite3")
self._scheduled_deliveries: set[str] = set()
- self.bus.outbound_recorder = self._outbox.record
+ self.bus.outbound_recorder = self._record_scheduled
self._init_channels()
+ self._remove_delivery_check: Callable[[], None] | None = (
+ self.bus.admission.register_pending_work(lambda: self.has_pending_delivery)
+ )
def _channel_section(
self,
@@ -404,6 +410,8 @@ class ChannelManager:
errors = self._channel_errors = {}
errors.pop(name, None)
try:
+ if name != "websocket":
+ await self.bus.admission.wait_until_open()
await channel.start()
except asyncio.CancelledError:
raise
@@ -624,6 +632,10 @@ class ChannelManager:
async def start_all(self) -> None:
"""Start all channels and the outbound dispatcher."""
+ if self._remove_delivery_check is None:
+ self._remove_delivery_check = self.bus.admission.register_pending_work(
+ lambda: self.has_pending_delivery,
+ )
if not self.channels:
logger.warning("No channels enabled")
return
@@ -647,7 +659,8 @@ class ChannelManager:
notice = consume_restart_notice_from_env()
if not notice:
return None
- return asyncio.create_task(self._send_restart_notice_when_started(notice))
+ self._restart_notice_task = asyncio.create_task(self._send_restart_notice_when_started(notice))
+ return self._restart_notice_task
async def _send_restart_notice_when_started(
self,
@@ -657,6 +670,7 @@ class ChannelManager:
poll_s: float = _RESTART_NOTICE_START_POLL_S,
) -> None:
"""Deliver a restart notice after the target channel starts."""
+ await self.bus.admission.wait_until_open()
loop = asyncio.get_running_loop()
deadline = loop.time() + timeout_s
target = self.channels.get(notice.channel)
@@ -703,9 +717,18 @@ class ChannelManager:
with suppress(asyncio.CancelledError):
await self._dispatch_task
+ if self._restart_notice_task:
+ self._restart_notice_task.cancel()
+ with suppress(asyncio.CancelledError):
+ await self._restart_notice_task
+ self._restart_notice_task = None
+
# Stop all channels
for name in list(self.channels):
await self._stop_channel(name)
+ if self._remove_delivery_check is not None:
+ self._remove_delivery_check()
+ self._remove_delivery_check = None
@staticmethod
def _fingerprint_content(content: str) -> str:
@@ -745,6 +768,25 @@ class ChannelManager:
return False
+ def _record_scheduled(self, msg: OutboundMessage) -> None:
+ if msg.delivery is not None:
+ with self.bus.admission.activity():
+ self._outbox.record(msg)
+
+ @property
+ def has_pending_delivery(self) -> bool:
+ """A synchronous idle check, including channel-owned transport queues.
+
+ Read on the gateway event loop immediately before closing admission.
+ This is delivery liveness, not proof that every channel writer stopped.
+ """
+ return bool(
+ self.bus.outbound_size or self._outbound_pending or self._outbound_dispatching
+ or self._outbound_tasks
+ or (self._restart_notice_task is not None and not self._restart_notice_task.done())
+ or any(channel.has_pending_delivery for channel in self.channels.values())
+ )
+
async def _cancel_outbound(self, channel: str | None = None) -> None:
tasks = [task for task, key in self._outbound_tasks.items()
if channel is None or key[0] == channel]
@@ -839,15 +881,17 @@ class ChannelManager:
self._outbox.finish(msg, "sent")
async def _recover_scheduled(self) -> None:
- for msg in self._outbox.ready():
- channel = self.channels.get(msg.channel)
- if channel is None:
- self._outbox.finish(msg, "failed", "channel_disabled")
- else:
- await self._queue_outbound(channel, msg)
+ with self.bus.admission.activity():
+ for msg in self._outbox.ready():
+ channel = self.channels.get(msg.channel)
+ if channel is None:
+ self._outbox.finish(msg, "failed", "channel_disabled")
+ else:
+ await self._queue_outbound(channel, msg)
async def _dispatch_outbound(self) -> None:
try:
+ await self.bus.admission.wait_until_open()
await self._dispatch_outbound_loop()
finally:
await self._cancel_outbound()
@@ -858,11 +902,12 @@ class ChannelManager:
# Buffer for messages that couldn't be processed during delta coalescing
# (since asyncio.Queue doesn't support push_front)
- pending: list[OutboundMessage] = []
+ pending = self._outbound_pending
next_recovery = 0.0
while True:
try:
+ await self.bus.admission.wait_until_open()
if time.monotonic() >= next_recovery:
next_recovery = time.monotonic() + RETRY_SECONDS
try:
@@ -873,10 +918,15 @@ class ChannelManager:
if pending:
msg = pending.pop(0)
else:
- msg = await asyncio.wait_for(
- self.bus.consume_outbound(),
- timeout=1.0
- )
+ # wait_for creates a child task: it can remove the last
+ # queued message before this dispatcher records ownership.
+ # Keep dequeue and the busy claim in the same task.
+ async with asyncio.timeout(1.0):
+ msg = await self.bus.consume_outbound()
+ self._outbound_dispatching = True
+ # Intake can close while an empty queue is awaited. Retain the
+ # message, but do not start another transport write while paused.
+ await self.bus.admission.wait_until_open()
event = msg.event
progress_event = event if isinstance(event, ProgressEvent) else None
@@ -945,6 +995,8 @@ class ChannelManager:
continue
except asyncio.CancelledError:
break
+ finally:
+ self._outbound_dispatching = False
@staticmethod
async def _send_reasoning_delta(
diff --git a/nanobot/channels/plugin.py b/nanobot/channels/plugin.py
index 3bdd8d49a..bd3b5f51b 100644
--- a/nanobot/channels/plugin.py
+++ b/nanobot/channels/plugin.py
@@ -11,6 +11,7 @@ from typing import TYPE_CHECKING, Any, cast
from packaging.requirements import InvalidRequirement, Requirement
+from nanobot.channels.connect import ChannelConnector
from nanobot.channels.contracts import ChannelManagementSpec, ChannelSetupSpec
if TYPE_CHECKING:
@@ -93,7 +94,7 @@ class ChannelPlugin:
)
return channel_cls
- def load_connector(self) -> Any:
+ def load_connector(self) -> ChannelConnector:
"""Construct the optional channel-owned interactive connector."""
if self.connector is None:
raise ImportError(f"Channel plugin '{self.name}' does not provide a connector")
@@ -110,7 +111,9 @@ class ChannelPlugin:
f"Channel plugin '{self.name}' connector '{self.connector}' "
"does not provide handle()"
)
- return connector
+ # Dynamic plugin edge: handle() is the established connector contract.
+ # Lifecycle support is optional and checked by its maintenance owner.
+ return cast(ChannelConnector, connector)
def _target_parts(target: str, *, label: str) -> tuple[str, str]:
diff --git a/nanobot/channels/qq/connect.py b/nanobot/channels/qq/connect.py
index ffd97ab38..b9bd81c76 100644
--- a/nanobot/channels/qq/connect.py
+++ b/nanobot/channels/qq/connect.py
@@ -93,6 +93,19 @@ class QQConnectStore:
def __init__(self) -> None:
self._sessions: dict[str, QQConnectSession] = {}
+ self._commits: dict[str, asyncio.Task[None]] = {}
+ self._closed = False
+
+ @property
+ def has_pending_work(self) -> bool:
+ now = time.monotonic()
+ return bool(self._commits) or any(session.deadline > now for session in self._sessions.values())
+
+ async def close(self) -> None:
+ self._closed = True
+ self._sessions.clear()
+ if self._commits:
+ await asyncio.shield(asyncio.gather(*self._commits.values(), return_exceptions=True))
async def handle(self, action: str, query: QueryParams) -> dict[str, Any]:
if action == "start":
@@ -134,6 +147,10 @@ class QQConnectStore:
# A transient portal error is not proof the scan failed; keep waiting.
return _pending(session, "Waiting for QQ scan...")
+ self._cleanup()
+ if self._sessions.get(session_id) is not session:
+ return _payload(session_id, "expired", "This QQ login has expired. Start again.")
+
status = result.get("status")
if status == 3:
self._sessions.pop(session_id, None)
@@ -151,7 +168,13 @@ class QQConnectStore:
if not app_id or not secret:
return _payload(session_id, "failed", "QQ confirmed the scan but returned no credentials.")
- await asyncio.to_thread(save_credentials, app_id, secret)
+ # Cancelling the awaiting request cannot stop a file-writing thread.
+ # Retain ownership until the writer finishes, including during shutdown.
+ commit = asyncio.create_task(asyncio.to_thread(save_credentials, app_id, secret))
+ self._commits[session_id] = commit
+ commit.add_done_callback(lambda task: self._commits.pop(session_id, None))
+ commit.add_done_callback(lambda task: task.exception() if not task.cancelled() else None)
+ await asyncio.shield(commit)
session.credentials = (app_id, secret)
return {
"session_id": session_id,
@@ -161,6 +184,8 @@ class QQConnectStore:
async def cancel(self, session_id: str) -> dict[str, Any]:
self._sessions.pop(session_id, None)
+ if commit := self._commits.get(session_id):
+ await asyncio.shield(asyncio.gather(commit, return_exceptions=True))
return _payload(session_id, "cancelled", "QQ login cancelled.")
async def login(self) -> tuple[str, str] | None:
@@ -181,6 +206,8 @@ class QQConnectStore:
self._sessions.pop(session.id, None)
def _new_session(self, task_id: str, key: str) -> QQConnectSession:
+ if self._closed:
+ raise ChannelConnectError("QQ connection store is closed", status=409)
session = QQConnectSession(
id=secrets.token_urlsafe(18),
task_id=task_id,
diff --git a/nanobot/channels/qq/tests/test_connect.py b/nanobot/channels/qq/tests/test_connect.py
index dfa0088fa..8e2133a17 100644
--- a/nanobot/channels/qq/tests/test_connect.py
+++ b/nanobot/channels/qq/tests/test_connect.py
@@ -48,9 +48,11 @@ async def test_qq_connect_writes_scanned_credentials_to_config(monkeypatch: pyte
started = await store.start()
assert started["status"] == "pending"
assert started["qr_url"].endswith("task_id=task-1&_wv=2")
+ assert store.has_pending_work
polled = await store.poll(started["session_id"])
assert polled["status"] == "succeeded"
+ assert not store.has_pending_work
assert await store.poll(started["session_id"]) == {
"session_id": started["session_id"],
"status": "expired",
@@ -64,6 +66,117 @@ async def test_qq_connect_writes_scanned_credentials_to_config(monkeypatch: pyte
assert qq["allowFrom"] == ["42"]
+@pytest.mark.asyncio
+@pytest.mark.parametrize("stop", ["cancel", "close", "expire"])
+async def test_qq_late_portal_result_cannot_save_after_session_ends(
+ monkeypatch: pytest.MonkeyPatch, _isolated_config: Path, stop: str,
+):
+ key = base64.b64encode(b"k" * 32).decode()
+ polling = asyncio.Event()
+ release = asyncio.Event()
+
+ async def fake_poll(_task_id: str) -> dict[str, Any]:
+ polling.set()
+ await release.wait()
+ return {"status": 2, "bot_appid": "1024", "bot_encrypt_secret": _encrypt("new", key)}
+
+ monkeypatch.setattr(connect, "poll_bind_task", fake_poll)
+ store = QQConnectStore()
+ session = store._new_session("task", key)
+ before = _isolated_config.read_bytes()
+ poll = asyncio.create_task(store.poll(session.id))
+ try:
+ await asyncio.wait_for(polling.wait(), timeout=5)
+ if stop == "cancel":
+ await store.cancel(session.id)
+ elif stop == "close":
+ await store.close()
+ else:
+ session.deadline = 0
+ assert not store.has_pending_work
+ finally:
+ release.set()
+ assert (await poll)["status"] == "expired"
+ assert _isolated_config.read_bytes() == before
+
+
+@pytest.mark.asyncio
+@pytest.mark.parametrize("stop", ["cancel", "close"])
+async def test_qq_cleanup_waits_for_writer_after_poll_request_is_cancelled(
+ monkeypatch: pytest.MonkeyPatch, _isolated_config: Path, stop: str,
+):
+ from nanobot.runtime_admission import RuntimeAdmission, RuntimeBusyError
+
+ key = base64.b64encode(b"k" * 32).decode()
+ saving = threading.Event()
+ release = threading.Event()
+ original_save = connect.save_credentials
+
+ async def fake_poll(_task_id: str) -> dict[str, Any]:
+ return {"status": 2, "bot_appid": "1024", "bot_encrypt_secret": _encrypt("new", key)}
+
+ def slow_save(app_id: str, secret: str) -> None:
+ saving.set()
+ if not release.wait(timeout=5):
+ raise TimeoutError("credential writer was not released")
+ original_save(app_id, secret)
+
+ monkeypatch.setattr(connect, "poll_bind_task", fake_poll)
+ monkeypatch.setattr(connect, "save_credentials", slow_save)
+ store = QQConnectStore()
+ admission = RuntimeAdmission()
+ admission.register_pending_work(lambda: store.has_pending_work)
+ session = store._new_session("task", key)
+ poll = asyncio.create_task(store.poll(session.id))
+ cleanup: asyncio.Task[None | dict[str, Any]] | None = None
+ try:
+ assert await asyncio.to_thread(saving.wait, 5)
+ poll.cancel()
+ with pytest.raises(asyncio.CancelledError):
+ await poll
+ session.deadline = 0
+ cleanup = asyncio.create_task(store.close() if stop == "close" else store.cancel(session.id))
+ await asyncio.sleep(0)
+ assert not cleanup.done()
+ assert store.has_pending_work
+ with pytest.raises(RuntimeBusyError), admission.pause_if_idle(lambda: False):
+ pytest.fail("an active credential writer must block an update")
+ finally:
+ release.set()
+ await asyncio.gather(poll, return_exceptions=True)
+ if cleanup is not None:
+ await cleanup
+ await store.close()
+ assert not store.has_pending_work
+ with admission.pause_if_idle(lambda: False):
+ assert admission.paused
+ saved = json.loads(_isolated_config.read_text(encoding="utf-8"))["channels"]["qq"]
+ assert (saved["appId"], saved["secret"], saved["allowFrom"]) == ("1024", "new", ["42"])
+
+
+@pytest.mark.asyncio
+async def test_qq_close_during_start_does_not_leave_a_new_session(monkeypatch: pytest.MonkeyPatch):
+ creating = asyncio.Event()
+ release = asyncio.Event()
+
+ async def fake_create() -> tuple[str, str]:
+ creating.set()
+ await release.wait()
+ return "late-task", base64.b64encode(b"k" * 32).decode()
+
+ monkeypatch.setattr(connect, "create_bind_task", fake_create)
+ store = QQConnectStore()
+ start = asyncio.create_task(store.start())
+ try:
+ await asyncio.wait_for(creating.wait(), timeout=5)
+ await store.close()
+ finally:
+ release.set()
+ with pytest.raises(connect.ChannelConnectError, match="closed"):
+ await start
+ assert not store.has_pending_work
+
+
@pytest.mark.asyncio
async def test_qq_connect_keeps_waiting_on_transient_portal_errors(monkeypatch: pytest.MonkeyPatch):
async def fake_create() -> tuple[str, str]:
diff --git a/nanobot/channels/websocket/runtime.py b/nanobot/channels/websocket/runtime.py
index 1e681a5f6..e4c4f0301 100644
--- a/nanobot/channels/websocket/runtime.py
+++ b/nanobot/channels/websocket/runtime.py
@@ -29,6 +29,7 @@ from nanobot.bus.queue import MessageBus
from nanobot.channels.base import BaseChannel
from nanobot.channels.websocket.binary_http import BinaryHTTPBridge
from nanobot.config_base import Base
+from nanobot.runtime_admission import RuntimeMaintenanceError
from nanobot.session.webui_turns import (
clear_websocket_turn_if_current,
mark_websocket_turn_transcript_persistence_failed,
@@ -705,6 +706,15 @@ class WebSocketChannel(BaseChannel):
async def handler(connection: ServerConnection) -> None:
await self._connection_loop(connection)
+ from aiohttp import web
+
+ async def handle_binary(request: web.BaseRequest) -> web.StreamResponse:
+ try:
+ with self.bus.admission.activity():
+ return await self._uploads.handle(request)
+ except RuntimeMaintenanceError:
+ return web.json_response({"error": "Gateway update is being verified"}, status=503)
+
async def prune_uploads() -> None:
while not stop_event.is_set():
self._uploads.store.prune()
@@ -720,7 +730,7 @@ class WebSocketChannel(BaseChannel):
failures = 0
while not stop_event.is_set():
server: Server | None = None
- bridge = BinaryHTTPBridge(self._uploads.handle)
+ bridge = BinaryHTTPBridge(handle_binary)
was_serving = False
started_at = 0.0
try:
@@ -969,6 +979,16 @@ class WebSocketChannel(BaseChannel):
name=f"websocket-outbound-{id(connection):x}",
)
+ @property
+ def has_pending_delivery(self) -> bool:
+ # send() only enqueues a frame. buffered_bytes includes the frame that
+ # a writer has removed from its queue but has not finished transmitting.
+ return bool(self._outbound_retire_tasks) or any(
+ state.buffered_bytes or not state.queue.empty()
+ or (state.writer is not None and not state.writer.done())
+ for state in self._connection_outbound.values()
+ )
+
async def _drain_connection_outbound(
self,
connection: ServerConnection,
diff --git a/nanobot/channels/websocket/tests/test_attachment_ingress.py b/nanobot/channels/websocket/tests/test_attachment_ingress.py
index d25c19d93..d523d2bd1 100644
--- a/nanobot/channels/websocket/tests/test_attachment_ingress.py
+++ b/nanobot/channels/websocket/tests/test_attachment_ingress.py
@@ -1,6 +1,7 @@
"""Production listener regressions for HTTP upload + small WS references."""
import asyncio
import json
+import threading
from pathlib import Path
import aiohttp
@@ -9,6 +10,8 @@ from websockets.asyncio.client import connect
from nanobot.bus.queue import MessageBus
from nanobot.channels.websocket.runtime import WebSocketChannel, WebSocketConfig
+from nanobot.config.loader import load_config
+from nanobot.runtime_admission import RuntimeBusyError
from nanobot.session.manager import SessionManager
from nanobot.webui.gateway_services import build_gateway_services
@@ -48,6 +51,134 @@ async def event(ws, name):
return payload
+@pytest.mark.parametrize("finish", [True, False], ids=["complete", "disconnect"])
+async def test_streaming_upload_blocks_maintenance_until_written_or_cleaned(gateway, finish):
+ channel, bus, http_url, ws_url = gateway
+ port = int(http_url.rsplit(":", 1)[1])
+ store = channel.gateway.uploads.store
+ async with connect(ws_url) as ws:
+ capability = (await event(ws, "ready"))["upload"]
+ reader, writer = await asyncio.open_connection("127.0.0.1", port)
+ try:
+ writer.write((
+ f"POST {capability['path']} HTTP/1.1\r\nHost: 127.0.0.1:{port}\r\n"
+ f"Authorization: Bearer {capability['token']}\r\n"
+ "Content-Type: image/png\r\nContent-Length: 8\r\n\r\npart"
+ ).encode())
+ await writer.drain()
+ async with asyncio.timeout(3):
+ while store._active == 0:
+ await asyncio.sleep(.01)
+ with pytest.raises(RuntimeBusyError):
+ with bus.admission.pause_if_idle(lambda: False):
+ pytest.fail("Maintenance ignored an in-progress binary write")
+ assert not bus.admission.paused
+ if finish:
+ writer.write(b"done")
+ await writer.drain()
+ response = await asyncio.wait_for(reader.read(), timeout=3)
+ assert response.startswith(b"HTTP/1.1 201"), response
+ else:
+ writer.close()
+ await writer.wait_closed()
+ async with asyncio.timeout(3):
+ while store._active:
+ await asyncio.sleep(.01)
+ with bus.admission.pause_if_idle(lambda: False):
+ assert bus.admission.paused
+ if not finish:
+ assert not tuple(store._journal.iterdir())
+ finally:
+ writer.close()
+ await writer.wait_closed()
+
+
+async def test_threaded_settings_write_stays_busy_after_browser_disconnect(gateway, monkeypatch):
+ channel, bus, _, ws_url = gateway
+ entered, release = threading.Event(), threading.Event()
+ settings = channel.gateway.settings
+ original = settings.config.run_serialized
+
+ def delayed_save(*args, **kwargs):
+ entered.set()
+ assert release.wait(10), "Test did not release the settings writer"
+ return original(*args, **kwargs)
+
+ monkeypatch.setattr(settings.config, "run_serialized", delayed_save)
+
+ def connection_url():
+ token = channel.gateway.tokens.issue_token(300, audience="webui")
+ return ws_url.replace("test-secret", token)
+
+ def request(identifier, value):
+ return json.dumps({"type": "webui_request", "request_id": identifier,
+ "action": "settings.runtime_config.update",
+ "payload": {"values": {"agents.defaults.max_tool_iterations": value}}})
+
+ try:
+ async with connect(connection_url()) as ws:
+ await event(ws, "ready")
+ await ws.send(request("slow-write", 31))
+ assert await asyncio.to_thread(entered.wait, 3)
+ with pytest.raises(RuntimeBusyError):
+ with bus.admission.pause_if_idle(lambda: False):
+ pytest.fail("Maintenance ignored a threaded settings write")
+ # Existing mutation ownership deliberately survives a lost browser;
+ # losing its delivery task must not make the gateway appear idle.
+ with pytest.raises(RuntimeBusyError):
+ with bus.admission.pause_if_idle(lambda: False):
+ pytest.fail("Browser disconnect released an unfinished write")
+ operation = channel._commands.request_operations["slow-write"].task
+ release.set()
+ result = await asyncio.wait_for(asyncio.shield(operation), timeout=5)
+ assert result.status is None, result
+ assert load_config(settings.config.path).agents.defaults.max_tool_iterations == 31
+ async with connect(connection_url()) as ws:
+ await event(ws, "ready")
+ with bus.admission.pause_if_idle(lambda: False):
+ await ws.send(request("blocked-write", 32))
+ rejected = await event(ws, "webui_response")
+ assert rejected["error"]["status"] == 503
+ assert load_config(settings.config.path).agents.defaults.max_tool_iterations == 31
+ await ws.send(request("after-abort", 33))
+ assert (await event(ws, "webui_response"))["ok"] is True
+ assert load_config(settings.config.path).agents.defaults.max_tool_iterations == 33
+ finally:
+ release.set()
+
+
+async def test_http_route_is_busy_until_its_async_work_finishes(gateway, monkeypatch):
+ channel, bus, http_url, _ = gateway
+ entered, release = asyncio.Event(), asyncio.Event()
+ route = channel.gateway.http._dispatch_resolved
+
+ async def delayed_route(*args, **kwargs):
+ entered.set()
+ await release.wait()
+ return await route(*args, **kwargs)
+
+ monkeypatch.setattr(channel.gateway.http, "_dispatch_resolved", delayed_route)
+ async with aiohttp.ClientSession(headers={"Authorization": "Bearer test-secret"}) as http:
+ request = asyncio.create_task(http.get(http_url + "/webui/bootstrap"))
+ try:
+ await asyncio.wait_for(entered.wait(), timeout=3)
+ with pytest.raises(RuntimeBusyError):
+ with bus.admission.pause_if_idle(lambda: False):
+ pytest.fail("Maintenance ignored a running HTTP handler")
+ release.set()
+ async with await asyncio.wait_for(request, timeout=3) as response:
+ assert response.status == 200
+ await response.read()
+ with bus.admission.pause_if_idle(lambda: False):
+ async with http.get(http_url + "/webui/bootstrap") as response:
+ assert response.status == 503
+ async with http.get(http_url + "/webui/bootstrap") as response:
+ assert response.status == 200
+ finally:
+ release.set()
+ await asyncio.gather(request, return_exceptions=True)
+
+
@pytest.mark.parametrize("mime,name", [
("image/png", "image.png"), ("text/csv", "report.csv"), ("video/webm", "clip.webm"),
])
diff --git a/nanobot/channels/websocket/tests/test_websocket_outbound_delivery.py b/nanobot/channels/websocket/tests/test_websocket_outbound_delivery.py
index e2cb206cd..93f64ae19 100644
--- a/nanobot/channels/websocket/tests/test_websocket_outbound_delivery.py
+++ b/nanobot/channels/websocket/tests/test_websocket_outbound_delivery.py
@@ -16,6 +16,7 @@ from nanobot.channels.manager import ChannelManager
from nanobot.channels.websocket import runtime
from nanobot.channels.websocket.runtime import WebSocketChannel, WebSocketConfig
from nanobot.config.schema import Config
+from nanobot.runtime_admission import RuntimeBusyError
from nanobot.webui.gateway_services import build_gateway_services
@@ -64,7 +65,7 @@ class _RecordingConnection:
def _channel() -> WebSocketChannel:
- bus = MagicMock(spec=MessageBus)
+ bus = MessageBus()
config = WebSocketConfig(
enabled=True,
allow_from=["*"],
@@ -129,9 +130,24 @@ async def test_message_bus_delivers_to_ten_tuis_with_one_blocked_connection() ->
assert await _next_text(connection) == "first"
assert await _next_text(connection) == "last"
assert connections[0].sent.empty()
+ async with asyncio.timeout(2):
+ while manager._outbound_tasks or bus.outbound_size:
+ await asyncio.sleep(0)
+ # The manager's send has finished; the physical transport still owns
+ # its final frames. A shutdown idle check must include that second queue.
+ assert channel.has_pending_delivery
+ with pytest.raises(RuntimeBusyError):
+ with bus.admission.pause_if_idle(lambda: False):
+ pytest.fail("The blocked WebSocket transport was missed")
+ assert not bus.admission.paused
connections[0].release_send.set()
assert await _next_text(connections[0]) == "first"
assert await _next_text(connections[0]) == "last"
+ async with asyncio.timeout(2):
+ while manager.has_pending_delivery:
+ await asyncio.sleep(0)
+ with bus.admission.pause_if_idle(lambda: False):
+ assert bus.admission.paused
finally:
dispatcher.cancel()
await asyncio.gather(dispatcher, return_exceptions=True)
@@ -142,6 +158,26 @@ async def test_message_bus_delivers_to_ten_tuis_with_one_blocked_connection() ->
assert not channel._connection_outbound
+@pytest.mark.asyncio
+async def test_delivery_remains_busy_until_timed_out_transport_is_retired(monkeypatch) -> None:
+ monkeypatch.setattr(runtime, "_OUTBOUND_SEND_TIMEOUT_S", 0.02)
+ channel = _channel()
+ connection = _RecordingConnection(block_first_send=True, block_close=True)
+ channel._attach(cast(Any, connection), "chat-retiring")
+ try:
+ await channel.send(_message("chat-retiring", "reply"))
+ await asyncio.wait_for(connection.closed.wait(), 2)
+ assert connection.send_cancelled.is_set()
+ assert channel.has_pending_delivery
+ connection.release_close.set()
+ await asyncio.wait_for(_wait_for_retire_tasks(channel), 2)
+ assert not channel.has_pending_delivery
+ finally:
+ connection.release_send.set()
+ connection.release_close.set()
+ await channel._cleanup_connection(cast(Any, connection))
+
+
@pytest.mark.asyncio
async def test_slow_tui_does_not_block_a_different_topic() -> None:
channel = _channel()
diff --git a/nanobot/channels/weixin/connect.py b/nanobot/channels/weixin/connect.py
index eb9d2e8a8..746d8675d 100644
--- a/nanobot/channels/weixin/connect.py
+++ b/nanobot/channels/weixin/connect.py
@@ -34,6 +34,15 @@ class WeixinConnectStore:
def __init__(self) -> None:
self._sessions: dict[str, WeixinConnectSession] = {}
+ @property
+ def has_pending_work(self) -> bool:
+ # Poll/commit are awaited by the settings request owner, not detached.
+ return any(session.deadline > time.monotonic() for session in self._sessions.values())
+
+ async def close(self) -> None:
+ for session_id in tuple(self._sessions):
+ await self.cancel(session_id)
+
async def handle(self, action: str, query: QueryParams) -> dict[str, Any]:
"""Handle one generic settings connection action."""
if action == "start":
diff --git a/nanobot/channels/weixin/tests/test_connect.py b/nanobot/channels/weixin/tests/test_connect.py
index aec484780..05d410268 100644
--- a/nanobot/channels/weixin/tests/test_connect.py
+++ b/nanobot/channels/weixin/tests/test_connect.py
@@ -57,10 +57,12 @@ async def test_weixin_connect_store_saves_confirmed_qr_login(
started = await store.start()
assert started["status"] == "pending"
assert started["qr_url"] == "https://qr.example/1"
+ assert store.has_pending_work is True
completed = await store.poll(started["session_id"])
assert completed["status"] == "succeeded"
assert completed["account"] == "wx-user"
+ assert store.has_pending_work is False
saved = json.loads((state_dir / "account.json").read_text())
assert saved["token"] == "wx-token"
@@ -177,9 +179,11 @@ async def test_weixin_reconnect_keeps_existing_account_until_scan_succeeds(
@pytest.mark.asyncio
+@pytest.mark.parametrize("shutdown", [False, True])
async def test_weixin_cancel_wins_over_inflight_confirmation(
tmp_path,
monkeypatch: pytest.MonkeyPatch,
+ shutdown: bool,
) -> None:
state_dir = tmp_path / "weixin-state"
config_path = tmp_path / "config.json"
@@ -214,15 +218,20 @@ async def test_weixin_cancel_wins_over_inflight_confirmation(
store = WeixinConnectStore()
started = await store.handle("start", {})
+ assert store.has_pending_work is True
query = {"session_id": [started["session_id"]]}
poll_task = asyncio.create_task(store.handle("poll", query))
await asyncio.wait_for(poll_started.wait(), timeout=5)
- cancelled = await store.handle("cancel", query)
+ if shutdown:
+ await store.close()
+ else:
+ cancelled = await store.handle("cancel", query)
+ assert cancelled["status"] == "cancelled"
release_poll.set()
completed = await poll_task
- assert cancelled["status"] == "cancelled"
+ assert store.has_pending_work is False
assert completed["status"] == "cancelled"
assert not (state_dir / "account.json").exists()
diff --git a/nanobot/channels/weixin/tests/test_weixin_channel.py b/nanobot/channels/weixin/tests/test_weixin_channel.py
index 85f26a815..bd86a4861 100644
--- a/nanobot/channels/weixin/tests/test_weixin_channel.py
+++ b/nanobot/channels/weixin/tests/test_weixin_channel.py
@@ -799,6 +799,7 @@ async def test_manager_surfaces_actionable_weixin_auth_error_without_traceback(
)
manager = manager_mod.ChannelManager.__new__(manager_mod.ChannelManager)
manager._channel_errors = {}
+ manager.bus = channel.bus
await manager._start_channel("weixin", channel)
diff --git a/nanobot/channels/whatsapp/connect.py b/nanobot/channels/whatsapp/connect.py
index 41eb4de43..0b3768339 100644
--- a/nanobot/channels/whatsapp/connect.py
+++ b/nanobot/channels/whatsapp/connect.py
@@ -21,6 +21,7 @@ if TYPE_CHECKING:
_NATIVE_STOP_TIMEOUT_SECONDS = 10.0
_DATABASE_REPLACE_TIMEOUT_SECONDS = 10.0
_FINALIZE_POLL_WAIT_SECONDS = 0.05
+_CONNECT_TTL_SECONDS = 600
@dataclass(slots=True)
@@ -36,6 +37,9 @@ class WhatsAppConnectSession:
deadline: float
qr_url: str = ""
finalize_task: asyncio.Task[None] | None = None
+ stop_task: asyncio.Task[None] | None = None
+ discard_task: asyncio.Task[None] | None = None
+ expiry_task: asyncio.Task[None] | None = None
class WhatsAppConnectStore:
@@ -44,6 +48,17 @@ class WhatsAppConnectStore:
def __init__(self) -> None:
self._sessions: dict[str, WhatsAppConnectSession] = {}
+ @property
+ def has_pending_work(self) -> bool:
+ """Keep login/native workers owned until completion or confirmed cleanup."""
+ return any(
+ session.finalize_task is None
+ or not session.finalize_task.done()
+ or not self._session_stopped(session)
+ or (session.discard_task is not None and not session.discard_task.done())
+ for session in self._sessions.values()
+ )
+
async def handle(self, action: str, query: QueryParams) -> dict[str, Any]:
if action == "start":
force = (query_first(query, "force") or "").strip().lower() in {
@@ -99,9 +114,13 @@ class WhatsAppConnectStore:
target_path=target_path,
pending_path=pending_path,
created_wall=now_wall,
- deadline=time.monotonic() + 600,
+ deadline=time.monotonic() + _CONNECT_TTL_SECONDS,
)
self._sessions[session_id] = session
+ session.expiry_task = asyncio.create_task(
+ self._expire_session(session), name=f"whatsapp-connect-expire-{session.id}",
+ )
+ session.expiry_task.add_done_callback(self._observe_task)
qr_wait = asyncio.create_task(self._wait_for_qr(session))
try:
@@ -113,6 +132,7 @@ class WhatsAppConnectStore:
finally:
if not qr_wait.done():
qr_wait.cancel()
+ await asyncio.gather(qr_wait, return_exceptions=True)
return self._pending_payload(session)
async def poll(self, session_id: str) -> dict[str, Any]:
@@ -124,6 +144,9 @@ class WhatsAppConnectStore:
"status": "expired",
"message": "This WhatsApp login has expired. Start again.",
}
+ if session.discard_task is not None:
+ # A concurrent poll must not promote a login being cancelled.
+ return await self.cancel(session_id)
if not session.result.done():
return self._pending_payload(session)
@@ -138,21 +161,25 @@ class WhatsAppConnectStore:
# Finish fast clients in this request without letting native shutdown
# block the polling response path.
await asyncio.wait({finalize_task}, timeout=_FINALIZE_POLL_WAIT_SECONDS)
+ if session.discard_task is not None:
+ return await self.cancel(session_id)
if not finalize_task.done():
payload = self._pending_payload(session)
payload["qr_url"] = ""
payload["message"] = "Finishing the WhatsApp connection."
return payload
- self._sessions.pop(session_id, None)
try:
finalize_task.result()
except Exception as exc:
+ if self._session_stopped(session):
+ self._sessions.pop(session_id, None)
return {
"session_id": session_id,
"status": "failed",
"message": f"WhatsApp QR login failed: {exc}",
}
+ self._sessions.pop(session_id, None)
return {
"session_id": session_id,
"status": "succeeded",
@@ -162,15 +189,21 @@ class WhatsAppConnectStore:
async def _finalize_session(self, session: WhatsAppConnectSession) -> None:
try:
session.result.result()
- await self._close_session(session)
- await self._commit_database(session.pending_path, session.target_path)
except BaseException:
await self._close_session(session)
self._remove_database(session.pending_path)
raise
+ # A stop timeout is not proof that the native SQLite writer exited.
+ # Preserve its database and ownership for an explicit cleanup retry.
+ await self._close_session(session)
+ try:
+ await self._commit_database(session.pending_path, session.target_path)
+ except BaseException:
+ self._remove_database(session.pending_path)
+ raise
async def cancel(self, session_id: str) -> dict[str, Any]:
- session = self._sessions.pop(session_id, None)
+ session = self._sessions.get(session_id)
if session is not None:
await self._discard_session(session)
return {
@@ -186,17 +219,30 @@ class WhatsAppConnectStore:
if time.monotonic() >= session.deadline
]
for session_id in expired:
- session = self._sessions.pop(session_id)
- await self._discard_session(session)
+ await self.cancel(session_id)
+
+ async def _expire_session(self, session: WhatsAppConnectSession) -> None:
+ await asyncio.sleep(max(0, session.deadline - time.monotonic()))
+ await self.cancel(session.id)
async def close(self) -> None:
"""Stop every login client before the gateway event loop closes."""
sessions = tuple(self._sessions.values())
- self._sessions.clear()
for session in sessions:
await self._discard_session(session)
async def _discard_session(self, session: WhatsAppConnectSession) -> None:
+ task = session.discard_task
+ if task is None or task.done():
+ task = asyncio.create_task(
+ self._discard_and_remove(session), name=f"whatsapp-connect-discard-{session.id}",
+ )
+ task.add_done_callback(self._observe_task)
+ session.discard_task = task
+ # Closing a browser/request must not drop the native writer's owner.
+ await asyncio.shield(task)
+
+ async def _discard_and_remove(self, session: WhatsAppConnectSession) -> None:
finalize_task = session.finalize_task
if (
finalize_task is not None
@@ -205,9 +251,10 @@ class WhatsAppConnectStore:
if not finalize_task.done():
finalize_task.cancel()
await asyncio.gather(finalize_task, return_exceptions=True)
- else:
- await self._close_session(session)
+ await self._close_session(session)
self._remove_database(session.pending_path)
+ if self._sessions.get(session.id) is session:
+ del self._sessions[session.id]
@staticmethod
async def _connect(
@@ -229,36 +276,55 @@ class WhatsAppConnectStore:
while not session.qr_url and not session.result.done():
await asyncio.sleep(0.05)
+ async def _close_session(self, session: WhatsAppConnectSession) -> None:
+ task = session.stop_task
+ if task is None or (task.done() and not task.cancelled() and task.exception() is not None):
+ task = asyncio.create_task(
+ self._stop_session(session), name=f"whatsapp-connect-stop-{session.id}",
+ )
+ task.add_done_callback(self._observe_task)
+ session.stop_task = task
+ try:
+ await asyncio.wait_for(asyncio.shield(task), timeout=_NATIVE_STOP_TIMEOUT_SECONDS)
+ except TimeoutError as exc:
+ raise RuntimeError(
+ "WhatsApp is still stopping. Retry cancelling the connection before updating."
+ ) from exc
+
@staticmethod
- async def _close_session(session: WhatsAppConnectSession) -> None:
+ def _observe_task(task: asyncio.Task[None]) -> None:
+ if not task.cancelled():
+ task.exception()
+
+ @staticmethod
+ def _session_stopped(session: WhatsAppConnectSession) -> bool:
+ task = session.stop_task
+ return task is not None and task.done() and not task.cancelled() and task.exception() is None
+
+ @staticmethod
+ async def _stop_session(session: WhatsAppConnectSession) -> None:
+ if session.expiry_task is not None:
+ session.expiry_task.cancel()
+ await asyncio.gather(session.expiry_task, return_exceptions=True)
if not session.result.done():
session.result.cancel()
- if not session.connect_task.done():
- session.connect_task.cancel()
- with suppress(Exception, asyncio.CancelledError):
- await session.connect_task
- native_task: asyncio.Task[Any] | None = None
- if session.connect_task.done() and not session.connect_task.cancelled():
- with suppress(Exception, asyncio.CancelledError):
- native_task = session.connect_task.result()
+ elif not session.result.cancelled():
+ session.result.exception()
+ # Both Stop and Neonize use asyncio.to_thread in the supported SDK.
+ # Cancellation cannot join those threads. Signal, then await actual return;
+ # the bounded caller may time out without cancelling this owned task.
+ await session.client.stop()
+ await asyncio.shield(asyncio.gather(session.connect_task, return_exceptions=True))
+ if session.connect_task.cancelled():
+ raise RuntimeError("WhatsApp connection shutdown could not be verified")
+ native_task = session.connect_task.result()
client_native_task = getattr(session.client, "connect_task", None)
if native_task is None and isinstance(client_native_task, asyncio.Task):
native_task = cast(asyncio.Task[Any], client_native_task)
- with suppress(Exception):
- await asyncio.wait_for(session.client.stop(), timeout=5)
if native_task is not None:
- if not native_task.done():
- try:
- # Stop only signals neonize's Go worker. Wait for that worker
- # to return so Windows releases its SQLite file handle before
- # the temporary login database is promoted.
- await asyncio.wait_for(
- asyncio.shield(native_task),
- timeout=_NATIVE_STOP_TIMEOUT_SECONDS,
- )
- except TimeoutError:
- native_task.cancel()
- await asyncio.gather(native_task, return_exceptions=True)
+ await asyncio.shield(asyncio.gather(native_task, return_exceptions=True))
+ if native_task.cancelled():
+ raise RuntimeError("WhatsApp native shutdown could not be verified")
@staticmethod
def _build_channel() -> tuple[WhatsAppChannel, Path]:
@@ -327,7 +393,7 @@ class WhatsAppConnectStore:
"session_id": session.id,
"status": "pending",
"interval_ms": 2000,
- "expires_at_ms": int((session.created_wall + 600) * 1000),
+ "expires_at_ms": int((session.created_wall + _CONNECT_TTL_SECONDS) * 1000),
"message": "Waiting for the WhatsApp scan.",
}
if session.qr_url:
diff --git a/nanobot/channels/whatsapp/tests/test_connect.py b/nanobot/channels/whatsapp/tests/test_connect.py
index c75f4c292..7fd889cf8 100644
--- a/nanobot/channels/whatsapp/tests/test_connect.py
+++ b/nanobot/channels/whatsapp/tests/test_connect.py
@@ -2,6 +2,7 @@ from __future__ import annotations
import asyncio
import os
+import threading
from pathlib import Path
from types import SimpleNamespace
from typing import Any
@@ -41,7 +42,8 @@ class _FakeClient:
await self.native_stop.wait()
self.native_released = True
return
- await asyncio.Event().wait()
+ await self.native_stop.wait()
+ self.native_released = True
async def stop(self) -> None:
if self.stop_gate is not None:
@@ -107,6 +109,7 @@ async def test_whatsapp_connect_commits_new_session_after_scan(
assert completed["status"] == "succeeded"
assert target.read_bytes() == b"new-session"
assert channel.client.stopped is True
+ assert store.has_pending_work is False
@pytest.mark.asyncio
@@ -121,6 +124,7 @@ async def test_whatsapp_connect_cancel_preserves_existing_session(
monkeypatch.setattr(store, "_build_channel", lambda: (channel, target))
started = await store.start(force=True)
+ assert store.has_pending_work is True
pending_path = Path(channel.config.database_path)
pending_path.write_bytes(b"partial-session")
cancelled = await store.cancel(started["session_id"])
@@ -129,6 +133,7 @@ async def test_whatsapp_connect_cancel_preserves_existing_session(
assert target.read_bytes() == b"working-session"
assert not pending_path.exists()
assert channel.client.stopped is True
+ assert store.has_pending_work is False
@pytest.mark.asyncio
@@ -147,6 +152,7 @@ async def test_whatsapp_connect_clears_qr_while_finishing_login(
assert finishing["status"] == "pending"
assert finishing["qr_url"] == ""
+ assert store.has_pending_work is True
stop_gate.set()
await asyncio.sleep(0)
@@ -224,3 +230,132 @@ async def test_whatsapp_connect_store_closes_pending_login(
assert started["status"] == "pending"
assert not pending_path.exists()
assert channel.client.stopped is True
+ assert store.has_pending_work is False
+
+
+@pytest.mark.asyncio
+@pytest.mark.parametrize("action", ["cancel", "finalize"])
+async def test_native_thread_timeout_keeps_database_and_can_retry_cleanup(
+ monkeypatch: pytest.MonkeyPatch, tmp_path: Path, action: str,
+) -> None:
+ """A cancelled asyncio wrapper cannot prove a native SQLite writer stopped."""
+ target = tmp_path / "neonize.db"
+ target.write_bytes(b"working-session")
+ native_entered, native_release, native_exited = (
+ threading.Event(), threading.Event(), threading.Event(),
+ )
+ channel = _FakeChannel(complete=action == "finalize", linger_until_stopped=True)
+ store = WhatsAppConnectStore()
+ monkeypatch.setattr(store, "_build_channel", lambda: (channel, target))
+ monkeypatch.setattr("nanobot.channels.whatsapp.connect._NATIVE_STOP_TIMEOUT_SECONDS", 0.03)
+
+ def native_writer() -> None:
+ native_entered.set()
+ assert native_release.wait(3)
+ native_exited.set()
+
+ async def connect() -> None:
+ await channel.client.qr_handler(b"whatsapp-qr-payload")
+ Path(channel.config.database_path).write_bytes(b"new-session")
+ if channel.client.complete:
+ channel.client.result.set_result(None)
+ await asyncio.to_thread(native_writer)
+
+ monkeypatch.setattr(channel.client, "connect", connect)
+ started = await store.start(force=True)
+ pending = Path(channel.config.database_path)
+ try:
+ assert await asyncio.to_thread(native_entered.wait, 1)
+ if action == "cancel":
+ with pytest.raises(RuntimeError, match="still stopping"):
+ await store.cancel(started["session_id"])
+ else:
+ result = await store.poll(started["session_id"])
+ assert result["status"] == "failed"
+ assert "still stopping" in result["message"]
+ assert store.has_pending_work is True
+ assert channel.client.connect_task is not None
+ assert not channel.client.connect_task.done()
+ assert not native_exited.is_set()
+ assert pending.read_bytes() == b"new-session"
+ assert target.read_bytes() == b"working-session"
+ finally:
+ native_release.set()
+ await store.cancel(started["session_id"])
+ assert native_exited.is_set()
+ assert store.has_pending_work is False
+ assert not pending.exists()
+ assert target.read_bytes() == b"working-session"
+
+
+@pytest.mark.asyncio
+async def test_cancelling_cleanup_waiter_keeps_owned_shutdown(
+ monkeypatch: pytest.MonkeyPatch, tmp_path: Path,
+) -> None:
+ target = tmp_path / "neonize.db"
+ stop_gate = asyncio.Event()
+ channel = _FakeChannel(complete=False, stop_gate=stop_gate)
+ store = WhatsAppConnectStore()
+ monkeypatch.setattr(store, "_build_channel", lambda: (channel, target))
+ started = await store.start(force=True)
+ pending = Path(channel.config.database_path)
+ pending.write_bytes(b"partial-session")
+ waiter = asyncio.create_task(store.cancel(started["session_id"]))
+ await asyncio.sleep(0)
+ waiter.cancel()
+ with pytest.raises(asyncio.CancelledError):
+ await waiter
+ assert store.has_pending_work is True
+ assert pending.exists()
+ stop_gate.set()
+ await store.close()
+ assert store.has_pending_work is False
+ assert channel.client.native_released is True
+ assert not pending.exists()
+
+
+@pytest.mark.asyncio
+async def test_abandoned_login_expires_without_another_browser_poll(
+ monkeypatch: pytest.MonkeyPatch, tmp_path: Path,
+) -> None:
+ target = tmp_path / "neonize.db"
+ channel = _FakeChannel(complete=False)
+ store = WhatsAppConnectStore()
+ monkeypatch.setattr(store, "_build_channel", lambda: (channel, target))
+ monkeypatch.setattr("nanobot.channels.whatsapp.connect._CONNECT_TTL_SECONDS", 0.02)
+ started = await store.start(force=True)
+ session = store._sessions[started["session_id"]]
+ try:
+ await asyncio.wait_for(channel.client.native_stop.wait(), timeout=1)
+ assert session.discard_task is not None
+ await asyncio.wait_for(asyncio.shield(session.discard_task), timeout=1)
+ assert store.has_pending_work is False
+ assert channel.client.native_released is True
+ finally:
+ await store.close()
+
+
+@pytest.mark.asyncio
+async def test_cancel_during_finalize_does_not_promote_login_database(
+ monkeypatch: pytest.MonkeyPatch, tmp_path: Path,
+) -> None:
+ target = tmp_path / "neonize.db"
+ target.write_bytes(b"working-session")
+ stop_gate = asyncio.Event()
+ channel = _FakeChannel(complete=True, stop_gate=stop_gate)
+ store = WhatsAppConnectStore()
+ monkeypatch.setattr(store, "_build_channel", lambda: (channel, target))
+ started = await store.start(force=True)
+ assert (await store.poll(started["session_id"]))["status"] == "pending"
+ cancelling = asyncio.create_task(store.cancel(started["session_id"]))
+ await asyncio.sleep(0)
+ polling = asyncio.create_task(store.poll(started["session_id"]))
+ try:
+ assert store.has_pending_work is True
+ finally:
+ stop_gate.set()
+ cancelled, polled = await asyncio.gather(cancelling, polling)
+ assert cancelled["status"] == polled["status"] == "cancelled"
+ assert target.read_bytes() == b"working-session"
+ assert not Path(channel.config.database_path).exists()
+ assert store.has_pending_work is False
diff --git a/nanobot/cli/_macos_dock.py b/nanobot/cli/_macos_dock.py
new file mode 100644
index 000000000..b972fa870
--- /dev/null
+++ b/nanobot/cli/_macos_dock.py
@@ -0,0 +1,238 @@
+"""Windowless AppKit helper. Run as an isolated stdlib-only script, not an agent.
+
+Only the parent launcher can pass the listening socket. Its private connections
+contain browser URLs and act as lifetime leases; no configuration is persisted.
+AppKit stays on the main thread. The socket thread sleeps in select, not a GUI
+polling loop, and EOF from every launcher removes the icon.
+"""
+
+from __future__ import annotations
+
+import ctypes as c
+import ipaddress
+import selectors
+import socket
+import sys
+import threading
+from collections.abc import Callable
+from pathlib import Path
+from typing import Any
+from urllib.parse import urlsplit
+
+
+def is_local_browser_url(url: str) -> bool:
+ try:
+ parts = urlsplit(url)
+ local = parts.hostname == "localhost" or ipaddress.ip_address(parts.hostname or "").is_loopback
+ return (parts.scheme == "http" and local and parts.port is not None
+ and parts.port > 0 and parts.username is None and parts.password is None
+ and not any(ord(char) < 32 or ord(char) == 127 for char in url))
+ except ValueError:
+ return False
+
+
+class _Clients:
+ def __init__(self) -> None:
+ self.urls: dict[socket.socket, str] = {}
+ self.lock = threading.Lock()
+
+ def current_url(self) -> str | None:
+ with self.lock:
+ return next(reversed(self.urls.values()), None)
+
+ def add(self, connection: socket.socket, url: str) -> None:
+ with self.lock:
+ self.urls[connection] = url
+
+ def remove(self, connection: socket.socket) -> None:
+ with self.lock:
+ self.urls.pop(connection, None)
+
+
+def _serve(listener: socket.socket, address: Path, clients: _Clients, stop: Callable[[], None]) -> None:
+ import fcntl
+
+ listener.setblocking(False)
+ with selectors.DefaultSelector() as selector, (address.parent / "start.lock").open("a") as lock:
+ selector.register(listener, selectors.EVENT_READ)
+
+ def accept() -> None:
+ connection, _ = listener.accept()
+ connection.settimeout(0.5)
+ try:
+ with connection.makefile("rb") as stream:
+ line = stream.readline(8193)
+ if not line.endswith(b"\n") or len(line) > 8192:
+ raise ValueError("Invalid Dock request")
+ url = line[:-1].decode("utf-8")
+ if not is_local_browser_url(url):
+ raise ValueError("Invalid Dock URL")
+ clients.add(connection, url)
+ selector.register(connection, selectors.EVENT_READ)
+ connection.sendall(b"1")
+ connection.setblocking(False)
+ except (OSError, ValueError):
+ clients.remove(connection)
+ try:
+ selector.unregister(connection)
+ except KeyError:
+ pass
+ connection.close()
+
+ try:
+ while True:
+ for key, _ in selector.select(timeout=None if clients.current_url() else 0.1):
+ connection = key.fileobj
+ if connection is listener:
+ accept()
+ elif isinstance(connection, socket.socket):
+ # No commands after the initial URL. EOF (including SIGKILL)
+ # releases only this launcher's presence, never the gateway.
+ selector.unregister(connection)
+ clients.remove(connection)
+ connection.close()
+ if clients.current_url() is not None:
+ continue
+ try:
+ fcntl.flock(lock, fcntl.LOCK_EX | fcntl.LOCK_NB)
+ except BlockingIOError:
+ continue
+ try:
+ # Serialize last-client exit against a new launcher's handshake.
+ while True:
+ try:
+ accept()
+ except BlockingIOError:
+ break
+ if clients.current_url() is None:
+ listener.close()
+ address.unlink(missing_ok=True)
+ return
+ finally:
+ fcntl.flock(lock, fcntl.LOCK_UN)
+ finally:
+ listener.close()
+ stop()
+
+
+class _AppKit:
+ """Small, explicit Objective-C ABI adapter; no third-party bridge or compiler."""
+
+ def __init__(self, icon: Path, clients: _Clients) -> None:
+ self.objc = c.CDLL("/usr/lib/libobjc.A.dylib")
+ self.framework = c.CDLL("/System/Library/Frameworks/AppKit.framework/AppKit")
+ for name, arguments, result in (
+ ("objc_getClass", [c.c_char_p], c.c_void_p),
+ ("sel_registerName", [c.c_char_p], c.c_void_p),
+ ("objc_allocateClassPair", [c.c_void_p, c.c_char_p, c.c_size_t], c.c_void_p),
+ ("class_addMethod", [c.c_void_p, c.c_void_p, c.c_void_p, c.c_char_p], c.c_bool),
+ ("objc_registerClassPair", [c.c_void_p], None),
+ ):
+ function = getattr(self.objc, name)
+ function.argtypes = arguments
+ function.restype = result
+ self.clients = clients
+ self.callbacks: list[Any] = []
+ self.pool = self.send(self.cls("NSAutoreleasePool"), "new")
+ self.app = self.send(self.cls("NSApplication"), "sharedApplication")
+ self.send(self.app, "setActivationPolicy:", 0, types=(c.c_long,), result=c.c_bool)
+ if self.send(self.app, "activationPolicy", result=c.c_long) != 0:
+ raise OSError("No desktop application session")
+ image = self.send(self.send(self.cls("NSImage"), "alloc"), "initWithContentsOfFile:",
+ self.string(str(icon)), types=(c.c_void_p,))
+ if not image:
+ raise OSError("Dock image unavailable")
+ self.send(self.app, "setApplicationIconImage:", image, types=(c.c_void_p,), result=None)
+ delegate_class = self.objc.objc_allocateClassPair(self.cls("NSObject"), b"NanobotDock", 0)
+
+ def open_page(_self: int, _cmd: int, _sender: int) -> None:
+ url = self.clients.current_url()
+ if url is None:
+ return
+ target = self.send(self.cls("NSURL"), "URLWithString:", self.string(url), types=(c.c_void_p,))
+ workspace = self.send(self.cls("NSWorkspace"), "sharedWorkspace")
+ if not self.send(workspace, "openURL:", target, types=(c.c_void_p,), result=c.c_bool):
+ alert = self.send(self.cls("NSAlert"), "new")
+ self.send(alert, "setMessageText:", self.string("Could not open the browser"),
+ types=(c.c_void_p,), result=None)
+ self.send(alert, "setInformativeText:", self.string("Use the WebUI link in your terminal."),
+ types=(c.c_void_p,), result=None)
+ self.send(alert, "runModal", result=c.c_long)
+
+ def reopen(_self: int, _cmd: int, sender: int, _visible: bool) -> bool:
+ open_page(_self, _cmd, sender)
+ return False
+
+ for selector, callback, signature, result, arguments in (
+ ("openPage:", open_page, b"v@:@", None, (c.c_void_p,)),
+ ("applicationShouldHandleReopen:hasVisibleWindows:", reopen, b"B@:@B",
+ c.c_bool, (c.c_void_p, c.c_bool)),
+ ):
+ wrapped = c.CFUNCTYPE(result, c.c_void_p, c.c_void_p, *arguments)(callback)
+ self.callbacks.append(wrapped) # Objective-C does not retain Python callbacks.
+ if not self.objc.class_addMethod(delegate_class, self.selector(selector),
+ c.cast(wrapped, c.c_void_p), signature):
+ raise OSError("Dock delegate unavailable")
+ self.objc.objc_registerClassPair(delegate_class)
+ self.delegate = self.send(delegate_class, "new")
+ self.send(self.app, "setDelegate:", self.delegate, types=(c.c_void_p,), result=None)
+ menu = self.send(self.cls("NSMenu"), "new")
+ for title, action, key, target in (
+ ("Open nanobot", "openPage:", "o", self.delegate),
+ ("Hide Dock Icon", "terminate:", "q", self.app),
+ ):
+ item = self.send(self.send(self.cls("NSMenuItem"), "alloc"),
+ "initWithTitle:action:keyEquivalent:", self.string(title),
+ self.selector(action), self.string(key),
+ types=(c.c_void_p, c.c_void_p, c.c_void_p))
+ self.send(item, "setTarget:", target, types=(c.c_void_p,), result=None)
+ self.send(menu, "addItem:", item, types=(c.c_void_p,), result=None)
+ root = self.send(self.cls("NSMenuItem"), "new")
+ self.send(root, "setSubmenu:", menu, types=(c.c_void_p,), result=None)
+ bar = self.send(self.cls("NSMenu"), "new")
+ self.send(bar, "addItem:", root, types=(c.c_void_p,), result=None)
+ self.send(self.app, "setMainMenu:", bar, types=(c.c_void_p,), result=None)
+ self.send(self.app, "finishLaunching", result=None)
+
+ def cls(self, name: str) -> int:
+ return self.objc.objc_getClass(name.encode())
+
+ def selector(self, name: str) -> int:
+ return self.objc.sel_registerName(name.encode())
+
+ def string(self, value: str) -> int:
+ return self.send(self.cls("NSString"), "stringWithUTF8String:", value.encode(), types=(c.c_char_p,))
+
+ def send(self, target: int, selector: str, *args: object,
+ types: tuple[Any, ...] = (), result: Any = c.c_void_p) -> Any:
+ # Give every objc_msgSend its actual ABI. Its variadic C declaration is
+ # not sufficient on Apple Silicon (and pointers must not truncate).
+ function = c.CFUNCTYPE(result, c.c_void_p, c.c_void_p, *types)(("objc_msgSend", self.objc))
+ return function(target, self.selector(selector), *args)
+
+ def stop(self) -> None:
+ pool = self.send(self.cls("NSAutoreleasePool"), "new")
+ self.send(self.app, "performSelectorOnMainThread:withObject:waitUntilDone:",
+ self.selector("terminate:"), None, False,
+ types=(c.c_void_p, c.c_void_p, c.c_bool), result=None)
+ self.send(pool, "drain", result=None)
+
+ def run(self) -> None:
+ self.send(self.app, "run", result=None)
+
+
+def main() -> None:
+ if sys.platform != "darwin" or len(sys.argv) != 4:
+ raise SystemExit(64)
+ listener = socket.socket(fileno=int(sys.argv[1]))
+ if (listener.family != socket.AF_UNIX or listener.type != socket.SOCK_STREAM
+ or listener.getsockname() != sys.argv[2]):
+ raise SystemExit(64)
+ clients = _Clients()
+ app = _AppKit(Path(sys.argv[3]), clients)
+ threading.Thread(target=_serve, args=(listener, Path(sys.argv[2]), clients, app.stop), daemon=True).start()
+ app.run()
+
+
+if __name__ == "__main__":
+ main()
diff --git a/nanobot/cli/agent.py b/nanobot/cli/agent.py
index 09b81f28f..0263714fd 100644
--- a/nanobot/cli/agent.py
+++ b/nanobot/cli/agent.py
@@ -19,6 +19,7 @@ from nanobot.cli.runtime_config import (
_model_display,
_print_agent_start_error,
)
+from nanobot.config.schema import Config
console = Console()
@@ -117,6 +118,20 @@ def agent(
raise typer.Exit(exit_code)
return
+ from nanobot.config.home import get_home_path
+ from nanobot.config.loader import get_config_path
+ from nanobot.config.paths import get_data_dir
+ from nanobot.data_access import data_access, profile_data_paths
+
+ paths = profile_data_paths(home=get_home_path(), data_dir=get_data_dir(),
+ config=get_config_path(), workspace=runtime_config.workspace_path)
+ with data_access(paths):
+ _run_classic(runtime_config, message=message, session_id=session_id, markdown=markdown, logs=logs)
+
+
+def _run_classic(runtime_config: Config, *, message: str | None, session_id: str | None,
+ markdown: bool, logs: bool) -> None:
+ """Keep the data lease through writer initialization, execution and cleanup."""
from nanobot.agent.hooks import create_file_edit_activity_hook
from nanobot.agent.tools.image_generation import register_image_generation_tool
from nanobot.agent.tools.mcp import MCPProvider
diff --git a/nanobot/cli/assets/README.md b/nanobot/cli/assets/README.md
new file mode 100644
index 000000000..e51d207f2
--- /dev/null
+++ b/nanobot/cli/assets/README.md
@@ -0,0 +1,5 @@
+# Dock artwork
+
+`dock-icon.png` is a deterministic composition of the existing MIT-licensed nanobot cat from `webui/public/brand/nanobot_icon_512.png` (SHA-256 `d4cf9edb3c30b9e43d02fcd9974c87a8046afbf1b13903c68100ab510bd2cd41`). The cat is uniformly scaled without redrawing or recoloring. The user-approved design uses a 1024-pixel canvas, an 824-pixel rounded white tile at (100, 100), and a 656-pixel cat at (184, 168). Its optical center is 16 pixels below the tile center; shadows are separate from the original art.
+
+The packaged helper loads this PNG through AppKit. It needs neither a generated application executable nor an icon compiler at installation or launch. Keep artwork changes independent of the WebUI brand asset and of gateway lifecycle policy.
diff --git a/nanobot/cli/assets/dock-icon.png b/nanobot/cli/assets/dock-icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..2c4c0943291ce0cb878941c6d33a527ae1703457
GIT binary patch
literal 230419
zcmeFZd0bQ3wk}E|qM$@eAu33$a#z{VX;CynNT{MLs#8>y9)hAq2@)C+0%<^0ED=+d
z3MxWGR8$C|kxn3?M+p#6Na!R$geaj)0wE#YozY$Ao_)_f@1A>J-TOQ5{q`SKuCUgc
zYtFgm9OE0`_{RF}z<&4D2Ad4Dw6s?L^yBx3w6vCi!)014mVoCBzg<)RWaP$(+P{9==b`!2sa6l3
zA9%1VdAqc0$vx*abfuumwzT?2C8m}+B%8Q5OXLqn&kP&>UTNu{KK!MQ<)%Wb@i$|o
ztrJa6PG{>0U8@O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