webbee 0.7.14__tar.gz → 0.7.16__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- webbee-0.7.16/.github/workflows/os-check.yml +82 -0
- {webbee-0.7.14 → webbee-0.7.16}/CHANGELOG.md +31 -0
- {webbee-0.7.14 → webbee-0.7.16}/PKG-INFO +3 -3
- webbee-0.7.16/ci/os_check.py +122 -0
- {webbee-0.7.14 → webbee-0.7.16}/pyproject.toml +3 -3
- webbee-0.7.16/src/webbee/__init__.py +1 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/autoupdate.py +82 -2
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/checkpoints.py +47 -2
- webbee-0.7.16/src/webbee/loop_errors.py +38 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/repl.py +20 -2
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/tools.py +67 -5
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/tui.py +6 -1
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/update.py +53 -12
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_autoupdate.py +71 -3
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_checkpoints_nested_1030.py +40 -5
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_field_test_1113.py +30 -0
- webbee-0.7.16/tests/test_loop_errors.py +51 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_repl.py +38 -2
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_tools.py +2 -2
- webbee-0.7.16/tests/test_update.py +99 -0
- webbee-0.7.14/src/webbee/__init__.py +0 -1
- webbee-0.7.14/tests/test_update.py +0 -49
- {webbee-0.7.14 → webbee-0.7.16}/.github/workflows/publish.yml +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/.gitignore +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/LICENSE +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/README.md +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/install.sh +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/__main__.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/_launch.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/account.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/active_sessions.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/banner_art.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/boot.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/browser.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/cli.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/clipboard.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/clipboard_read.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/clipboard_session.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/coding_context.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/commands.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/config.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/consent.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/details.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/events.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/frames.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/home.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/home_view.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/http.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/instance_lock.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/intel/__init__.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/intel/graph.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/intel/outline.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/intel/query.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/intel/service.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/intel/store.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/intel/tree.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/intel/vectors.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/intel/watch.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/media.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/modals.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/mode_store.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/native_files.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/native_read.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/newtab_mode.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/output_pane.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/pricing_constants.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/queue_panel.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/reflow.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/remote.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/render.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/repo.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/selection.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/session.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/sessions.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/sizing.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/slots.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/steer.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/stream.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/tab_store.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/tabs.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/thread.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/tier_store.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/todo_panel.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/tokens.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/urlopen.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/wallet.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/src/webbee/worktrees.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/__init__.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/conftest.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_account.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_active_sessions.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_append_file.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_audit_2026_07_25_findings.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_checkpoints.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_cli.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_clipboard.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_clipboard_read.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_code_map_fresh.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_coding_context.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_commands.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_config.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_cpc_contract_stable.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_cpc_outline.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_cross_loop_token.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_details.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_events.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_freeze_fix.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_home.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_home_view.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_home_view_mouse.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_inspect_page.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_instance_lock.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_intel_any_folder.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_intel_cache_and_sync_worker.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_intel_checksum_tree.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_intel_chunker.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_intel_embed.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_intel_folder_1106.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_intel_graph.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_intel_no_numpy.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_intel_query.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_intel_service.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_intel_store.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_intel_vectors.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_intel_watch.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_launch.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_marathon.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_modals_e2e.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_mode_and_remote_0_6_8.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_mode_store.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_native_files.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_newtab_mode.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_packaging.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_probe_cost.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_queue_manage_0337.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_reflow.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_remote_code_reads.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_render.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_repo.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_resilient_http.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_review_fixes_1030.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_session.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_session_review_1030.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_sessions.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_sizing.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_slots.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_ssh_guard.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_steer.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_stream.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_tab_bar_stability.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_tab_restore_0337.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_tabs.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_terminal_ux_0336.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_thread.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_tier_invalidation.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_tier_store.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_todo_panel.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_tokens.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_tools_eol_cancel_1030.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_tools_vision_websearch.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_tui.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_tui_hardening.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_update_badge_0340.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_urlopen.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_version.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_version_badge_corner.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_wallet.py +0 -0
- {webbee-0.7.14 → webbee-0.7.16}/tests/test_worktrees.py +0 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
name: os-check
|
|
2
|
+
|
|
3
|
+
# Every system webbee runs on, before a release: the tests whose behaviour depends on the system, the real-system checks
|
|
4
|
+
# (ci/os_check.py: a stray older dist-info, the upgrade command, a running Windows .exe reinstalled), and an install by
|
|
5
|
+
# pip, pipx and uv. Publishes nothing (publish.yml runs on v* tags only).
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
inputs:
|
|
10
|
+
mcp_ref:
|
|
11
|
+
description: "imperal-mcp ref to test with"
|
|
12
|
+
default: "main"
|
|
13
|
+
push:
|
|
14
|
+
branches: ["os-check"]
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
check:
|
|
18
|
+
strategy:
|
|
19
|
+
fail-fast: false
|
|
20
|
+
matrix:
|
|
21
|
+
os: [windows-latest, macos-latest, ubuntu-latest]
|
|
22
|
+
python: ["3.11", "3.12"]
|
|
23
|
+
runs-on: ${{ matrix.os }}
|
|
24
|
+
env:
|
|
25
|
+
WEBBEE_NO_AUTOUPDATE: "1"
|
|
26
|
+
PYTHONUTF8: "1"
|
|
27
|
+
steps:
|
|
28
|
+
- uses: actions/checkout@v4
|
|
29
|
+
with:
|
|
30
|
+
path: webbee
|
|
31
|
+
- uses: actions/checkout@v4
|
|
32
|
+
with:
|
|
33
|
+
repository: imperalcloud/imperal-mcp
|
|
34
|
+
ref: ${{ github.event.inputs.mcp_ref || 'os-check' }}
|
|
35
|
+
path: mcp
|
|
36
|
+
- uses: actions/setup-python@v5
|
|
37
|
+
with:
|
|
38
|
+
python-version: ${{ matrix.python }}
|
|
39
|
+
- name: wheels of this webbee and imperal-mcp
|
|
40
|
+
shell: bash
|
|
41
|
+
run: |
|
|
42
|
+
python -m pip install -U pip wheel build
|
|
43
|
+
python -m pip wheel --no-deps -w wheels ./webbee ./mcp
|
|
44
|
+
ls wheels
|
|
45
|
+
- name: install (pip) with the test tools
|
|
46
|
+
shell: bash
|
|
47
|
+
run: python -m pip install --find-links wheels "webbee" "imperal-mcp[code]" pytest pytest-asyncio respx
|
|
48
|
+
- name: webbee tests that depend on the system
|
|
49
|
+
shell: bash
|
|
50
|
+
working-directory: webbee
|
|
51
|
+
run: python -m pytest -q -p no:cacheprovider tests/test_update.py tests/test_autoupdate.py tests/test_loop_errors.py tests/test_repl.py
|
|
52
|
+
- name: imperal-mcp tests that depend on the system
|
|
53
|
+
if: ${{ !cancelled() }} # every check runs: one failure never hides the others
|
|
54
|
+
shell: bash
|
|
55
|
+
working-directory: mcp
|
|
56
|
+
run: python -m pytest -q -p no:cacheprovider tests/test_auth.py tests/test_launch.py tests/test_mask_pii.py tests/test_live_1114.py
|
|
57
|
+
- name: real-system checks
|
|
58
|
+
if: ${{ !cancelled() }} # every check runs: one failure never hides the others
|
|
59
|
+
shell: bash
|
|
60
|
+
run: python webbee/ci/os_check.py
|
|
61
|
+
- name: install by pipx
|
|
62
|
+
if: ${{ !cancelled() }} # every check runs: one failure never hides the others
|
|
63
|
+
shell: bash
|
|
64
|
+
run: |
|
|
65
|
+
python -m pip install pipx
|
|
66
|
+
v=$(python -c "import webbee; print(webbee.__version__)")
|
|
67
|
+
wheels=$(python -c "import os; print(os.path.abspath('wheels'))") # Git Bash's $(pwd) is /d/... -- no path to pip on Windows
|
|
68
|
+
python -m pipx install --pip-args="--find-links $wheels" ./webbee
|
|
69
|
+
out=$(python -m pipx list --short)
|
|
70
|
+
echo "$out"
|
|
71
|
+
echo "$out" | grep -q "webbee $v"
|
|
72
|
+
- name: install by uv
|
|
73
|
+
if: ${{ !cancelled() }} # every check runs: one failure never hides the others
|
|
74
|
+
shell: bash
|
|
75
|
+
run: |
|
|
76
|
+
python -m pip install uv
|
|
77
|
+
python -m uv tool install --force --find-links wheels ./webbee # pipx put a webbee in the same bin
|
|
78
|
+
webbee_bin=$(python -m uv tool dir --bin)
|
|
79
|
+
ls "$webbee_bin"
|
|
80
|
+
v=$(python -c "import webbee; print(webbee.__version__)")
|
|
81
|
+
"$webbee_bin/webbee" --version | tee v.txt
|
|
82
|
+
grep -q "webbee $v" v.txt
|
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.7.16
|
|
4
|
+
|
|
5
|
+
* Needs imperal-mcp 0.9.19 (Windows sign-in fixes).
|
|
6
|
+
* Windows: a connection the server closed no longer stops the terminal on "Unhandled exception in event loop ...
|
|
7
|
+
[WinError 10054] ... Press ENTER to continue" -- the dock runs without prompt_toolkit's own loop handler; a reset,
|
|
8
|
+
aborted or broken connection is dropped, any other loop exception goes to webbee.log, never over the screen.
|
|
9
|
+
* /login: an error inside the sign-in is said ("Sign-in failed: ... run /login again"), never an unhandled exception; a
|
|
10
|
+
sign-in whose tokens were saved counts as signed in even when a later call broke; Home's account, wallet and
|
|
11
|
+
sessions are filled again right after it -- no restart needed.
|
|
12
|
+
* Versions said right on every system ("a newer webbee is out" to someone on the newest):
|
|
13
|
+
- "vX is installed, restart webbee" read the version from the package metadata -- a left-over older install ahead
|
|
14
|
+
of the real one on sys.path (a user site-packages on Windows) named its version for good; it reads the running
|
|
15
|
+
package's own file now.
|
|
16
|
+
- the "available" notice reads the newest release where the start's self-upgrade and `pipx`/`uv tool upgrade`
|
|
17
|
+
install from (the `stable` branch; PyPI only without git), so the two never disagree.
|
|
18
|
+
- the upgrade command shown is the one for this install (uv, pipx, or `"<python>" -m pip install -U webbee`).
|
|
19
|
+
- a version with a suffix (rc, dev, +local) is read by its numbers, never as "older than everything".
|
|
20
|
+
- Windows: the self-upgrade of a pip / pipx install moves the running webbee.exe aside first (it cannot be
|
|
21
|
+
overwritten while it runs) and puts it back if the install fails; launchers left aside are removed at a later
|
|
22
|
+
start.
|
|
23
|
+
- a uv receipt on the release branch is read however that uv writes the ref (`?rev=`, `@`, `#`).
|
|
24
|
+
|
|
25
|
+
## 0.7.15
|
|
26
|
+
|
|
27
|
+
* Needs imperal-sdk 6.6.1 and imperal-mcp 0.9.16 (the imperal-mcp 0.9.15 field test, report 2, fixed in every layer).
|
|
28
|
+
* read_file: a window asked of a small file that is returned whole says so (`window_applied`, `asked_window`).
|
|
29
|
+
* bash: a failed command's exit code is in its text (`[exit 128]`).
|
|
30
|
+
* rollback: refused, with the list, when it would overwrite files in nested repositories or files this session did not
|
|
31
|
+
write; `paths=[...]` restores only those files, `allow_nested=true` the nested ones too.
|
|
32
|
+
* Code tools honour `root` (search narrowed to it, other answers say what they cover) or refuse one that is not there.
|
|
33
|
+
|
|
3
34
|
## 0.7.14
|
|
4
35
|
|
|
5
36
|
* Needs imperal-sdk 6.6.0 and imperal-mcp 0.9.15 (the imperal-mcp 0.9.14 field test, fixed in every layer).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: webbee
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.16
|
|
4
4
|
Summary: Webbee 🐝 — the Imperal Cloud coding agent in your terminal
|
|
5
5
|
Project-URL: Homepage, https://imperal.io
|
|
6
6
|
Project-URL: Documentation, https://docs.imperal.io
|
|
@@ -31,8 +31,8 @@ Requires-Python: >=3.7
|
|
|
31
31
|
Requires-Dist: asyncssh>=2.14; python_version >= '3.10'
|
|
32
32
|
Requires-Dist: httpx-sse>=0.4; python_version >= '3.10'
|
|
33
33
|
Requires-Dist: httpx>=0.27; python_version >= '3.10'
|
|
34
|
-
Requires-Dist: imperal-mcp>=0.9.
|
|
35
|
-
Requires-Dist: imperal-sdk[universal-index]>=6.6.
|
|
34
|
+
Requires-Dist: imperal-mcp>=0.9.19; python_version >= '3.10'
|
|
35
|
+
Requires-Dist: imperal-sdk[universal-index]>=6.6.1; python_version >= '3.10'
|
|
36
36
|
Requires-Dist: model2vec>=0.8.2; python_version >= '3.10' and (sys_platform != 'darwin' or platform_machine != 'x86_64' or python_version < '3.13')
|
|
37
37
|
Requires-Dist: numpy>=2; python_version >= '3.10' and (sys_platform != 'darwin' or platform_machine != 'x86_64' or python_version < '3.13')
|
|
38
38
|
Requires-Dist: prompt-toolkit>=3; python_version >= '3.10'
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"""Real-system checks the unit tests cannot make (run by .github/workflows/os-check.yml on Windows, macOS, Linux).
|
|
2
|
+
|
|
3
|
+
Owner 2026-11-14: "they install a version and webbee says a newer one is out, though they run the newest" (Windows,
|
|
4
|
+
Python 3.11) -- each check below runs the real thing on the real system and fails loudly.
|
|
5
|
+
"""
|
|
6
|
+
import os
|
|
7
|
+
import subprocess
|
|
8
|
+
import sys
|
|
9
|
+
import tempfile
|
|
10
|
+
import textwrap
|
|
11
|
+
import time
|
|
12
|
+
|
|
13
|
+
FAILED = []
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def check(name, ok, detail=""):
|
|
17
|
+
print(("PASS " if ok else "FAIL ") + name + (f" -- {detail}" if detail else ""), flush=True)
|
|
18
|
+
if not ok:
|
|
19
|
+
FAILED.append(name)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def py(*code_lines, env=None):
|
|
23
|
+
return subprocess.run([sys.executable, "-c", "\n".join(code_lines)], capture_output=True, text=True,
|
|
24
|
+
env={**os.environ, **(env or {})})
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def main():
|
|
28
|
+
import webbee
|
|
29
|
+
from webbee import update
|
|
30
|
+
|
|
31
|
+
# 1. the console script runs and names this release
|
|
32
|
+
exe = "webbee.exe" if os.name == "nt" else "webbee"
|
|
33
|
+
scripts = os.path.dirname(sys.executable) if os.name == "nt" else os.path.dirname(sys.executable)
|
|
34
|
+
cand = [os.path.join(scripts, exe), os.path.join(scripts, "Scripts", exe)]
|
|
35
|
+
found = next((c for c in cand if os.path.isfile(c)), None)
|
|
36
|
+
got = subprocess.run([found or "webbee", "--version"], capture_output=True, text=True,
|
|
37
|
+
env={**os.environ, "WEBBEE_NO_AUTOUPDATE": "1"})
|
|
38
|
+
check("console script prints this release", got.returncode == 0 and webbee.__version__ in got.stdout,
|
|
39
|
+
(got.stdout + got.stderr).strip()[:200])
|
|
40
|
+
|
|
41
|
+
# 2. a left-over older dist-info ahead on sys.path (the Windows user-site case)
|
|
42
|
+
stray = tempfile.mkdtemp()
|
|
43
|
+
d = os.path.join(stray, "webbee-0.3.49.dist-info")
|
|
44
|
+
os.makedirs(d)
|
|
45
|
+
with open(os.path.join(d, "METADATA"), "w") as f:
|
|
46
|
+
f.write("Metadata-Version: 2.1\nName: webbee\nVersion: 0.3.49\n")
|
|
47
|
+
r = py("import importlib.metadata as m, webbee.update as u, webbee",
|
|
48
|
+
"print(m.version('webbee')); print(u.installed_version()); print(webbee.__version__)",
|
|
49
|
+
"print(repr(u.restart_notice(webbee.__version__, u.installed_version())))", env={"PYTHONPATH": stray})
|
|
50
|
+
lines = r.stdout.split("\n")
|
|
51
|
+
check("the stray dist-info is what the metadata names (the field case reproduced)",
|
|
52
|
+
r.returncode == 0 and lines[0] == "0.3.49", r.stdout + r.stderr)
|
|
53
|
+
check("installed_version reads the running package, never the stray dist-info",
|
|
54
|
+
r.returncode == 0 and lines[1] == webbee.__version__ and lines[3] == "''", r.stdout + r.stderr)
|
|
55
|
+
|
|
56
|
+
# 3. the upgrade command is this install's own
|
|
57
|
+
hint = update.upgrade_hint()
|
|
58
|
+
check("upgrade hint for a pip install names this interpreter", "-m pip install -U webbee" in hint
|
|
59
|
+
and sys.executable in hint, hint)
|
|
60
|
+
|
|
61
|
+
# 4. a version with a suffix is read by its numbers
|
|
62
|
+
check("a suffixed version is not older than everything",
|
|
63
|
+
update.check_for_update(webbee.__version__ + "+local", cache_path=os.path.join(stray, "u.json"), now=1.0,
|
|
64
|
+
fetch=lambda: webbee.__version__) is None)
|
|
65
|
+
|
|
66
|
+
# 5. Windows: a RUNNING console-script .exe -- reinstalled with it moved aside
|
|
67
|
+
if os.name == "nt":
|
|
68
|
+
windows_launcher_swap()
|
|
69
|
+
|
|
70
|
+
print(f"\n{len(FAILED)} failed: {FAILED}" if FAILED else "\nall checks passed")
|
|
71
|
+
return 1 if FAILED else 0
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def windows_launcher_swap():
|
|
75
|
+
from webbee import autoupdate as au
|
|
76
|
+
pkg = tempfile.mkdtemp()
|
|
77
|
+
os.makedirs(os.path.join(pkg, "sleeper"))
|
|
78
|
+
with open(os.path.join(pkg, "sleeper", "__init__.py"), "w") as f:
|
|
79
|
+
f.write("import time\n\ndef main():\n time.sleep(120)\n")
|
|
80
|
+
with open(os.path.join(pkg, "pyproject.toml"), "w") as f:
|
|
81
|
+
f.write(textwrap.dedent("""\
|
|
82
|
+
[project]
|
|
83
|
+
name = "sleeper"
|
|
84
|
+
version = "1.0"
|
|
85
|
+
[project.scripts]
|
|
86
|
+
sleeper = "sleeper:main"
|
|
87
|
+
[build-system]
|
|
88
|
+
requires = ["setuptools>=61"]
|
|
89
|
+
build-backend = "setuptools.build_meta"
|
|
90
|
+
[tool.setuptools]
|
|
91
|
+
packages = ["sleeper"]
|
|
92
|
+
"""))
|
|
93
|
+
pip = [sys.executable, "-m", "pip", "install", "--no-deps", "--force-reinstall", "--disable-pip-version-check",
|
|
94
|
+
"-q", pkg]
|
|
95
|
+
subprocess.run(pip, check=True)
|
|
96
|
+
scripts = os.path.join(sys.prefix, "Scripts")
|
|
97
|
+
exe = os.path.join(scripts, "sleeper.exe")
|
|
98
|
+
check("the console-script launcher exists", os.path.isfile(exe), exe)
|
|
99
|
+
proc = subprocess.Popen([exe])
|
|
100
|
+
time.sleep(3)
|
|
101
|
+
try:
|
|
102
|
+
bare = subprocess.run(pip, capture_output=True, text=True)
|
|
103
|
+
print(f"INFO reinstall with the launcher running and NOT moved: exit {bare.returncode} "
|
|
104
|
+
f"{(bare.stdout + bare.stderr).strip()[-300:]}", flush=True)
|
|
105
|
+
moved = au.free_launchers(names=("sleeper",), dirs=[scripts], windows=True)
|
|
106
|
+
check("the running launcher is moved aside", len(moved) == 1 and os.path.isfile(moved[0][1]), str(moved))
|
|
107
|
+
swap = subprocess.run(pip, capture_output=True, text=True)
|
|
108
|
+
check("reinstall succeeds with the running launcher moved aside", swap.returncode == 0,
|
|
109
|
+
(swap.stdout + swap.stderr).strip()[-300:])
|
|
110
|
+
check("a new launcher is in place", os.path.isfile(exe))
|
|
111
|
+
au.put_back(moved) # the installer wrote one: nothing is put back over it
|
|
112
|
+
check("put_back leaves the new launcher", os.path.isfile(exe) and os.path.isfile(moved[0][1]))
|
|
113
|
+
finally:
|
|
114
|
+
proc.kill()
|
|
115
|
+
proc.wait()
|
|
116
|
+
time.sleep(1)
|
|
117
|
+
n = au.sweep_aside(dirs=[scripts])
|
|
118
|
+
check("the launcher moved aside is removed once it no longer runs", n >= 1, f"removed {n}")
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
if __name__ == "__main__":
|
|
122
|
+
sys.exit(main())
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "webbee"
|
|
3
|
-
version = "0.7.
|
|
3
|
+
version = "0.7.16"
|
|
4
4
|
description = "Webbee 🐝 — the Imperal Cloud coding agent in your terminal"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = "GPL-3.0-or-later"
|
|
@@ -13,8 +13,8 @@ dependencies = [
|
|
|
13
13
|
# release on a Python 3.12 it sets up once with uv -- `uv` comes as a wheel on 3.8+,
|
|
14
14
|
# 3.7 fetches it with uv's own installer.
|
|
15
15
|
'uv>=0.4; python_version >= "3.8" and python_version < "3.10"',
|
|
16
|
-
'imperal-mcp>=0.9.
|
|
17
|
-
'imperal-sdk[universal-index]>=6.6.
|
|
16
|
+
'imperal-mcp>=0.9.19; python_version >= "3.10"', # raised to the newest at each release
|
|
17
|
+
'imperal-sdk[universal-index]>=6.6.1; python_version >= "3.10"',
|
|
18
18
|
'asyncssh>=2.14; python_version >= "3.10"',
|
|
19
19
|
'httpx>=0.27; python_version >= "3.10"',
|
|
20
20
|
'httpx-sse>=0.4; python_version >= "3.10"',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.7.16"
|
|
@@ -147,7 +147,10 @@ def on_stable(tool: str, prefix: str, specs) -> bool:
|
|
|
147
147
|
with open(os.path.join(prefix, "uv-receipt.toml"), encoding="utf-8") as f:
|
|
148
148
|
receipt = f.read()
|
|
149
149
|
urls = [s.split(" @ git+", 1)[-1].rsplit("@", 1)[0] for s in specs]
|
|
150
|
-
|
|
150
|
+
# the repository and its branch on one requirement line, however this uv writes the ref (?rev=, @, #):
|
|
151
|
+
# an exact string a newer uv wrote otherwise would make every start "move" webbee onto the branch again
|
|
152
|
+
return all(any(u in line and any(m in line for m in (f"rev={STABLE}", f"@{STABLE}", f"#{STABLE}"))
|
|
153
|
+
for line in receipt.splitlines()) for u in urls)
|
|
151
154
|
except Exception:
|
|
152
155
|
return False
|
|
153
156
|
return True
|
|
@@ -316,7 +319,8 @@ def _pid_alive(pid: int) -> bool:
|
|
|
316
319
|
return True
|
|
317
320
|
if pid == os.getpid():
|
|
318
321
|
return True
|
|
319
|
-
if
|
|
322
|
+
if os.name == "nt": # os.kill on Windows terminates: ask the process table instead -- the
|
|
323
|
+
# system's own API, whatever restart path a caller pins (_WINDOWS)
|
|
320
324
|
try:
|
|
321
325
|
import ctypes
|
|
322
326
|
k32 = ctypes.windll.kernel32
|
|
@@ -450,6 +454,77 @@ def _roll_back(current: str, newest: str, python: str, light: str, env, uv, pipx
|
|
|
450
454
|
return False
|
|
451
455
|
|
|
452
456
|
|
|
457
|
+
ASIDE = ".old-" # webbee.exe.old-<pid>: a running launcher moved out of the installer's way
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
def _script_dirs() -> list:
|
|
461
|
+
"""Where this webbee's launchers stand: beside the running one (a pipx / uv copy in ~/.local/bin), this
|
|
462
|
+
environment's Scripts, the user scheme's Scripts."""
|
|
463
|
+
import sysconfig
|
|
464
|
+
dirs = []
|
|
465
|
+
if sys.argv and sys.argv[0]:
|
|
466
|
+
dirs.append(os.path.dirname(os.path.abspath(sys.argv[0])))
|
|
467
|
+
for scheme in ("", f"{os.name}_user"):
|
|
468
|
+
try:
|
|
469
|
+
dirs.append(sysconfig.get_path("scripts", scheme) if scheme else sysconfig.get_path("scripts"))
|
|
470
|
+
except Exception:
|
|
471
|
+
pass
|
|
472
|
+
out = []
|
|
473
|
+
for d in dirs:
|
|
474
|
+
if d and os.path.isdir(d) and os.path.normcase(d) not in [os.path.normcase(x) for x in out]:
|
|
475
|
+
out.append(d)
|
|
476
|
+
return out
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
def free_launchers(names=(DIST,), dirs=None, windows: "bool | None" = None) -> list:
|
|
480
|
+
"""Windows: each ``<name>.exe`` launcher renamed aside, so the installer can write the new one -- a running .exe
|
|
481
|
+
can be renamed there, never overwritten (live 2026-11-14: the self-upgrade of a pip / pipx install failed on every
|
|
482
|
+
start with the old webbee.exe in use, and "v... available" stayed). Returns ``[(path, aside)]`` for
|
|
483
|
+
``put_back``. Elsewhere: nothing."""
|
|
484
|
+
if not (_WINDOWS if windows is None else windows):
|
|
485
|
+
return []
|
|
486
|
+
moved = []
|
|
487
|
+
for d in (dirs if dirs is not None else _script_dirs()):
|
|
488
|
+
for n in names:
|
|
489
|
+
path = os.path.join(d, n + ".exe")
|
|
490
|
+
if os.path.isfile(path):
|
|
491
|
+
aside = f"{path}{ASIDE}{os.getpid()}"
|
|
492
|
+
try:
|
|
493
|
+
os.replace(path, aside)
|
|
494
|
+
moved.append((path, aside))
|
|
495
|
+
except OSError:
|
|
496
|
+
pass
|
|
497
|
+
return moved
|
|
498
|
+
|
|
499
|
+
|
|
500
|
+
def put_back(moved) -> None:
|
|
501
|
+
"""The launchers ``free_launchers`` moved, back where the installer wrote none (an upgrade that failed)."""
|
|
502
|
+
for path, aside in moved or []:
|
|
503
|
+
try:
|
|
504
|
+
if not os.path.exists(path):
|
|
505
|
+
os.replace(aside, path)
|
|
506
|
+
except OSError:
|
|
507
|
+
pass
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
def sweep_aside(dirs=None) -> int:
|
|
511
|
+
"""Launchers an earlier upgrade moved aside, removed once nothing runs them. Returns how many."""
|
|
512
|
+
n = 0
|
|
513
|
+
for d in (dirs if dirs is not None else _script_dirs()):
|
|
514
|
+
try:
|
|
515
|
+
names = os.listdir(d)
|
|
516
|
+
except OSError:
|
|
517
|
+
continue
|
|
518
|
+
for name in names:
|
|
519
|
+
if ".exe" + ASIDE in name:
|
|
520
|
+
try:
|
|
521
|
+
os.remove(os.path.join(d, name))
|
|
522
|
+
n += 1
|
|
523
|
+
except OSError:
|
|
524
|
+
pass # still running (another session): the next start removes it
|
|
525
|
+
return n
|
|
526
|
+
|
|
527
|
+
|
|
453
528
|
def upgrade_before_start(argv, current: str, say=print, fetch=latest, which=safe_which, run=subprocess.run,
|
|
454
529
|
execv=os.execv, env=os.environ, wheel=wheel_url, lock_path=_lock_path,
|
|
455
530
|
sleep=time.sleep, stable=stable_version, prefix: str = sys.prefix) -> list:
|
|
@@ -460,6 +535,8 @@ def upgrade_before_start(argv, current: str, say=print, fetch=latest, which=safe
|
|
|
460
535
|
try:
|
|
461
536
|
if env.get(OFF_ENV) == "1":
|
|
462
537
|
return did
|
|
538
|
+
if _WINDOWS:
|
|
539
|
+
sweep_aside()
|
|
463
540
|
lock = lock_path() if lock_path else ""
|
|
464
541
|
if lock and not _lock(lock):
|
|
465
542
|
# another webbee is upgrading this install: wait for it, then start on what it installed
|
|
@@ -496,9 +573,12 @@ def upgrade_before_start(argv, current: str, say=print, fetch=latest, which=safe
|
|
|
496
573
|
say(f"🐝 updating webbee {current} -> {newest} ..." if _ver(newest) > _ver(current) else
|
|
497
574
|
f"🐝 moving webbee {current} onto its release branch, so a reinstall brings the newest ...")
|
|
498
575
|
python = light or sys.executable
|
|
576
|
+
moved = free_launchers()
|
|
499
577
|
installed = _run(cmd, run)
|
|
500
578
|
ok = installed and (imports_ok(python, run, light=bool(light)) or
|
|
501
579
|
(_run(cmd, run) and imports_ok(python, run, light=bool(light))))
|
|
580
|
+
if not installed:
|
|
581
|
+
put_back(moved)
|
|
502
582
|
if not ok and (installed or not imports_ok(python, run, light=bool(light))):
|
|
503
583
|
# on disk a release that does not import (or an install that broke off halfway): the next start
|
|
504
584
|
# would run it and stay stuck. The one running now (and any other open session) holds the old
|
|
@@ -451,12 +451,17 @@ class ShadowGit:
|
|
|
451
451
|
except OSError:
|
|
452
452
|
pass
|
|
453
453
|
|
|
454
|
-
def rollback(self, to: str) -> dict:
|
|
454
|
+
def rollback(self, to: str, paths: list | None = None, allow_nested: bool = False, own: set | None = None) -> dict:
|
|
455
455
|
"""Restore every checkpointed file to checkpoint `to`. The current
|
|
456
456
|
state is checkpointed FIRST ("pre-rollback"), so a rollback is itself
|
|
457
457
|
undoable. Files never checkpointed are not removed. A file the safety
|
|
458
458
|
snapshot could not hold (too large, excluded) is never overwritten, and
|
|
459
|
-
the result names every path the rollback did not restore, with why.
|
|
459
|
+
the result names every path the rollback did not restore, with why.
|
|
460
|
+
|
|
461
|
+
``paths``: restore only these files or folders. A rollback that would change files INSIDE nested repositories
|
|
462
|
+
that are not this session's own writes (``own``: repo-relative paths the caller wrote and nobody changed
|
|
463
|
+
since; None: unknown) is refused without ``paths`` or ``allow_nested`` -- they may be another session's
|
|
464
|
+
uncommitted work (field test 2026-11-13: a whole-folder rollback reset a gateway another agent was editing)."""
|
|
460
465
|
if not self.available:
|
|
461
466
|
return {"ok": False, "content": "reversibility is off (git unavailable)"}
|
|
462
467
|
target = self._resolve(to)
|
|
@@ -484,6 +489,22 @@ class ShadowGit:
|
|
|
484
489
|
return {"ok": False, "content":
|
|
485
490
|
"rollback refused: checkpoint " + to + " holds nested repositories only as "
|
|
486
491
|
"pointers and the shadow could not build a view that keeps them; nothing was changed."}
|
|
492
|
+
want = [str(x).strip().strip("/") for x in (paths or []) if str(x).strip().strip("/")]
|
|
493
|
+
changed = [x for x in self._git("diff", "--name-only", "-z", pre, goal).stdout.split("\0") if x]
|
|
494
|
+
nested_now = sorted(set(undo.get("nested") or []) | set(self._read_body(target)[0] or []))
|
|
495
|
+
hit = sorted({n for n in nested_now if any(c.startswith(n.rstrip("/") + "/") for c in changed)})
|
|
496
|
+
inside = [c for c in changed if any(c.startswith(n.rstrip("/") + "/") for n in hit)]
|
|
497
|
+
foreign = [c for c in inside if own is None or c not in own]
|
|
498
|
+
if foreign and not want and not allow_nested:
|
|
499
|
+
inside = foreign
|
|
500
|
+
return {"ok": False, "content":
|
|
501
|
+
f"rollback refused: it would overwrite {len(inside)} file(s) inside the nested "
|
|
502
|
+
f"repositories {', '.join(hit)} that this session did not write -- their own uncommitted "
|
|
503
|
+
"work or another session's. Pass paths=[...] to restore only the files you changed, or "
|
|
504
|
+
"allow_nested=true if they are yours (nothing was changed now).",
|
|
505
|
+
"would_overwrite": inside[:50], "nested": hit}
|
|
506
|
+
if want:
|
|
507
|
+
return self._restore_paths(to, target, goal, want, undo)
|
|
487
508
|
pre_paths = {p for _m, p in self._tree(pre)}
|
|
488
509
|
goal_paths = {p for _m, p in self._tree(goal)}
|
|
489
510
|
unsaved = dict(undo.get("uncovered") or [])
|
|
@@ -529,6 +550,30 @@ class ShadowGit:
|
|
|
529
550
|
return {"ok": True, "content": "\n".join(lines),
|
|
530
551
|
"nested": nested, "not_restored": [p for p, _w in not_restored], "left_as_is": held}
|
|
531
552
|
|
|
553
|
+
def _restore_paths(self, to: str, target: str, goal: str, want: list, undo: dict) -> dict:
|
|
554
|
+
"""Restore only ``want`` (files or folders) to the checkpoint: each held there is written back, each absent
|
|
555
|
+
there is removed; nothing else in the workspace is touched."""
|
|
556
|
+
held = {p for _m, p in self._tree(goal)}
|
|
557
|
+
restored, removed = [], []
|
|
558
|
+
for w in want:
|
|
559
|
+
inside = sorted(p for p in held if p == w or p.startswith(w + "/"))
|
|
560
|
+
if inside:
|
|
561
|
+
r = self._git("checkout", goal, "--", *inside)
|
|
562
|
+
if r.returncode != 0:
|
|
563
|
+
return {"ok": False, "content": f"rollback of {w} failed: {r.stderr.strip()[:300]}"}
|
|
564
|
+
restored += inside
|
|
565
|
+
full = os.path.join(self.root, w)
|
|
566
|
+
if not inside and os.path.lexists(full) and not os.path.isdir(full):
|
|
567
|
+
os.remove(full) # not in the checkpoint: it did not exist then
|
|
568
|
+
removed.append(w)
|
|
569
|
+
lines = [f"restored {len(restored)} path(s) to checkpoint {to} ({target[:9]})"
|
|
570
|
+
+ (f"; removed {len(removed)} that it did not hold" if removed else "")
|
|
571
|
+
+ "; nothing else was touched."]
|
|
572
|
+
lines += [f" - {p}" for p in (restored + removed)[:_NAMED_CAP]]
|
|
573
|
+
lines.append(f"The previous state was saved first as checkpoint cp-{undo.get('n', '?')} "
|
|
574
|
+
f"({undo.get('id', '?')}), so this rollback is itself undoable.")
|
|
575
|
+
return {"ok": True, "content": "\n".join(lines), "restored": restored, "removed": removed}
|
|
576
|
+
|
|
532
577
|
_AUTO_FAIL_LATCH = 3 # consecutive AUTO failures before pausing auto-checkpointing
|
|
533
578
|
# writes while paused before one more try: a cause that went away (a symlink fixed, a slow disk) brings the time
|
|
534
579
|
# machine back instead of leaving it off for the whole session (Ignat 06.11 §5)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""The event loop's own exception handler: a peer closing a socket is no error, anything else goes to the log.
|
|
2
|
+
|
|
3
|
+
Live 2026-11-14 (users on Windows, Python 3.11): the full-screen dock printed "Unhandled exception in event loop ...
|
|
4
|
+
proactor_events.py ... _call_connection_lost ... self._sock.shutdown(socket.SHUT_RDWR) ... [WinError 10054] An existing
|
|
5
|
+
connection was forcibly closed by the remote host" and stopped on "Press ENTER to continue..." -- prompt_toolkit's own
|
|
6
|
+
loop exception handler (Application.run_async(set_exception_handler=True), its default) prints any unhandled loop
|
|
7
|
+
exception over the screen and waits for a key. On Windows the ProactorEventLoop's connection-lost callback calls
|
|
8
|
+
shutdown() on a socket the server (or a balancer) already reset; the exception has no task to land in, so it reaches
|
|
9
|
+
the loop's handler. Nothing is lost there: the connection is gone either way and the client opens a new one.
|
|
10
|
+
|
|
11
|
+
So: the dock runs with set_exception_handler=False and this handler on the loop -- a reset / aborted / broken
|
|
12
|
+
connection is dropped silently, every other loop exception goes to the "webbee" logger (cli._log_to_file: webbee.log)
|
|
13
|
+
and never painted over the screen.
|
|
14
|
+
"""
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
import asyncio
|
|
18
|
+
import logging
|
|
19
|
+
|
|
20
|
+
_PEER_GONE = (ConnectionResetError, ConnectionAbortedError, BrokenPipeError)
|
|
21
|
+
_log = logging.getLogger("webbee.loop")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def handle_loop_exception(loop: asyncio.AbstractEventLoop, context: dict) -> None:
|
|
25
|
+
"""``loop.set_exception_handler`` callback (see the module doc)."""
|
|
26
|
+
exc = context.get("exception")
|
|
27
|
+
if isinstance(exc, _PEER_GONE):
|
|
28
|
+
return
|
|
29
|
+
msg = str(context.get("message") or "unhandled exception in event loop")
|
|
30
|
+
if exc is not None:
|
|
31
|
+
_log.warning("%s: %s: %s", msg, type(exc).__name__, exc, exc_info=exc)
|
|
32
|
+
else:
|
|
33
|
+
_log.warning("%s (%s)", msg, {k: repr(v)[:200] for k, v in context.items() if k != "message"})
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def install(loop: "asyncio.AbstractEventLoop | None" = None) -> None:
|
|
37
|
+
"""Put the handler on ``loop`` (default: the running loop)."""
|
|
38
|
+
(loop or asyncio.get_running_loop()).set_exception_handler(handle_loop_exception)
|
|
@@ -24,6 +24,8 @@ async def run_marathon(cfg, mode: str, goal: str, *, sink=None, auth=None,
|
|
|
24
24
|
kernel MarathonWorkflow) and lets AgentSession attach the CLIENT-detected
|
|
25
25
|
verify_cmd. Non-dock (streams to a plain sink) so a headless / CI launch works;
|
|
26
26
|
the coding REPL (run_repl) is untouched."""
|
|
27
|
+
from webbee import loop_errors
|
|
28
|
+
loop_errors.install() # a server-reset socket is no error on screen (Windows Proactor, 2026-11-14)
|
|
27
29
|
if auth is None:
|
|
28
30
|
from imperal_mcp import auth as _auth
|
|
29
31
|
auth = _auth
|
|
@@ -1083,6 +1085,8 @@ async def run_repl(cfg, mode: str = "default", *, once: bool = False, sink=None,
|
|
|
1083
1085
|
(pane-only; Task 6 fills its content) alongside the first session slot;
|
|
1084
1086
|
the fallback (non-dock) path stays single-slot with NO Home, so every
|
|
1085
1087
|
existing fallback-path test keeps its world unchanged."""
|
|
1088
|
+
from webbee import loop_errors
|
|
1089
|
+
loop_errors.install() # a server-reset socket is no error on screen (Windows Proactor, 2026-11-14)
|
|
1086
1090
|
if auth is None:
|
|
1087
1091
|
from imperal_mcp import auth as _auth
|
|
1088
1092
|
auth = _auth
|
|
@@ -1227,10 +1231,24 @@ async def run_repl(cfg, mode: str = "default", *, once: bool = False, sink=None,
|
|
|
1227
1231
|
# 0.3.36: on Home `_sink` is None and login_device_flow's
|
|
1228
1232
|
# prompt path calls `.note(...)` -- `_SaySink` puts the device
|
|
1229
1233
|
# code + URL into Home's own pane instead of crashing.
|
|
1230
|
-
|
|
1231
|
-
|
|
1234
|
+
# live 2026-11-14 (Windows): an error inside the sign-in -- a reset connection on the e-mail lookup
|
|
1235
|
+
# after the tokens were already saved -- escaped as an unhandled loop exception ("Press ENTER"), the
|
|
1236
|
+
# dock still said signed out, and only a restart showed the user signed in
|
|
1237
|
+
try:
|
|
1238
|
+
email = await login_device_flow(
|
|
1239
|
+
cfg, auth, _sink if _sink is not None else _SaySink(slot))
|
|
1240
|
+
except Exception as e:
|
|
1241
|
+
if not (getattr(auth, "load_creds", None) and auth.load_creds()):
|
|
1242
|
+
_say(slot, f"Sign-in failed: {type(e).__name__}: {e} -- run /login again.")
|
|
1243
|
+
return "continue"
|
|
1244
|
+
email = "(signed in)" # the tokens are saved: only what came after them failed
|
|
1232
1245
|
state["logged_in"] = True
|
|
1233
1246
|
_say(slot, f"Signed in as {email}.")
|
|
1247
|
+
# what boot filled while signed out (Home's account, wallet, sessions) is filled again now, not after
|
|
1248
|
+
# its 5-minute staleness
|
|
1249
|
+
if slots.slots and getattr(slots.slots[0], "kind", "") == "home":
|
|
1250
|
+
_home = slots.slots[0]
|
|
1251
|
+
_home.bg_tasks.append(asyncio.ensure_future(home.fill_home(_home, **home_fill_kwargs)))
|
|
1234
1252
|
return "continue"
|
|
1235
1253
|
if res.action == "logout":
|
|
1236
1254
|
await auth.logout(cfg)
|