webbee 0.7.22__tar.gz → 0.7.24__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.22 → webbee-0.7.24}/CHANGELOG.md +14 -0
- {webbee-0.7.22 → webbee-0.7.24}/PKG-INFO +2 -1
- {webbee-0.7.22 → webbee-0.7.24}/pyproject.toml +3 -1
- webbee-0.7.24/src/webbee/__init__.py +1 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/session.py +25 -4
- webbee-0.7.24/src/webbee/stallwatch.py +123 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/tools.py +41 -2
- webbee-0.7.24/tests/test_result_fits_the_door.py +60 -0
- webbee-0.7.24/tests/test_stallwatch.py +79 -0
- {webbee-0.7.22 → webbee-0.7.24}/uv.lock +199 -1
- webbee-0.7.22/src/webbee/__init__.py +0 -1
- {webbee-0.7.22 → webbee-0.7.24}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/.github/pull_request_template.md +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/.github/workflows/os-check.yml +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/.github/workflows/publish.yml +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/.gitignore +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/LICENSE +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/PRIVACY.md +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/README.md +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/SECURITY.md +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/assets/architecture.png +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/assets/demo.gif +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/assets/hero.png +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/assets/social-preview.png +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/ci/__init__.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/ci/field_gate/__init__.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/ci/field_gate/drivers.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/ci/field_gate/fixture.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/ci/field_gate/fixture_long.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/ci/field_gate/fixture_wait.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/ci/field_gate/provision_user.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/ci/field_gate/registry.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/ci/field_gate/replay.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/ci/field_gate/run.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/ci/field_gate/scenarios_account.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/ci/field_gate/scenarios_code.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/ci/field_gate/scenarios_contract.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/ci/field_gate/scenarios_long.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/ci/field_gate/scenarios_wait.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/ci/field_gate/test_drivers.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/ci/field_gate/test_fixture.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/ci/field_gate/test_fixture_long.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/ci/field_gate/test_fixture_wait.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/ci/field_gate/test_registry.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/ci/field_gate/test_replay.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/ci/field_gate/wipe.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/ci/os_check.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/dev-webbee +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/install.sh +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/__main__.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/_launch.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/account.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/active_sessions.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/autoupdate.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/banner_art.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/boot.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/browser.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/checkpoints.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/cli.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/clipboard.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/clipboard_read.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/clipboard_session.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/coding_context.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/commands.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/config.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/consent.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/details.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/events.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/expand.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/frames.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/home.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/home_view.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/http.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/instance_lock.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/intel/__init__.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/intel/graph.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/intel/outline.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/intel/query.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/intel/service.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/intel/store.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/intel/tree.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/intel/watch.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/loop_errors.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/media.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/modals.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/mode_store.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/native_files.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/native_read.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/newtab_mode.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/output_pane.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/pricing_constants.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/queue_panel.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/reflow.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/remote.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/render.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/repl.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/repo.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/selection.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/sessions.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/sizing.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/slots.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/steer.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/stream.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/tab_store.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/tabs.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/thread.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/tier_store.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/todo_panel.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/tokens.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/tui.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/update.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/urlopen.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/wallet.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/src/webbee/worktrees.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/__init__.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/conftest.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_account.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_active_sessions.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_append_file.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_audit_2026_07_25_findings.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_autoupdate.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_checkpoints.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_checkpoints_nested_1030.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_cli.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_clipboard.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_clipboard_read.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_code_map_fresh.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_coding_context.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_commands.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_config.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_cpc_contract_stable.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_cpc_outline.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_cross_loop_token.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_details.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_events.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_expand.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_field_test_1113.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_freeze_fix.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_home.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_home_view.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_home_view_mouse.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_inspect_page.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_instance_lock.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_intel_any_folder.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_intel_cache_and_sync_worker.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_intel_checksum_tree.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_intel_chunker.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_intel_embed.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_intel_folder_1106.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_intel_graph.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_intel_no_numpy.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_intel_query.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_intel_service.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_intel_store.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_intel_watch.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_launch.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_loop_errors.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_marathon.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_modals_e2e.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_mode_and_remote_0_6_8.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_mode_store.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_native_files.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_newtab_mode.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_packaging.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_probe_cost.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_queue_manage_0337.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_reflow.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_remote_code_reads.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_render.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_repl.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_repo.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_resilient_http.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_review_fixes_1030.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_session.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_session_review_1030.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_sessions.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_sizing.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_slots.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_ssh_guard.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_steer.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_stream.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_tab_bar_stability.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_tab_restore_0337.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_tabs.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_terminal_ux_0336.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_thread.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_tier_invalidation.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_tier_store.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_todo_panel.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_tokens.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_tool_ack.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_tools.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_tools_eol_cancel_1030.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_tools_vision_websearch.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_tray_1126.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_tui.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_tui_hardening.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_update.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_update_badge_0340.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_urlopen.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_version.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_version_badge_corner.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_voice_outcome.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_wallet.py +0 -0
- {webbee-0.7.22 → webbee-0.7.24}/tests/test_worktrees.py +0 -0
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.7.24
|
|
4
|
+
|
|
5
|
+
* A result fits the door that takes it. The gateway takes a body of 1 MB while a result was cut at 4 MB, so a
|
|
6
|
+
bigger one (an image of 860 KB as base64) came back 413 and never reached the model. The bound is now the door's
|
|
7
|
+
(960 KB), and `view_image` sends an image over 600 KB smaller - whole, as JPEG, with its shown size named.
|
|
8
|
+
Pillow is a dependency now.
|
|
9
|
+
|
|
10
|
+
## 0.7.23
|
|
11
|
+
|
|
12
|
+
* The terminal writes down where it stands when it stops answering. A watch outside its event loop notes two facts -
|
|
13
|
+
the loop has not turned for 15 s, or one stage of a turn (running a tool, posting its result) has lasted 300 s -
|
|
14
|
+
and then writes every thread's stack once to `~/.cache/webbee/stalls/stall-<time>-<pid>.txt` and says so in the
|
|
15
|
+
terminal. `kill -USR1 <pid>` writes the same file on demand. Nothing is sent anywhere.
|
|
16
|
+
|
|
3
17
|
## 0.7.22
|
|
4
18
|
|
|
5
19
|
* Signing out by itself is closed in the shell (imperal-mcp 0.9.22, raised here): one token refresh at a time on a
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: webbee
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.24
|
|
4
4
|
Summary: Webbee 🐝 — the Imperal Cloud coding agent in your terminal
|
|
5
5
|
Project-URL: Homepage, https://imperal.io/webbee-code
|
|
6
6
|
Project-URL: Documentation, https://docs.imperal.io
|
|
@@ -33,6 +33,7 @@ Requires-Dist: httpx-sse>=0.4; python_version >= '3.10'
|
|
|
33
33
|
Requires-Dist: httpx>=0.27; python_version >= '3.10'
|
|
34
34
|
Requires-Dist: imperal-mcp>=0.9.22; python_version >= '3.10'
|
|
35
35
|
Requires-Dist: imperal-sdk[universal-index]>=6.7.1; python_version >= '3.10'
|
|
36
|
+
Requires-Dist: pillow>=10; python_version >= '3.10'
|
|
36
37
|
Requires-Dist: prompt-toolkit>=3; python_version >= '3.10'
|
|
37
38
|
Requires-Dist: rich>=13.7; python_version >= '3.10'
|
|
38
39
|
Requires-Dist: tree-sitter-javascript>=0.23; python_version >= '3.10' and (sys_platform != 'darwin' or platform_machine != 'x86_64' or python_version < '3.13')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "webbee"
|
|
3
|
-
version = "0.7.
|
|
3
|
+
version = "0.7.24"
|
|
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"
|
|
@@ -20,6 +20,8 @@ dependencies = [
|
|
|
20
20
|
'httpx-sse>=0.4; python_version >= "3.10"',
|
|
21
21
|
'rich>=13.7; python_version >= "3.10"',
|
|
22
22
|
'prompt_toolkit>=3; python_version >= "3.10"',
|
|
23
|
+
# an image is shown to the model within what one result can carry (tools.shrink_image) and drawn in the terminal
|
|
24
|
+
'pillow>=10; python_version >= "3.10"',
|
|
23
25
|
# --- code intelligence (CPC): the symbol/graph index is NOT optional ---
|
|
24
26
|
# Without these the indexer silently yields 0 symbols (boot.py degrades to
|
|
25
27
|
# intel=None), so repo_profile / graph_slice / search_code / impact_of_change
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.7.24"
|
|
@@ -64,7 +64,14 @@ _KERNEL_QUIET_END_S = 30 * 60.0
|
|
|
64
64
|
# code took any 4xx as delivered, so the kernel waited out its tool-wait
|
|
65
65
|
# expiry (up to ~65 min). A result is cut to this before it is posted, with an
|
|
66
66
|
# honest note of what was cut.
|
|
67
|
-
|
|
67
|
+
# The bound is the door's own (measured 2026-11-27: the gateway takes a body of 1 MiB -- nginx
|
|
68
|
+
# `client_max_body_size 1m` -- and a view_image result of 1 153 322 bytes came back 413 while this bound stood at
|
|
69
|
+
# 4 MB, so the cut never ran). A result is also one workflow signal, kept in the run's history: it stays small.
|
|
70
|
+
_RESULT_MAX_BYTES = 960 * 1024
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def _size_words(n: int) -> str:
|
|
74
|
+
return f"{n // (1024 * 1024)} MB" if n >= 1024 * 1024 else f"{n // 1024} KB"
|
|
68
75
|
|
|
69
76
|
# Executed-result record on disk (2026-10-30 review H6): attach() makes the
|
|
70
77
|
# kernel re-send the pending request, and the in-memory `seen` map is new for
|
|
@@ -107,7 +114,7 @@ def _cap_result(out: dict, limit: int = _RESULT_MAX_BYTES) -> dict:
|
|
|
107
114
|
if key == "image_data":
|
|
108
115
|
res["native_vision"] = False
|
|
109
116
|
notes.append(f"[image not sent: {size} bytes of image data is over the "
|
|
110
|
-
f"{limit
|
|
117
|
+
f"{_size_words(limit)} a result can carry -- shrink or crop it and view it again]")
|
|
111
118
|
else:
|
|
112
119
|
notes.append(f"[{key} not sent: {size} bytes]")
|
|
113
120
|
content = str(res.get("content", ""))
|
|
@@ -117,7 +124,7 @@ def _cap_result(out: dict, limit: int = _RESULT_MAX_BYTES) -> dict:
|
|
|
117
124
|
return capped
|
|
118
125
|
content_bytes = len(content.encode("utf-8"))
|
|
119
126
|
cut_note = (f"\n… [result cut: {content_bytes} bytes of output, only the start is sent -- "
|
|
120
|
-
f"a result can carry at most {limit
|
|
127
|
+
f"a result can carry at most {_size_words(limit)}]")
|
|
121
128
|
rest = {**res, "content": ""}
|
|
122
129
|
budget = limit - _json_bytes({"req_id": out.get("req_id"), "result": rest}) - _json_bytes(note + cut_note) - 1024
|
|
123
130
|
if budget < limit // 2: # other big fields (a huge diff) -- send only ok + the cut text
|
|
@@ -574,6 +581,13 @@ class AgentSession:
|
|
|
574
581
|
if line:
|
|
575
582
|
_loop.call_soon_threadsafe(_live, line)
|
|
576
583
|
executor.on_output = _heard
|
|
584
|
+
# where the terminal stands when it stops answering is written down by the terminal itself (stallwatch)
|
|
585
|
+
from webbee import stallwatch as _sw
|
|
586
|
+
|
|
587
|
+
def _stalled(path: str, why: str, _loop=loop, _note=getattr(sink, "note", None)) -> None:
|
|
588
|
+
if _note is not None:
|
|
589
|
+
_loop.call_soon_threadsafe(_note, f"⚠ the terminal stalled: {why} — the stacks are in {path}")
|
|
590
|
+
_sw.ensure(loop, on_stall=_stalled)
|
|
577
591
|
_last_own = loop.time() # M7: the turn's own last activity
|
|
578
592
|
_quiet_noted = False
|
|
579
593
|
_held_final = "" # the newest answer of a marathon turn, shown if a stop follows it
|
|
@@ -693,6 +707,7 @@ class AgentSession:
|
|
|
693
707
|
pass
|
|
694
708
|
if tool in _WRITE_TIER:
|
|
695
709
|
await asyncio.to_thread(store.mark_started, rid, tool)
|
|
710
|
+
_sw.mark(f"tool {tool}")
|
|
696
711
|
try:
|
|
697
712
|
out = await asyncio.to_thread(handle_tool_request, frame, executor)
|
|
698
713
|
except asyncio.CancelledError:
|
|
@@ -700,6 +715,8 @@ class AgentSession:
|
|
|
700
715
|
# kill the command it runs, then let the cancel through.
|
|
701
716
|
_cancel_running(executor)
|
|
702
717
|
raise
|
|
718
|
+
finally:
|
|
719
|
+
_sw.mark("")
|
|
703
720
|
out = _cap_result(out)
|
|
704
721
|
# H6: written BEFORE the post -- a crash after this line
|
|
705
722
|
# re-sends the result instead of running the tool again.
|
|
@@ -728,7 +745,11 @@ class AgentSession:
|
|
|
728
745
|
except Exception:
|
|
729
746
|
pass
|
|
730
747
|
_remember(seen, rid, out)
|
|
731
|
-
|
|
748
|
+
_sw.mark(f"post the result of {tool}")
|
|
749
|
+
try:
|
|
750
|
+
await self._post_result(client, session_id, out, sink=sink, tool=tool)
|
|
751
|
+
finally:
|
|
752
|
+
_sw.mark("")
|
|
732
753
|
_last_own, _quiet_noted = loop.time(), False
|
|
733
754
|
|
|
734
755
|
elif ftype == "confirm_request":
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"""Where the terminal stands when it stops answering -- written down by the terminal itself.
|
|
2
|
+
|
|
3
|
+
Live 2026-11-26/27, five times in one day on one machine: the kernel sent a command, the terminal never answered and
|
|
4
|
+
never said why; the connection stayed open. From the outside nothing tells where the client stood -- its event loop
|
|
5
|
+
blocked, a tool that never returned, a result that could not be posted. So the client says it: a thread outside the
|
|
6
|
+
loop watches two facts and, when one of them holds too long, writes every thread's stack to a file once.
|
|
7
|
+
|
|
8
|
+
* the LOOP does not turn: a callback handed to it is not run within ``LOOP_S``;
|
|
9
|
+
* a STAGE lasts too long: the turn said what it is doing (``mark("tool bash")``, ``mark("post result")``) and has
|
|
10
|
+
not said anything else for ``STAGE_S``.
|
|
11
|
+
|
|
12
|
+
The file is ``~/.cache/webbee/stalls/stall-<time>.txt``: the stage, how long, the version, the stacks. Nothing is
|
|
13
|
+
sent anywhere; the person (or `webbee doctor`) reads it. ``SIGUSR1`` writes the same file on demand where the
|
|
14
|
+
platform has it. Python 3.7 syntax; never raises into the client."""
|
|
15
|
+
import faulthandler
|
|
16
|
+
import os
|
|
17
|
+
import sys
|
|
18
|
+
import threading
|
|
19
|
+
import time
|
|
20
|
+
|
|
21
|
+
LOOP_S = 15.0 # a blocked loop is a frozen terminal: said after this long
|
|
22
|
+
STAGE_S = 300.0 # a tool of five minutes is long but real; the stack then shows what it waits on
|
|
23
|
+
TICK_S = 1.0
|
|
24
|
+
KEPT = 20 # stall files kept (newest)
|
|
25
|
+
|
|
26
|
+
_state = {"stage": "", "since": 0.0, "beat": 0.0, "started": False, "dir": ""}
|
|
27
|
+
_lock = threading.Lock()
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def stalls_dir() -> str:
|
|
31
|
+
return _state["dir"] or os.path.join(os.path.expanduser("~"), ".cache", "webbee", "stalls")
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def mark(stage: str = "") -> None:
|
|
35
|
+
"""What the turn is doing now ("" -- nothing that can stall: it is reading the stream)."""
|
|
36
|
+
with _lock:
|
|
37
|
+
_state["stage"], _state["since"] = str(stage or ""), time.monotonic()
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def _version() -> str:
|
|
41
|
+
try:
|
|
42
|
+
from webbee import __version__
|
|
43
|
+
return str(__version__)
|
|
44
|
+
except Exception:
|
|
45
|
+
return "?"
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def dump(why: str, directory: str = "") -> str:
|
|
49
|
+
"""Write every thread's stack to a new file; its path, or "" when it could not be written."""
|
|
50
|
+
try:
|
|
51
|
+
d = directory or stalls_dir()
|
|
52
|
+
os.makedirs(d, exist_ok=True)
|
|
53
|
+
path = os.path.join(d, "stall-%s-%d.txt" % (time.strftime("%Y%m%d-%H%M%S"), os.getpid()))
|
|
54
|
+
with open(path, "w") as f:
|
|
55
|
+
f.write("webbee %s python %s pid %d\n%s\nthreads:\n" % (
|
|
56
|
+
_version(), sys.version.split()[0], os.getpid(), why))
|
|
57
|
+
f.flush()
|
|
58
|
+
faulthandler.dump_traceback(file=f, all_threads=True)
|
|
59
|
+
old = sorted(n for n in os.listdir(d) if n.startswith("stall-"))[:-KEPT]
|
|
60
|
+
for n in old:
|
|
61
|
+
try:
|
|
62
|
+
os.unlink(os.path.join(d, n))
|
|
63
|
+
except OSError:
|
|
64
|
+
pass
|
|
65
|
+
return path
|
|
66
|
+
except Exception:
|
|
67
|
+
return ""
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def verdict(now: float, beat: float, stage: str, since: float, loop_s: float = LOOP_S, stage_s: float = STAGE_S) -> str:
|
|
71
|
+
"""PURE. Why the client is stalled at ``now``, or "" while it is not."""
|
|
72
|
+
if now - beat >= loop_s:
|
|
73
|
+
return "the event loop has not turned for %.0f s (stage: %s)" % (now - beat, stage or "reading the stream")
|
|
74
|
+
if stage and now - since >= stage_s:
|
|
75
|
+
return "the stage '%s' has lasted %.0f s" % (stage, now - since)
|
|
76
|
+
return ""
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def ensure(loop, on_stall=None, loop_s: float = LOOP_S, stage_s: float = STAGE_S, tick: float = TICK_S,
|
|
80
|
+
directory: str = "") -> bool:
|
|
81
|
+
"""Start the watch for this process once. ``on_stall(path, why)`` is called from the watch thread after a file
|
|
82
|
+
was written (a surface may show a note). False when it was already running."""
|
|
83
|
+
with _lock:
|
|
84
|
+
if _state["started"]:
|
|
85
|
+
return False
|
|
86
|
+
_state["started"], _state["beat"], _state["dir"] = True, time.monotonic(), directory
|
|
87
|
+
|
|
88
|
+
def pong() -> None:
|
|
89
|
+
_state["beat"] = time.monotonic()
|
|
90
|
+
|
|
91
|
+
def watch() -> None:
|
|
92
|
+
said = ""
|
|
93
|
+
while True:
|
|
94
|
+
time.sleep(tick)
|
|
95
|
+
try:
|
|
96
|
+
if loop.is_closed():
|
|
97
|
+
return
|
|
98
|
+
loop.call_soon_threadsafe(pong)
|
|
99
|
+
except Exception:
|
|
100
|
+
return
|
|
101
|
+
with _lock:
|
|
102
|
+
stage, since = _state["stage"], _state["since"]
|
|
103
|
+
why = verdict(time.monotonic(), _state["beat"], stage, since, loop_s, stage_s)
|
|
104
|
+
key = why.split(" for ")[0].split(" has lasted ")[0] # one file per stall, not one a second
|
|
105
|
+
if why and key != said:
|
|
106
|
+
said = key
|
|
107
|
+
path = dump(why, directory)
|
|
108
|
+
if path and on_stall is not None:
|
|
109
|
+
try:
|
|
110
|
+
on_stall(path, why)
|
|
111
|
+
except Exception:
|
|
112
|
+
pass
|
|
113
|
+
elif not why:
|
|
114
|
+
said = ""
|
|
115
|
+
|
|
116
|
+
threading.Thread(target=watch, name="webbee-stall-watch", daemon=True).start()
|
|
117
|
+
try: # on demand, where the platform has the signal
|
|
118
|
+
import signal
|
|
119
|
+
if hasattr(signal, "SIGUSR1"):
|
|
120
|
+
signal.signal(signal.SIGUSR1, lambda *_: dump("asked for by SIGUSR1 (stage: %s)" % (_state["stage"] or "-")))
|
|
121
|
+
except Exception:
|
|
122
|
+
pass
|
|
123
|
+
return True
|
|
@@ -1397,11 +1397,18 @@ class LocalToolExecutor:
|
|
|
1397
1397
|
try:
|
|
1398
1398
|
with open(p, "rb") as f:
|
|
1399
1399
|
raw_bytes = f.read()
|
|
1400
|
-
b64_img = base64.b64encode(raw_bytes).decode("ascii")
|
|
1401
1400
|
except Exception as e:
|
|
1402
1401
|
return {"ok": False, "content": f"failed to read image: {e}"}
|
|
1402
|
+
# an image over what one result can carry is sent smaller, and said so (2026-11-27: a cover of 864 KB came
|
|
1403
|
+
# back 413 -- the model then shrank it by hand with a script)
|
|
1404
|
+
shrunk = ""
|
|
1405
|
+
if len(raw_bytes) > IMAGE_MAX_BYTES:
|
|
1406
|
+
small = shrink_image(raw_bytes, IMAGE_MAX_BYTES)
|
|
1407
|
+
if small is not None:
|
|
1408
|
+
raw_bytes, mime, shrunk = small[0], "image/jpeg", f" · shown as {small[1]}x{small[2]} JPEG"
|
|
1409
|
+
b64_img = base64.b64encode(raw_bytes).decode("ascii")
|
|
1403
1410
|
|
|
1404
|
-
head = f"⟦ {rel} · {human_size(size)} · {mime or 'image'} ⟧"
|
|
1411
|
+
head = f"⟦ {rel} · {human_size(size)} · {mime or 'image'}{shrunk} ⟧"
|
|
1405
1412
|
|
|
1406
1413
|
fallback_text = ""
|
|
1407
1414
|
if self.client_factory is not None:
|
|
@@ -1424,6 +1431,38 @@ class LocalToolExecutor:
|
|
|
1424
1431
|
return out
|
|
1425
1432
|
|
|
1426
1433
|
|
|
1434
|
+
# What one image may weigh in a result: base64 grows it by a third, and the result door takes 960 KB in all
|
|
1435
|
+
# (session._RESULT_MAX_BYTES) -- the rest is left for the text beside it.
|
|
1436
|
+
IMAGE_MAX_BYTES = 600 * 1024
|
|
1437
|
+
|
|
1438
|
+
|
|
1439
|
+
def shrink_image(raw: bytes, limit: int = IMAGE_MAX_BYTES):
|
|
1440
|
+
"""``(jpeg_bytes, width, height)`` of the image made to fit ``limit``, or None when it cannot be done here
|
|
1441
|
+
(no Pillow, not an image it reads). The whole picture is kept: first the quality goes down, then the size."""
|
|
1442
|
+
try:
|
|
1443
|
+
import io
|
|
1444
|
+
from PIL import Image
|
|
1445
|
+
im = Image.open(io.BytesIO(raw))
|
|
1446
|
+
im.load()
|
|
1447
|
+
if im.mode not in ("RGB", "L"):
|
|
1448
|
+
flat = Image.new("RGB", im.size, (255, 255, 255))
|
|
1449
|
+
rgba = im.convert("RGBA")
|
|
1450
|
+
flat.paste(rgba, mask=rgba.split()[3])
|
|
1451
|
+
im = flat
|
|
1452
|
+
for _ in range(8):
|
|
1453
|
+
for quality in (85, 70):
|
|
1454
|
+
buf = io.BytesIO()
|
|
1455
|
+
im.save(buf, format="JPEG", quality=quality, optimize=True)
|
|
1456
|
+
if buf.tell() <= limit:
|
|
1457
|
+
return buf.getvalue(), im.size[0], im.size[1]
|
|
1458
|
+
if min(im.size) < 64:
|
|
1459
|
+
return None
|
|
1460
|
+
im = im.resize((max(1, im.size[0] * 3 // 4), max(1, im.size[1] * 3 // 4)))
|
|
1461
|
+
return None
|
|
1462
|
+
except Exception:
|
|
1463
|
+
return None
|
|
1464
|
+
|
|
1465
|
+
|
|
1427
1466
|
# ── code graph everywhere (plan 3 Task 5): the user's own SSH feeds the vault's graph ───────────────
|
|
1428
1467
|
|
|
1429
1468
|
def _run_async(coro):
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"""A result fits the door that takes it (2026-11-27).
|
|
2
|
+
|
|
3
|
+
Live: a view_image result of 1 153 322 bytes came back 413 -- the gateway takes a body of 1 MiB while the client cut
|
|
4
|
+
a result at 4 MB, so its cut never ran. The bound is the door's; an image over it is sent smaller and said so."""
|
|
5
|
+
import base64
|
|
6
|
+
import io
|
|
7
|
+
import os
|
|
8
|
+
|
|
9
|
+
import pytest
|
|
10
|
+
|
|
11
|
+
from webbee import session as S
|
|
12
|
+
from webbee import tools as T
|
|
13
|
+
|
|
14
|
+
DOOR_BYTES = 1024 * 1024 # nginx client_max_body_size 1m on the gateway, measured 2026-11-27
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def test_the_result_bound_is_under_the_door():
|
|
18
|
+
assert S._RESULT_MAX_BYTES < DOOR_BYTES
|
|
19
|
+
assert T.IMAGE_MAX_BYTES * 4 // 3 + 64 * 1024 < S._RESULT_MAX_BYTES # base64 of an image, and text beside it
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def test_a_result_over_the_door_is_cut_and_names_the_bound_in_its_own_unit():
|
|
23
|
+
out = {"req_id": "r1", "result": {"ok": True, "native_vision": True, "image_data": "A" * 1_153_000,
|
|
24
|
+
"content": "pic"}}
|
|
25
|
+
capped = S._cap_result(out)
|
|
26
|
+
assert S._json_bytes(capped) <= S._RESULT_MAX_BYTES and "image_data" not in capped["result"]
|
|
27
|
+
assert "960 KB a result can carry" in capped["result"]["content"] and "0 MB" not in capped["result"]["content"]
|
|
28
|
+
assert S._size_words(4 * 1024 * 1024) == "4 MB" and S._size_words(100_000) == "97 KB"
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def _noise_png(side):
|
|
32
|
+
Image = pytest.importorskip("PIL.Image")
|
|
33
|
+
im = Image.frombytes("RGB", (side, side), os.urandom(side * side * 3))
|
|
34
|
+
buf = io.BytesIO()
|
|
35
|
+
im.save(buf, format="PNG")
|
|
36
|
+
return buf.getvalue()
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def test_an_image_over_the_bound_is_sent_smaller_whole_and_said(tmp_path):
|
|
40
|
+
Image = pytest.importorskip("PIL.Image")
|
|
41
|
+
raw = _noise_png(900)
|
|
42
|
+
assert len(raw) > T.IMAGE_MAX_BYTES
|
|
43
|
+
(tmp_path / "big.png").write_bytes(raw)
|
|
44
|
+
out = T.LocalToolExecutor(str(tmp_path))._t_view_image({"path": "big.png"})
|
|
45
|
+
sent = base64.b64decode(out["image_data"])
|
|
46
|
+
assert out["ok"] and out["mime_type"] == "image/jpeg" and len(sent) <= T.IMAGE_MAX_BYTES
|
|
47
|
+
w, h = Image.open(io.BytesIO(sent)).size
|
|
48
|
+
assert w == h and f"shown as {w}x{h} JPEG" in out["content"] # the whole picture, its sides kept
|
|
49
|
+
assert S._cap_result({"req_id": "r", "result": out})["result"].get("image_data") # and it passes the door
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def test_a_small_image_goes_as_it_is(tmp_path):
|
|
53
|
+
raw = _noise_png(64)
|
|
54
|
+
(tmp_path / "s.png").write_bytes(raw)
|
|
55
|
+
out = T.LocalToolExecutor(str(tmp_path))._t_view_image({"path": "s.png"})
|
|
56
|
+
assert base64.b64decode(out["image_data"]) == raw and "shown as" not in out["content"]
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def test_what_cannot_be_shrunk_is_left_to_the_cut(monkeypatch):
|
|
60
|
+
assert T.shrink_image(b"not an image at all" * 100) is None
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"""The terminal writes down where it stands when it stops answering (2026-11-27).
|
|
2
|
+
|
|
3
|
+
Five times in one day the kernel sent a command and the terminal never answered; nothing told where it stood. A
|
|
4
|
+
thread outside the event loop watches whether the loop turns and how long the turn's stage has lasted, and writes
|
|
5
|
+
every thread's stack to a file once per stall."""
|
|
6
|
+
import asyncio
|
|
7
|
+
import os
|
|
8
|
+
import threading
|
|
9
|
+
import time
|
|
10
|
+
|
|
11
|
+
from webbee import stallwatch as sw
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def test_the_verdict_is_a_fact_of_two_clocks():
|
|
15
|
+
assert sw.verdict(100.0, 99.0, "", 0.0) == "" # the loop turns, no stage
|
|
16
|
+
assert sw.verdict(100.0, 99.0, "tool bash", 90.0) == "" # a stage of ten seconds
|
|
17
|
+
assert "event loop has not turned for 20 s" in sw.verdict(100.0, 80.0, "", 0.0)
|
|
18
|
+
assert "reading the stream" in sw.verdict(100.0, 80.0, "", 0.0)
|
|
19
|
+
assert sw.verdict(1000.0, 999.5, "tool bash", 600.0) == "the stage \'tool bash\' has lasted 400 s"
|
|
20
|
+
assert "tool bash" in sw.verdict(1000.0, 900.0, "tool bash", 990.0) # a blocked loop names its stage
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def test_a_dump_names_the_reason_and_every_thread(tmp_path):
|
|
24
|
+
hold = threading.Event()
|
|
25
|
+
t = threading.Thread(target=hold.wait, name="a-waiting-thread", daemon=True)
|
|
26
|
+
t.start()
|
|
27
|
+
try:
|
|
28
|
+
path = sw.dump("the stage \'tool bash\' has lasted 400 s", str(tmp_path))
|
|
29
|
+
finally:
|
|
30
|
+
hold.set()
|
|
31
|
+
text = open(path).read()
|
|
32
|
+
assert path.startswith(str(tmp_path)) and os.path.basename(path).startswith("stall-")
|
|
33
|
+
assert "tool bash" in text and "webbee " in text and "threads:" in text
|
|
34
|
+
assert text.count("Thread 0x") + text.count("Current thread") >= 2 and "wait" in text
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def test_only_the_newest_files_are_kept(tmp_path):
|
|
38
|
+
for i in range(sw.KEPT + 5):
|
|
39
|
+
open(os.path.join(str(tmp_path), "stall-20260101-0000%02d-1.txt" % i), "w").close()
|
|
40
|
+
sw.dump("x", str(tmp_path))
|
|
41
|
+
assert len(os.listdir(str(tmp_path))) == sw.KEPT
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def test_a_blocked_loop_is_written_down_once_and_a_running_one_never(tmp_path, monkeypatch):
|
|
45
|
+
monkeypatch.setitem(sw._state, "started", False)
|
|
46
|
+
said = []
|
|
47
|
+
|
|
48
|
+
async def main():
|
|
49
|
+
loop = asyncio.get_running_loop()
|
|
50
|
+
assert sw.ensure(loop, on_stall=lambda path, why: said.append((path, why)),
|
|
51
|
+
loop_s=0.3, stage_s=60.0, tick=0.05, directory=str(tmp_path)) is True
|
|
52
|
+
assert sw.ensure(loop) is False # one watch a process
|
|
53
|
+
await asyncio.sleep(0.5) # the loop turns: nothing is written
|
|
54
|
+
assert said == []
|
|
55
|
+
sw.mark("tool bash")
|
|
56
|
+
time.sleep(0.9) # the loop is BLOCKED (a sync wait on it)
|
|
57
|
+
sw.mark("")
|
|
58
|
+
await asyncio.sleep(0.2)
|
|
59
|
+
|
|
60
|
+
asyncio.run(main())
|
|
61
|
+
assert len(said) == 1 and "event loop has not turned" in said[0][1] and "tool bash" in said[0][1]
|
|
62
|
+
text = open(said[0][0]).read() # the stack names the place that blocks the loop
|
|
63
|
+
assert " in main" in text and "test_stallwatch.py" in text and "webbee-stall-watch" not in said[0][1]
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def test_a_stage_that_lasts_too_long_is_written_down_while_the_loop_turns(tmp_path, monkeypatch):
|
|
67
|
+
monkeypatch.setitem(sw._state, "started", False)
|
|
68
|
+
said = []
|
|
69
|
+
|
|
70
|
+
async def main():
|
|
71
|
+
sw.ensure(asyncio.get_running_loop(), on_stall=lambda path, why: said.append(why),
|
|
72
|
+
loop_s=60.0, stage_s=0.3, tick=0.05, directory=str(tmp_path))
|
|
73
|
+
sw.mark("tool read_file")
|
|
74
|
+
await asyncio.sleep(0.8) # the loop turns, the stage does not end
|
|
75
|
+
sw.mark("")
|
|
76
|
+
await asyncio.sleep(0.2)
|
|
77
|
+
|
|
78
|
+
asyncio.run(main())
|
|
79
|
+
assert len(said) == 1 and said[0].startswith("the stage \'tool read_file\' has lasted")
|