Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

perf(ci): remove repeated test setup and parallelize install suites (#1882)

Call White1ec7842f113d
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index f3deb0e83..b0868d04b 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -114,6 +114,7 @@ jobs:
unit-test-shards:
name: unit-tests (${{ matrix.shard }}/${{ matrix.shard-total }})
runs-on: ubuntu-latest
+ timeout-minutes: 20
strategy:
fail-fast: false
matrix:
@@ -266,9 +267,14 @@ jobs:
working-directory: npm/avibe
run: npm pack --dry-run
- install-upgrade-regression:
+ install-upgrade-shards:
+ name: install-upgrade-regression (${{ matrix.suite }})
runs-on: ubuntu-latest
needs: build-linux-artifacts
+ strategy:
+ fail-fast: false
+ matrix:
+ suite: [packaged-memory, installer]
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
@@ -303,6 +309,7 @@ jobs:
run: python scripts/prepare_local_show_runtime_manifest.py
- name: Run packaged Memory package-shape smoke
+ if: matrix.suite == 'packaged-memory'
run: |
set -o pipefail
test -f vibe/show_runtime_manifest.json
@@ -314,6 +321,7 @@ jobs:
fi
- name: Run install and upgrade regressions
+ if: matrix.suite == 'installer'
run: |
docker info
export VIBE_INSTALL_TEST_WHEEL="$(ls dist/*.whl)"
@@ -324,6 +332,21 @@ jobs:
tests/e2e/test_upgrade_command.py \
-v
+ install-upgrade-regression:
+ runs-on: ubuntu-latest
+ needs: install-upgrade-shards
+ if: always()
+ steps:
+ - name: Verify all install and upgrade suites
+ env:
+ INSTALL_RESULT: ${{ needs['install-upgrade-shards'].result }}
+ run: |
+ if [ "$INSTALL_RESULT" != "success" ]; then
+ echo "Install/upgrade suites finished with result: $INSTALL_RESULT"
+ exit 1
+ fi
+ echo "All install and upgrade suites passed."
+
windows-install-smoke:
runs-on: windows-latest
needs: build-linux-artifacts
diff --git a/core/show_runtime.py b/core/show_runtime.py
index 0ef34b368..5c77f39a4 100644
--- a/core/show_runtime.py
+++ b/core/show_runtime.py
@@ -96,7 +96,9 @@ _SKIPPED_ARCHIVE_REASON_REMOVAL_FAILED = "archive_removal_failed"
_ARCHIVE_CLEANUP_OUTCOMES = frozenset({"cleaned", "partial", "skipped"})
_INSTALL_REFERENCE_RE = re.compile(r"^[0-9a-f]{32}\.lock$")
_INSTALL_REFERENCE_LOCKS: dict[tuple[str, str], "_ShowRuntimeInstallReference"] = {}
-_INSTALL_REFERENCE_LOCKS_GUARD = threading.Lock()
+# Allocations inside the guard can collect a manager and run its finalizer
+# synchronously on the same thread.
+_INSTALL_REFERENCE_LOCKS_GUARD = threading.RLock()
class _ArchiveMetadataError(Exception):
@@ -2182,13 +2184,8 @@ class ShowRuntimeManager:
return True
key = (str(runtime_root), str(resolved))
with _INSTALL_REFERENCE_LOCKS_GUARD:
- local_markers = {
- reference.marker
- for reference_key, reference in _INSTALL_REFERENCE_LOCKS.items()
- if reference_key == key
- }
- if local_markers:
- return True
+ if key in _INSTALL_REFERENCE_LOCKS:
+ return True
reference_dir = self._install_reference_dir(resolved)
try:
diff --git a/docs/plans/ci-test-runtime.md b/docs/plans/ci-test-runtime.md
new file mode 100644
index 000000000..33e83dec5
--- /dev/null
+++ b/docs/plans/ci-test-runtime.md
@@ -0,0 +1,233 @@
+# CI Test Runtime
+
+## Goal and invariants
+
+Reduce mandatory CI wall time and sensitivity to slow runners without removing
+test coverage, weakening failure propagation, or sharing mutable test state.
+This continues the critical-path work in #1879. No application deployment,
+release, running service, or remote regression environment is in scope.
+
+- Every existing unit test remains selected exactly once across the shards.
+- Test files continue to run in independent Python processes.
+- Each test retains its own home, database, and mutable resources.
+- Migration/import tests still exercise real initialization from unseeded state.
+- All existing UI, packaging, migration, Windows, and installation gates remain
+ mandatory; a missing or non-successful dependency cannot become a green gate.
+- Performance claims distinguish CI measurements from local profiles and estimates.
+
+## Diagnosis
+
+At source `928924dd82bb48c7eea67ff06ddd844d442cb2a1`, master CI run
+33956553276 passed but took 17m38s. The equivalent PR run 33955817335 took
+8m26s. The slow shard spent 545s in Harness failure visibility tests versus
+232s in the PR run; several other files on that same runner slowed as well.
+The available logs do not establish whether the extra latency was CPU, disk,
+or another runner resource. Do not hide it behind retries or claim stable
+eight-minute builds from one sample.
+
+A local full-file cProfile run of all 224 Harness tests measured 110.61s:
+70.94s in migrations, including 179 background database initializations.
+Ordinary business tests use explicit temporary database paths, which do not
+receive the existing default-home database template. The full migration chain
+is repeated even though these assertions concern Harness behavior at head.
+Unprofiled local baselines: Harness 63.65s, scheduling 85.39s (489 tests).
+
+The shared cleanup fixtures also import the Web server and SQLite importer into
+otherwise unrelated test processes. A small two-test workflow contract profile
+spent 0.55s loading/clearing OAuth state and 0.18s loading/clearing SQLite state.
+With one interpreter per file, eager cleanup imports repeat across the suite.
+
+## Chosen scope
+
+Reuse the existing migrated, checkpointed template through an opt-in database
+factory for business tests. Copy into newly created paths under the current
+test's temporary directory only, refuse overwrites, and keep every copy private.
+The two slow Harness/scheduling modules seed their explicit fixture paths;
+`no_sqlite_template` still leaves migration cases unseeded. Do not patch production
+database constructors, disable SQLite durability, or mock migration assertions.
+
+Reset only loaded cache owners, both before and after the test. Resolve owners
+again during teardown so a module first imported inside the test is also reset.
+Contract tests cover complete template identity, mutation isolation, path safety,
+overwrite refusal, migration opt-out, and lazy cleanup lifecycle behavior.
+
+The build-to-install chain in the master baseline finishes around 7m45s;
+more unit shards alone cannot remove that bound. Packaged Memory smoke and
+installer regressions share an input artifact, not mutable state or outputs.
+Run them as two independent matrix jobs, each with its own runner, retaining
+the existing required `install-upgrade-regression` check as an always-running,
+fail-closed aggregate. Both suites keep the same test commands, artifact source,
+and real environment checks. The expected check set grows from 15 to 17.
+
+## Evidence
+
+Local unprofiled comparisons, with every original assertion retained:
+
+| Suite | Tests | Before | After |
+| --- | ---: | ---: | ---: |
+| Harness failure visibility | 224 | 63.65s | 20.54s |
+| Scheduling | 489 | 85.39s | 49.45s |
+
+Real migration suite: 128 passed. Consuming suites run in separate processes:
+Web API 114 passed, authorization 68 passed, scheduled dispatch 89 passed plus
+14 subtests. Source/workflow package contracts: 14 passed; seven actual-artifact
+contracts require CI-built distributions. Ruff 0.4.9 and dependency checks passed.
+
+Record complete CI job timestamps and exact-head review inventory before final
+delivery. A runner-specific cause for the observed slowdown remains unproven until
+measured directly. Local reductions are not a prediction of CI wall-time savings.
+
+### First CI correction
+
+Run 33959161877 exposed a missing shared prerequisite after the matrix split:
+the installer suite's released-generation upgrade test also builds source wheels,
+so it needs the Show Runtime manifest just like the packaged Memory suite.
+Manifest preparation must run unconditionally on both isolated runners. Keep the
+real source-wheel build and the failure, rather than replacing it with an artifact
+shortcut or allowing that case to skip. The workflow contract now asserts this
+shared preparation explicitly. This is a CI finding; review-head counts are
+recorded separately from CI failures.
+
+The consuming upgrade helper was then run locally with the verified release
+manifest and built both real `9999.0.0` core and Memory wheels successfully.
+Workflow/fixture contracts passed again (16 tests). The unauthenticated manifest
+fetch hit a GitHub rate limit locally; the existing validator was used with an
+authenticated `gh` transport, preserving release digest and schema validation.
+
+### Measured rebalance
+
+All six unit shards in run 33959161877 passed. Their complete logs contain all
+398 discovered files exactly once and no failing file exit codes. Harness took
+51s and scheduling 88s, versus 232s and 188s in run 33955817335. Per-file totals
+across the six runners were 289s, 318s, 335s, 354s, 364s and 373s. The whole
+workflow was **not** green because of the manifest failure above.
+
+The orchestrator extends scope to `scripts/ci_unit_test_timings.json`, refreshing
+the complete measured snapshot from those successful unit jobs. The existing
+planner replays that sample at 339-340s per shard; this is a balancing estimate,
+not an observed CI duration. The algorithm and discovery rules remain unchanged.
+
+Review inventory: head `cfe16d930f` passed via bot comment 5551035775, complete
+review/thread collections empty. Zero findings-bearing review heads. The next
+push needs its own exact-head review and fully successful CI.
+
+### Clean-run tail diagnosis
+
+Head `305f19859c` passed review (comment 5551088001), all 17 checks, and
+all whole-PR thread checks: zero findings-bearing heads and zero threads.
+Run 33959745089 took 8m58s, not an improvement over the earlier 8m26s PR
+sample. The build completed in 3m22s; the two installation suites took 2m20s
+and 2m03s in parallel. Five unit jobs finished in 4m45s-6m23s, but shard zero
+took 8m50s. All 398 files ran exactly once without failing file exit codes.
+
+The archive module on the longest shard grew from 27s to 86s between the two
+CI samples. A local profile independently found 14.915s in migrations out of
+16.738s overall, with 47 migration calls for 41 behavioral cases. The unprofiled
+baseline was 11.05s. This does not establish the runner-specific cause of the
+CI variance, but it demonstrates removable migration work in another consumer.
+
+The orchestrator extends scope only to `tests/test_vibe_agent_archive.py`,
+opting it into the same private database factory. Keep every existing transaction,
+write-lock race, immutable-snapshot and rollback assertion intact. Migration tests
+remain unseeded. Do not rebalance again from this single runner-skewed sample,
+increase runner count, or change production migration behavior.
+
+After the archive fixture change, all 41 cases passed in 2.35s (11.05s baseline).
+Fixture/workflow/shard contracts passed again; the existing timing snapshot is
+unchanged and the next exact-head CI run will measure the actual overall effect.
+
+### Asynchronous UI test boundary
+
+Head `fae385e6ea` passed bot review (comment 5551151290), with no review threads
+or findings-bearing heads. Run 33960329173 completed in 6m18s; all six Python
+shards passed in 5m42s-6m08s, as did both installation suites. The workflow still
+failed because the modified-Escape Composer test expected an abort callback
+before the plain-Escape listener handled the event; the aggregate correctly failed.
+Do not report this failed workflow as a delivered six-minute CI result.
+
+The focused nine-test file and the entire local UI suite (283 files, 3766 tests)
+pass without changes, so the CI failure has not been reproduced deterministically.
+Inspection shows recording starts across resolved promises, while plain Escape
+uses a passive effect listener. The test used synchronous `fireEvent`, then DOM
+queries, neither of which explicitly flushes the whole asynchronous interaction.
+This is consistent with a listener-registration race, not proof of a product bug.
+
+The orchestrator extends scope to `Composer.shortcut.test.tsx` only: wrap the
+recording-start interaction in awaited asynchronous `act`, as specified by
+React's [test interaction contract](https://react.dev/reference/react/act).
+Preserve every finish/abort assertion and real event listener. Do not add sleeps,
+retries, relaxed expectations, or production changes. Verify focused and full UI
+tests again and obtain new exact-head CI/review evidence before merge.
+
+After the interaction-boundary change: 17 focused shortcut/listener tests and
+all 283 UI files / 3766 tests passed. Theme validation, lint baseline, test type
+checking and production build passed. In the prior failed run, archive measured
+9s (86s before the private fixture); all 398 Python files still ran exactly once.
+
+### Stalled shard and finalizer deadlock
+
+Run 33961006183 passed UI and all other independent jobs, but shard 4 stopped
+inside `test_ui_show_pages.py` after its 77% progress line at 10:41:25Z. The
+orchestrator cancelled the run at 12:33Z after the log API returned BlobNotFound
+and the unauthenticated Web page could not expose live logs. Cancellation was
+acknowledged immediately and archived logs became available: this was a stuck
+test process, not a runner that could no longer receive commands. No blind
+rerun was requested. This cancelled run is not performance evidence.
+
+The normal local 559-test Show suite passed. A deterministic fault-injection
+probe then collected an unreachable cyclic ShowRuntimeManager during
+`_retain_install_dir_locked`. Its weakref finalizer synchronously called
+`_release_install_reference_owner`, which tried to acquire the same non-reentrant
+registry lock. A three-second faulthandler deadline captured both frames on the
+same thread. This proves a production deadlock in the affected test region;
+the original CI run had no stack dump, so its exact stopped instruction remains
+unavailable. Increased garbage-collection frequency alone did not reproduce it.
+
+The orchestrator extends scope to the existing Show registry owner and its
+consumer tests: use a reentrant guard for synchronous finalizers, and use direct
+key membership instead of iterating the registry to find one install. Preserve
+cross-thread exclusion, file-lock ownership and retention of live installations.
+Regression coverage forces collection inside reference publication and verifies
+that stale references are released while live references remain protected.
+
+Independently close the unbounded CI wait: the existing per-file launcher prints
+the current file/test, arms a 300-second process watchdog that dumps all Python
+threads and exits nonzero, and keeps running subsequent files to collect failures.
+It covers collection, test execution and interpreter shutdown without a new
+dependency or retry. A 20-minute outer job limit also bounds runner or native
+process failures. Existing aggregates still reject failure and cancellation.
+These limits are safety bounds, not reduced test coverage or speedup claims.
+
+Review inventory was re-fetched before this scope extension: all four heads have
+bot PASS, complete reviews and all paginated threads are empty, zero
+findings-bearing review heads. The CI failures do not trip the review breaker.
+The same durable PR watch and cursor are retained through the next exact-head
+review/CI cycle; the cancelled head cannot merge.
+
+Local validation: 32 workflow/fixture/shard contracts passed, including real
+subprocess hangs during collection, a test body, and interpreter shutdown.
+The initial diagnostic assertion caught pytest redirecting stderr; the launcher
+now duplicates the original descriptor before pytest starts, and all three stack
+visibility checks pass. Four focused lifetime tests, 58 archive-cleanup tests,
+188 local-dependency tests, Ruff 0.4.9 and shell syntax checks passed.
+
+The complete 66-file shard terminated normally, including all 562 Show cases.
+One unrelated Skill CLI assertion saw the current Agent's inherited skill bindings
+instead of its fixture catalog; the unchanged `python -m pytest` command reproduced
+it too. Clearing only those nine `AVIBE_*SKILL*` bindings for the subprocess made
+all four Skill CLI tests pass. Do not change production config or claim that
+mixed result as a fully green shard; the next clean-environment run verifies it.
+
+While diagnosing, master advanced to `fae5f421c` through #1880, #1881 and #1884.
+The orchestrator inspected the new prompt-rendering/media consumers and verified
+no overlap with this PR's 13 files. Integrate that base before the next push and
+rerun the affected consumers. It adds one new test file, covered by the existing
+planner's measured-scale fallback; do not invent a timing measurement for it.
+
+After integrating `fae5f421c`, the clean-environment 66-file shard passed in full.
+The Show consumer separately passed all 562 tests in 22.42s; prompt-export
+integration passed 130 tests, and four focused UI files passed 62 tests. The
+32 fixture/workflow/shard contracts passed again. AST comparison confirms all
+1,092 original top-level functions/classes across the four behavioral test
+modules are unchanged. No test assertions were removed. Dependency compatibility
+and Ruff checks passed; main-checkout dirty-file checksums remain unchanged.
diff --git a/scripts/ci_unit_test_timings.json b/scripts/ci_unit_test_timings.json
index 9b87ce834..8c8de6c0a 100644
--- a/scripts/ci_unit_test_timings.json
+++ b/scripts/ci_unit_test_timings.json
@@ -1,402 +1,404 @@
{
"schema_version": 1,
- "source": "GitHub Actions run 33952795137 (9993ce41ce)",
+ "source": "GitHub Actions run 33959161877 (cfe16d930f; all six unit shards passed)",
"durations_seconds": {
- "tests/scenarios/auth_setup/test_auth_setup_scenarios.py": 15,
- "tests/scenarios/memory_im_attachment_capture/test_memory_im_attachment_capture_catalog.py": 6,
- "tests/scenarios/memory_im_attachment_capture/test_memory_im_attachment_capture_scenarios.py": 7,
- "tests/scenarios/memory_independence/test_memory_independence_catalog.py": 1,
- "tests/scenarios/memory_independence/test_memory_package_shape.py": 18,
- "tests/scenarios/memory_list/test_memory_list_scenarios.py": 3,
- "tests/scenarios/memory_runtime_install/test_memory_runtime_install_scenarios.py": 8,
- "tests/scenarios/message_delivery/test_message_delivery_scenarios.py": 3,
- "tests/scenarios/model_hub/test_model_hub_catalog.py": 8,
+ "tests/scenarios/auth_setup/test_auth_setup_scenarios.py": 12,
+ "tests/scenarios/memory_im_attachment_capture/test_memory_im_attachment_capture_catalog.py": 1,
+ "tests/scenarios/memory_im_attachment_capture/test_memory_im_attachment_capture_scenarios.py": 8,
+ "tests/scenarios/memory_independence/test_memory_independence_catalog.py": 2,
+ "tests/scenarios/memory_independence/test_memory_package_shape.py": 11,
+ "tests/scenarios/memory_list/test_memory_list_scenarios.py": 2,
+ "tests/scenarios/memory_runtime_install/test_memory_runtime_install_scenarios.py": 4,
+ "tests/scenarios/message_delivery/test_message_delivery_scenarios.py": 4,
+ "tests/scenarios/model_hub/test_model_hub_catalog.py": 4,
"tests/scenarios/model_hub/test_model_hub_configured_route_scenarios.py": 3,
- "tests/scenarios/model_hub/test_model_hub_live_resolution_scenarios.py": 4,
- "tests/scenarios/model_hub/test_model_hub_migration_scenarios.py": 3,
- "tests/scenarios/model_hub/test_model_hub_native_oauth_scenarios.py": 4,
- "tests/scenarios/model_hub/test_model_hub_turn_contract_scenarios.py": 4,
- "tests/scenarios/permissions/test_permissions_scenarios.py": 6,
- "tests/test_admin_notifications.py": 4,
- "tests/test_agent_activity_service.py": 6,
- "tests/test_agent_auth_service.py": 5,
+ "tests/scenarios/model_hub/test_model_hub_live_resolution_scenarios.py": 3,
+ "tests/scenarios/model_hub/test_model_hub_migration_scenarios.py": 6,
+ "tests/scenarios/model_hub/test_model_hub_native_oauth_scenarios.py": 5,
+ "tests/scenarios/model_hub/test_model_hub_turn_contract_scenarios.py": 2,
+ "tests/scenarios/permissions/test_permissions_scenarios.py": 5,
+ "tests/test_admin_notifications.py": 3,
+ "tests/test_agent_activity_service.py": 4,
+ "tests/test_agent_auth_service.py": 3,
"tests/test_agent_backend_alive.py": 3,
"tests/test_agent_backend_catalog.py": 2,
- "tests/test_agent_events_retention.py": 15,
- "tests/test_agent_graph_service.py": 6,
- "tests/test_agent_initiated_turn_fsm.py": 2,
- "tests/test_agent_organization_onboarding.py": 7,
- "tests/test_agent_run_target.py": 5,
+ "tests/test_agent_events_retention.py": 6,
+ "tests/test_agent_graph_service.py": 5,
+ "tests/test_agent_initiated_turn_fsm.py": 1,
+ "tests/test_agent_organization_onboarding.py": 9,
+ "tests/test_agent_run_target.py": 4,
"tests/test_agent_service.py": 5,
"tests/test_agent_silent_result.py": 1,
"tests/test_agent_steering.py": 17,
- "tests/test_agent_stop_settlement.py": 3,
- "tests/test_agent_tool_policy.py": 4,
- "tests/test_agents_graph_route.py": 4,
- "tests/test_api_key_masking.py": 2,
- "tests/test_api_runtime_refresh.py": 2,
- "tests/test_api_save_config_merge.py": 38,
- "tests/test_async_bridge.py": 2,
- "tests/test_atomic_io.py": 2,
+ "tests/test_agent_stop_settlement.py": 2,
+ "tests/test_agent_tool_policy.py": 3,
+ "tests/test_agents_graph_route.py": 3,
+ "tests/test_api_key_masking.py": 1,
+ "tests/test_api_runtime_refresh.py": 1,
+ "tests/test_api_save_config_merge.py": 35,
+ "tests/test_async_bridge.py": 0,
+ "tests/test_atomic_io.py": 1,
"tests/test_audio_asr.py": 2,
"tests/test_auth_pipeline.py": 1,
- "tests/test_avault_agent.py": 2,
+ "tests/test_avault_agent.py": 1,
"tests/test_backend_failure.py": 1,
- "tests/test_backend_model_catalog.py": 2,
- "tests/test_backend_restart.py": 4,
- "tests/test_background_work_banner.py": 14,
+ "tests/test_backend_model_catalog.py": 1,
+ "tests/test_backend_restart.py": 3,
+ "tests/test_background_work_banner.py": 12,
"tests/test_bind_code_api.py": 2,
- "tests/test_bind_security.py": 2,
- "tests/test_caller_context.py": 3,
- "tests/test_chat_discovery.py": 34,
+ "tests/test_bind_security.py": 1,
+ "tests/test_caller_context.py": 1,
+ "tests/test_chat_discovery.py": 28,
+ "tests/test_ci_pipeline.py": 1,
+ "tests/test_ci_test_fixtures.py": 2,
"tests/test_ci_unit_test_shards.py": 2,
- "tests/test_claude_agent_initiated_turn.py": 4,
- "tests/test_claude_agent_sessions.py": 4,
- "tests/test_claude_cli_path.py": 5,
- "tests/test_claude_container_sandbox.py": 3,
+ "tests/test_claude_agent_initiated_turn.py": 3,
+ "tests/test_claude_agent_sessions.py": 2,
+ "tests/test_claude_cli_path.py": 4,
+ "tests/test_claude_container_sandbox.py": 2,
"tests/test_claude_model_catalog.py": 1,
"tests/test_claude_process_reaper.py": 2,
- "tests/test_claude_reasoning_options.py": 2,
- "tests/test_claude_receiver_result_settle.py": 3,
- "tests/test_claude_sdk_compat.py": 3,
- "tests/test_claude_subprocess_env.py": 2,
- "tests/test_claude_token_usage.py": 3,
- "tests/test_cli_agent_models.py": 3,
- "tests/test_cli_agent_run_schema.py": 12,
+ "tests/test_claude_reasoning_options.py": 1,
+ "tests/test_claude_receiver_result_settle.py": 2,
+ "tests/test_claude_sdk_compat.py": 2,
+ "tests/test_claude_subprocess_env.py": 1,
+ "tests/test_claude_token_usage.py": 2,
+ "tests/test_cli_agent_models.py": 2,
+ "tests/test_cli_agent_run_schema.py": 11,
"tests/test_cli_definition_read_projection.py": 6,
- "tests/test_cli_pagination.py": 18,
+ "tests/test_cli_pagination.py": 10,
"tests/test_cli_screenshot_command.py": 1,
- "tests/test_cli_setup_status.py": 3,
- "tests/test_cli_task_command.py": 78,
- "tests/test_cli_watch_command.py": 17,
- "tests/test_cloudflare_network.py": 2,
- "tests/test_codex_agent.py": 5,
- "tests/test_codex_api_auth.py": 3,
- "tests/test_codex_config.py": 2,
- "tests/test_codex_event_handler.py": 2,
- "tests/test_codex_process_match.py": 2,
- "tests/test_codex_prompt_delivery_contract.py": 1,
+ "tests/test_cli_setup_status.py": 1,
+ "tests/test_cli_task_command.py": 57,
+ "tests/test_cli_watch_command.py": 15,
+ "tests/test_cloudflare_network.py": 1,
+ "tests/test_codex_agent.py": 4,
+ "tests/test_codex_api_auth.py": 2,
+ "tests/test_codex_config.py": 1,
+ "tests/test_codex_event_handler.py": 1,
+ "tests/test_codex_process_match.py": 1,
+ "tests/test_codex_prompt_delivery_contract.py": 2,
"tests/test_codex_session.py": 1,
- "tests/test_codex_token_usage.py": 2,
- "tests/test_codex_transport.py": 3,
- "tests/test_codex_turn_state.py": 2,
- "tests/test_command_handler_user_names.py": 3,
- "tests/test_command_runner.py": 6,
+ "tests/test_codex_token_usage.py": 1,
+ "tests/test_codex_transport.py": 1,
+ "tests/test_codex_turn_state.py": 1,
+ "tests/test_command_handler_user_names.py": 1,
+ "tests/test_command_runner.py": 5,
"tests/test_config_write_transaction.py": 14,
- "tests/test_conftest_auth_home_isolation.py": 2,
+ "tests/test_conftest_auth_home_isolation.py": 1,
"tests/test_controller_ack.py": 1,
- "tests/test_controller_agent_status.py": 4,
+ "tests/test_controller_agent_status.py": 3,
"tests/test_controller_config_reload.py": 2,
"tests/test_controller_dispatch_loop.py": 3,
"tests/test_controller_idle_cleanup.py": 3,
"tests/test_controller_im_ready.py": 3,
- "tests/test_controller_memory_data_reset.py": 4,
+ "tests/test_controller_memory_data_reset.py": 3,
"tests/test_controller_model_hub_gate.py": 3,
- "tests/test_controller_platform_reconcile.py": 11,
+ "tests/test_controller_platform_reconcile.py": 9,
"tests/test_controller_trace_retention.py": 3,
- "tests/test_controller_vibe_agent_routing.py": 4,
- "tests/test_core_services_dispatch.py": 2,
- "tests/test_core_services_sessions.py": 8,
+ "tests/test_controller_vibe_agent_routing.py": 2,
+ "tests/test_core_services_dispatch.py": 1,
+ "tests/test_core_services_sessions.py": 7,
"tests/test_core_services_settings.py": 5,
- "tests/test_delete_channel_scope.py": 2,
- "tests/test_delivery_ack_reaction.py": 4,
- "tests/test_delivery_state_matrix.py": 3,
- "tests/test_dependency_network.py": 2,
- "tests/test_dev_state_migration_guard.py": 2,
- "tests/test_discord_api_retry.py": 2,
+ "tests/test_delete_channel_scope.py": 1,
+ "tests/test_delivery_ack_reaction.py": 3,
+ "tests/test_delivery_state_matrix.py": 2,
+ "tests/test_dependency_network.py": 1,
+ "tests/test_dev_state_migration_guard.py": 1,
+ "tests/test_discord_api_retry.py": 1,
"tests/test_discord_guild_settings.py": 8,
- "tests/test_discord_model_picker.py": 2,
- "tests/test_discord_reply_anchor.py": 3,
+ "tests/test_discord_model_picker.py": 1,
+ "tests/test_discord_reply_anchor.py": 1,
"tests/test_discord_runtime.py": 2,
- "tests/test_discovered_chats.py": 2,
- "tests/test_dispatcher_stream_chunk.py": 2,
- "tests/test_dock_api.py": 6,
- "tests/test_docker_entrypoint_supervisor.py": 16,
- "tests/test_doctor_i18n.py": 5,
+ "tests/test_discovered_chats.py": 1,
+ "tests/test_dispatcher_stream_chunk.py": 1,
+ "tests/test_dock_api.py": 5,
+ "tests/test_docker_entrypoint_supervisor.py": 15,
+ "tests/test_doctor_i18n.py": 4,
"tests/test_event_loss_is_never_silent.py": 4,
- "tests/test_fake_memory_provider.py": 2,
+ "tests/test_fake_memory_provider.py": 1,
"tests/test_feishu_event_dispatcher.py": 1,
- "tests/test_feishu_hot_stop.py": 12,
- "tests/test_feishu_post_messages.py": 2,
- "tests/test_feishu_reaction_emoji.py": 3,
+ "tests/test_feishu_hot_stop.py": 11,
+ "tests/test_feishu_post_messages.py": 1,
+ "tests/test_feishu_reaction_emoji.py": 2,
"tests/test_feishu_routing_card.py": 1,
- "tests/test_feishu_status_bubble_footer.py": 8,
- "tests/test_file_browser_backend.py": 4,
- "tests/test_file_search.py": 2,
+ "tests/test_feishu_status_bubble_footer.py": 4,
+ "tests/test_file_browser_backend.py": 5,
+ "tests/test_file_search.py": 1,
"tests/test_git_binary.py": 1,
- "tests/test_git_runtime.py": 2,
- "tests/test_git_runtime_release_guard.py": 2,
- "tests/test_github_release.py": 2,
- "tests/test_github_wait_common.py": 2,
- "tests/test_global_agents_md.py": 2,
- "tests/test_harness_definition_lifecycle.py": 30,
- "tests/test_harness_failure_visibility.py": 163,
- "tests/test_harness_health_projection.py": 6,
- "tests/test_harness_live_status.py": 7,
- "tests/test_harness_payload_enrichment.py": 3,
- "tests/test_harness_run_projection.py": 4,
- "tests/test_harness_skill_guidance.py": 2,
+ "tests/test_git_runtime.py": 1,
+ "tests/test_git_runtime_release_guard.py": 1,
+ "tests/test_github_release.py": 1,
+ "tests/test_github_wait_common.py": 1,
+ "tests/test_global_agents_md.py": 1,
+ "tests/test_harness_definition_lifecycle.py": 27,
+ "tests/test_harness_failure_visibility.py": 51,
+ "tests/test_harness_health_projection.py": 5,
+ "tests/test_harness_live_status.py": 5,
+ "tests/test_harness_payload_enrichment.py": 2,
+ "tests/test_harness_run_projection.py": 3,
+ "tests/test_harness_skill_guidance.py": 1,
"tests/test_i18n_backend_keys.py": 2,
- "tests/test_i18n_key_parity.py": 2,
- "tests/test_im_base_auth.py": 2,
- "tests/test_im_post_send_bookkeeping.py": 11,
- "tests/test_im_proxy_unification.py": 2,
+ "tests/test_i18n_key_parity.py": 1,
+ "tests/test_im_base_auth.py": 1,
+ "tests/test_im_post_send_bookkeeping.py": 10,
+ "tests/test_im_proxy_unification.py": 1,
"tests/test_inbound_attachments.py": 3,
"tests/test_inbox_bridge.py": 1,
- "tests/test_inbox_events.py": 5,
+ "tests/test_inbox_events.py": 3,
"tests/test_incus_regression.py": 3,
"tests/test_incus_regression_supervisor.py": 1,
- "tests/test_incus_tenant_scaffold.py": 2,
- "tests/test_install_integrity.py": 2,
- "tests/test_install_script.py": 4,
- "tests/test_instance_authorization.py": 14,
+ "tests/test_incus_tenant_scaffold.py": 1,
+ "tests/test_install_integrity.py": 1,
+ "tests/test_install_script.py": 3,
+ "tests/test_instance_authorization.py": 12,
"tests/test_internal_client.py": 2,
- "tests/test_internal_client_timeouts.py": 3,
- "tests/test_internal_server.py": 34,
- "tests/test_latest_version_cache.py": 2,
- "tests/test_local_deps.py": 17,
+ "tests/test_internal_client_timeouts.py": 2,
+ "tests/test_internal_server.py": 33,
+ "tests/test_latest_version_cache.py": 1,
+ "tests/test_local_deps.py": 16,
"tests/test_macos_session_diagnostics.py": 3,
- "tests/test_managed_runtime.py": 6,
- "tests/test_managed_runtime_composite_artifacts.py": 3,
+ "tests/test_managed_runtime.py": 5,
+ "tests/test_managed_runtime_composite_artifacts.py": 1,
"tests/test_managed_skills.py": 2,
- "tests/test_memory_adapter.py": 4,
- "tests/test_memory_admission.py": 5,
+ "tests/test_memory_adapter.py": 3,
+ "tests/test_memory_admission.py": 3,
"tests/test_memory_artifact_contract.py": 1,
- "tests/test_memory_attachments.py": 2,
- "tests/test_memory_blocking.py": 3,
- "tests/test_memory_cli.py": 3,
- "tests/test_memory_config.py": 3,
- "tests/test_memory_confined_filesystem.py": 5,
- "tests/test_memory_disabled_isolation.py": 23,
+ "tests/test_memory_attachments.py": 1,
+ "tests/test_memory_blocking.py": 1,
+ "tests/test_memory_cli.py": 2,
+ "tests/test_memory_config.py": 2,
+ "tests/test_memory_confined_filesystem.py": 3,
+ "tests/test_memory_disabled_isolation.py": 17,
"tests/test_memory_distribution.py": 2,
- "tests/test_memory_everos.py": 3,
+ "tests/test_memory_everos.py": 2,
"tests/test_memory_im_attachments.py": 3,
- "tests/test_memory_insight.py": 2,
- "tests/test_memory_legacy_cleanup.py": 2,
- "tests/test_memory_loader.py": 2,
- "tests/test_memory_modality.py": 2,
+ "tests/test_memory_insight.py": 1,
+ "tests/test_memory_legacy_cleanup.py": 1,
+ "tests/test_memory_loader.py": 1,
+ "tests/test_memory_modality.py": 1,
"tests/test_memory_module.py": 2,
- "tests/test_memory_native_processing_record.py": 2,
- "tests/test_memory_operation_lock.py": 3,
- "tests/test_memory_process.py": 2,
- "tests/test_memory_processing_record.py": 2,
- "tests/test_memory_project_ids.py": 2,
- "tests/test_memory_provider_root.py": 2,
- "tests/test_memory_python_compat.py": 2,
- "tests/test_memory_recall_policy.py": 2,
- "tests/test_memory_runtime.py": 3,
- "tests/test_memory_runtime_factory.py": 3,
- "tests/test_memory_runtime_release.py": 2,
+ "tests/test_memory_native_processing_record.py": 1,
+ "tests/test_memory_operation_lock.py": 2,
+ "tests/test_memory_process.py": 1,
+ "tests/test_memory_processing_record.py": 1,
+ "tests/test_memory_project_ids.py": 1,
+ "tests/test_memory_provider_root.py": 1,
+ "tests/test_memory_python_compat.py": 1,
+ "tests/test_memory_recall_policy.py": 1,
+ "tests/test_memory_runtime.py": 2,
+ "tests/test_memory_runtime_factory.py": 2,
+ "tests/test_memory_runtime_release.py": 1,
"tests/test_memory_runtime_release_guard.py": 1,
- "tests/test_memory_sidecar.py": 2,
- "tests/test_memory_slice3.py": 9,
- "tests/test_memory_store.py": 2,
- "tests/test_memory_supervisor.py": 2,
- "tests/test_memory_ui_access.py": 2,
+ "tests/test_memory_sidecar.py": 1,
+ "tests/test_memory_slice3.py": 6,
+ "tests/test_memory_store.py": 1,
+ "tests/test_memory_supervisor.py": 1,
+ "tests/test_memory_ui_access.py": 1,
"tests/test_memory_upgrade_packaged.py": 1,
- "tests/test_memory_wake.py": 4,
+ "tests/test_memory_wake.py": 3,
"tests/test_memory_writer.py": 2,
- "tests/test_message_context_helpers.py": 2,
- "tests/test_message_delivery_authority.py": 17,
- "tests/test_message_dispatcher_file_uploads.py": 3,
- "tests/test_message_dispatcher_platform_limits.py": 2,
- "tests/test_message_dispatcher_result_fallback.py": 2,
- "tests/test_message_dispatcher_scheduled.py": 9,
- "tests/test_message_dispatcher_status_bubble.py": 2,
- "tests/test_message_handler_attachments.py": 3,
- "tests/test_message_handler_auth_setup.py": 2,
- "tests/test_message_handler_harness_echo.py": 3,
+ "tests/test_message_context_helpers.py": 0,
+ "tests/test_message_delivery_authority.py": 15,
+ "tests/test_message_dispatcher_file_uploads.py": 2,
+ "tests/test_message_dispatcher_platform_limits.py": 1,
+ "tests/test_message_dispatcher_result_fallback.py": 1,
+ "tests/test_message_dispatcher_scheduled.py": 8,
+ "tests/test_message_dispatcher_status_bubble.py": 1,
+ "tests/test_message_handler_attachments.py": 2,
+ "tests/test_message_handler_auth_setup.py": 1,
+ "tests/test_message_handler_harness_echo.py": 2,
"tests/test_message_handler_missing_agent.py": 2,
"tests/test_message_handler_typing.py": 3,
- "tests/test_message_handler_user_info.py": 2,
- "tests/test_message_mirror.py": 7,
- "tests/test_message_priority_cutover.py": 2,
- "tests/test_message_search.py": 4,
+ "tests/test_message_handler_user_info.py": 1,
+ "tests/test_message_mirror.py": 6,
+ "tests/test_message_priority_cutover.py": 1,
+ "tests/test_message_search.py": 3,
"tests/test_message_type_catalog.py": 1,
- "tests/test_message_type_python_consumers.py": 2,
- "tests/test_messages_service.py": 8,
- "tests/test_migration_lock.py": 4,
- "tests/test_migration_release_guard.py": 3,
- "tests/test_model_hub_api.py": 12,
- "tests/test_model_hub_config.py": 27,
- "tests/test_model_hub_engine_release_guard.py": 2,
+ "tests/test_message_type_python_consumers.py": 1,
+ "tests/test_messages_service.py": 7,
+ "tests/test_migration_lock.py": 3,
+ "tests/test_migration_release_guard.py": 2,
+ "tests/test_model_hub_api.py": 11,
+ "tests/test_model_hub_config.py": 24,
+ "tests/test_model_hub_engine_release_guard.py": 1,
"tests/test_model_hub_injection.py": 3,
"tests/test_model_hub_json_wire.py": 4,
- "tests/test_model_hub_l3.py": 19,
+ "tests/test_model_hub_l3.py": 18,
"tests/test_model_hub_oauth.py": 3,
- "tests/test_model_hub_reasoning_tiers.py": 3,
- "tests/test_model_hub_resolution.py": 6,
- "tests/test_model_hub_runtime.py": 10,
+ "tests/test_model_hub_reasoning_tiers.py": 1,
+ "tests/test_model_hub_resolution.py": 7,
+ "tests/test_model_hub_runtime.py": 9,
"tests/test_model_hub_structure_guards.py": 7,
"tests/test_model_hub_tool_names.py": 4,
- "tests/test_model_hub_usage.py": 6,
- "tests/test_model_service.py": 2,
- "tests/test_models_dev_catalog.py": 2,
- "tests/test_multi_platform_runtime.py": 16,
+ "tests/test_model_hub_usage.py": 5,
+ "tests/test_model_service.py": 1,
+ "tests/test_models_dev_catalog.py": 3,
+ "tests/test_multi_platform_runtime.py": 14,
"tests/test_native_login_single_flight.py": 2,
- "tests/test_native_login_structure_guards.py": 6,
- "tests/test_native_session_providers.py": 4,
+ "tests/test_native_login_structure_guards.py": 4,
+ "tests/test_native_session_providers.py": 2,
"tests/test_oauth_callback_diagnostics.py": 2,
- "tests/test_opencode_caller_context.py": 2,
- "tests/test_opencode_client_manager.py": 3,
- "tests/test_opencode_config_reconciler.py": 2,
- "tests/test_opencode_default_provider_routing.py": 3,
- "tests/test_opencode_provider_base_url.py": 2,
- "tests/test_opencode_provider_catalog_coercion.py": 2,
- "tests/test_opencode_provider_keys_reader.py": 2,
- "tests/test_opencode_reasoning_variants.py": 2,
- "tests/test_opencode_restore_polls.py": 5,
- "tests/test_opencode_server.py": 4,
+ "tests/test_opencode_caller_context.py": 1,
+ "tests/test_opencode_client_manager.py": 2,
+ "tests/test_opencode_config_reconciler.py": 1,
+ "tests/test_opencode_default_provider_routing.py": 2,
+ "tests/test_opencode_provider_base_url.py": 1,
+ "tests/test_opencode_provider_catalog_coercion.py": 1,
+ "tests/test_opencode_provider_keys_reader.py": 1,
+ "tests/test_opencode_reasoning_variants.py": 1,
+ "tests/test_opencode_restore_polls.py": 3,
+ "tests/test_opencode_server.py": 3,
"tests/test_opencode_session_manager.py": 3,
"tests/test_opencode_stop_receipt.py": 3,
- "tests/test_origin_links.py": 2,
- "tests/test_pagination.py": 2,
- "tests/test_permissions.py": 14,
- "tests/test_platform_registry.py": 2,
+ "tests/test_origin_links.py": 1,
+ "tests/test_pagination.py": 1,
+ "tests/test_permissions.py": 13,
+ "tests/test_platform_registry.py": 1,
"tests/test_prepare_regression.py": 1,
- "tests/test_process_diagnostics.py": 2,
- "tests/test_process_isolation.py": 3,
- "tests/test_processing_indicator_reaction.py": 2,
- "tests/test_project_access_service.py": 4,
- "tests/test_project_access_sync.py": 3,
- "tests/test_project_agents_md.py": 2,
- "tests/test_projects_service.py": 4,
- "tests/test_prompt_studio_catalog.py": 2,
- "tests/test_pypi_shim.py": 2,
- "tests/test_queued_message_writer_policy.py": 5,
- "tests/test_read_only_query.py": 2,
+ "tests/test_process_diagnostics.py": 1,
+ "tests/test_process_isolation.py": 2,
+ "tests/test_processing_indicator_reaction.py": 1,
+ "tests/test_project_access_service.py": 3,
+ "tests/test_project_access_sync.py": 2,
+ "tests/test_project_agents_md.py": 1,
+ "tests/test_projects_service.py": 2,
+ "tests/test_prompt_studio_catalog.py": 1,
+ "tests/test_pypi_shim.py": 1,
+ "tests/test_queued_message_writer_policy.py": 4,
+ "tests/test_read_only_query.py": 0,
"tests/test_read_only_query_vault_denylist.py": 1,
"tests/test_regression_script.py": 2,
- "tests/test_release_package_version.py": 2,
- "tests/test_remote_access_vibe_cloud.py": 14,
- "tests/test_remote_authorization_revision.py": 36,
- "tests/test_remote_resource_acl_sync.py": 7,
+ "tests/test_release_package_version.py": 1,
+ "tests/test_remote_access_vibe_cloud.py": 12,
+ "tests/test_remote_authorization_revision.py": 33,
+ "tests/test_remote_resource_acl_sync.py": 6,
"tests/test_reply_enhancer_platform.py": 12,
- "tests/test_reply_enhancer_secret_requests.py": 2,
- "tests/test_reserved_native_session_id.py": 3,
+ "tests/test_reply_enhancer_secret_requests.py": 1,
+ "tests/test_reserved_native_session_id.py": 2,
"tests/test_resource_access_service.py": 33,
- "tests/test_resource_acl_agents.py": 9,
- "tests/test_resource_acl_show_pages.py": 8,
+ "tests/test_resource_acl_agents.py": 6,
+ "tests/test_resource_acl_show_pages.py": 7,
"tests/test_resource_acl_vaults.py": 5,
- "tests/test_resource_governance.py": 2,
- "tests/test_restart_supervisor.py": 2,
- "tests/test_result_message_token_field.py": 2,
+ "tests/test_resource_governance.py": 1,
+ "tests/test_restart_supervisor.py": 1,
+ "tests/test_result_message_token_field.py": 1,
"tests/test_resume_session.py": 3,
- "tests/test_routing_modal_selection.py": 2,
- "tests/test_running_agents_service.py": 3,
+ "tests/test_routing_modal_selection.py": 1,
+ "tests/test_running_agents_service.py": 2,
"tests/test_runtime_activation.py": 3,
- "tests/test_runtime_commands.py": 2,
- "tests/test_runtime_log_sink.py": 3,
- "tests/test_runtime_ownership.py": 9,
- "tests/test_runtime_recovery.py": 5,
- "tests/test_runtime_scope_bootstrap.py": 2,
- "tests/test_runtime_service_lock.py": 5,
- "tests/test_runtime_work_supervisor.py": 2,
+ "tests/test_runtime_commands.py": 0,
+ "tests/test_runtime_log_sink.py": 2,
+ "tests/test_runtime_ownership.py": 7,
+ "tests/test_runtime_recovery.py": 4,
+ "tests/test_runtime_scope_bootstrap.py": 1,
+ "tests/test_runtime_service_lock.py": 6,
+ "tests/test_runtime_work_supervisor.py": 1,
"tests/test_save_opencode_provider_auth.py": 13,
- "tests/test_scheduled_command_task_integration.py": 7,
- "tests/test_scheduled_tasks.py": 171,
- "tests/test_sentry_integration.py": 4,
- "tests/test_service_logging_handlers.py": 3,
- "tests/test_service_readiness.py": 7,
- "tests/test_session_activities.py": 7,
+ "tests/test_scheduled_command_task_integration.py": 5,
+ "tests/test_scheduled_tasks.py": 88,
+ "tests/test_sentry_integration.py": 3,
+ "tests/test_service_logging_handlers.py": 1,
+ "tests/test_service_readiness.py": 6,
+ "tests/test_session_activities.py": 6,
"tests/test_session_archive.py": 5,
"tests/test_session_cli.py": 8,
"tests/test_session_delivery_fsm.py": 30,
- "tests/test_session_fork.py": 32,
- "tests/test_session_handler_base_id.py": 3,
- "tests/test_session_route_writer_policy.py": 2,
- "tests/test_session_titles.py": 3,
+ "tests/test_session_fork.py": 19,
+ "tests/test_session_handler_base_id.py": 2,
+ "tests/test_session_route_writer_policy.py": 1,
+ "tests/test_session_titles.py": 2,
"tests/test_settings_disk_fallback.py": 4,
"tests/test_settings_handler.py": 3,
- "tests/test_show_git.py": 4,
+ "tests/test_show_git.py": 3,
"tests/test_show_git_turn_entrypoints.py": 3,
"tests/test_show_identity.py": 3,
- "tests/test_show_page_legacy_ui_removed.py": 2,
- "tests/test_show_pages.py": 20,
+ "tests/test_show_page_legacy_ui_removed.py": 1,
+ "tests/test_show_pages.py": 23,
"tests/test_show_pages_admin_api.py": 4,
"tests/test_show_runtime_archive_cleanup.py": 4,
"tests/test_show_runtime_manifest.py": 1,
- "tests/test_show_runtime_manifest_packaging.py": 2,
- "tests/test_show_runtime_orphan_sweep.py": 2,
- "tests/test_show_runtime_protocol.py": 2,
- "tests/test_show_session_events.py": 7,
+ "tests/test_show_runtime_manifest_packaging.py": 1,
+ "tests/test_show_runtime_orphan_sweep.py": 1,
+ "tests/test_show_runtime_protocol.py": 1,
+ "tests/test_show_session_events.py": 8,
"tests/test_skill_cli.py": 1,
- "tests/test_skills_service.py": 6,
- "tests/test_slack_app_mention_empty.py": 2,
- "tests/test_slack_dm_mentions.py": 3,
- "tests/test_slack_markdown_footer.py": 2,
- "tests/test_sqlite_sessions_store.py": 38,
- "tests/test_sqlite_settings_store.py": 26,
- "tests/test_sqlite_state_migration.py": 108,
- "tests/test_sqlite_state_startup.py": 2,
+ "tests/test_skills_service.py": 5,
+ "tests/test_slack_app_mention_empty.py": 1,
+ "tests/test_slack_dm_mentions.py": 1,
+ "tests/test_slack_markdown_footer.py": 1,
+ "tests/test_sqlite_sessions_store.py": 36,
+ "tests/test_sqlite_settings_store.py": 24,
+ "tests/test_sqlite_state_migration.py": 74,
+ "tests/test_sqlite_state_startup.py": 1,
"tests/test_sse_broker.py": 1,
"tests/test_state_backups.py": 7,
"tests/test_status_bubble_footer_render.py": 2,
- "tests/test_status_bubble_indicator.py": 3,
+ "tests/test_status_bubble_indicator.py": 2,
"tests/test_status_bubble_settings.py": 3,
- "tests/test_subagent_router.py": 2,
- "tests/test_telegram_attachment_download.py": 2,
+ "tests/test_subagent_router.py": 1,
+ "tests/test_telegram_attachment_download.py": 1,
"tests/test_telegram_bot.py": 12,
- "tests/test_telegram_formatter.py": 2,
- "tests/test_telegram_proxy.py": 2,
+ "tests/test_telegram_formatter.py": 1,
+ "tests/test_telegram_proxy.py": 1,
"tests/test_terminal_backend.py": 5,
"tests/test_test_failure_classifier.py": 2,
- "tests/test_tmux_runtime.py": 2,
- "tests/test_tunnel_quality.py": 2,
+ "tests/test_tmux_runtime.py": 1,
+ "tests/test_tunnel_quality.py": 1,
"tests/test_tunnel_recovery.py": 5,
- "tests/test_turn_terminal_reaction.py": 2,
- "tests/test_ui_api.py": 18,
- "tests/test_ui_memory_routes.py": 4,
- "tests/test_ui_project_access.py": 8,
+ "tests/test_turn_terminal_reaction.py": 1,
+ "tests/test_ui_api.py": 17,
+ "tests/test_ui_memory_routes.py": 3,
+ "tests/test_ui_project_access.py": 6,
"tests/test_ui_server_fastapi.py": 21,
- "tests/test_ui_server_install.py": 3,
- "tests/test_ui_server_logs.py": 4,
+ "tests/test_ui_server_install.py": 5,
+ "tests/test_ui_server_logs.py": 3,
"tests/test_ui_server_mutation_protection.py": 9,
- "tests/test_ui_server_reload.py": 3,
+ "tests/test_ui_server_reload.py": 4,
"tests/test_ui_server_skills_routes.py": 3,
- "tests/test_ui_server_voice_telemetry.py": 3,
+ "tests/test_ui_server_voice_telemetry.py": 2,
"tests/test_ui_server_voice_transcription.py": 3,
- "tests/test_ui_session_stream.py": 12,
- "tests/test_ui_show_pages.py": 47,
- "tests/test_update_checker_platforms.py": 39,
- "tests/test_upgrade_flow.py": 18,
+ "tests/test_ui_session_stream.py": 11,
+ "tests/test_ui_show_pages.py": 45,
+ "tests/test_update_checker_platforms.py": 40,
+ "tests/test_upgrade_flow.py": 17,
"tests/test_user_platform_scope.py": 6,
- "tests/test_v2_compat_platforms.py": 3,
- "tests/test_v2_config_platform_registry.py": 2,
- "tests/test_v2_paths.py": 2,
- "tests/test_v2_sessions.py": 13,
- "tests/test_vault_addresses.py": 2,
- "tests/test_vault_api.py": 16,
- "tests/test_vault_cli.py": 15,
+ "tests/test_v2_compat_platforms.py": 2,
+ "tests/test_v2_config_platform_registry.py": 3,
+ "tests/test_v2_paths.py": 1,
+ "tests/test_v2_sessions.py": 11,
+ "tests/test_vault_addresses.py": 1,
+ "tests/test_vault_api.py": 15,
+ "tests/test_vault_cli.py": 14,
"tests/test_vault_crypto.py": 1,
"tests/test_vault_export_inject.py": 4,
"tests/test_vault_fetch.py": 6,
- "tests/test_vault_protected_format.py": 2,
+ "tests/test_vault_protected_format.py": 1,
"tests/test_vault_request_callbacks.py": 6,
- "tests/test_vault_request_im_notifications.py": 3,
+ "tests/test_vault_request_im_notifications.py": 1,
"tests/test_vault_rest.py": 5,
- "tests/test_vault_schema.py": 2,
- "tests/test_vault_service.py": 6,
- "tests/test_version_identity.py": 3,
- "tests/test_vibe_agent_archive.py": 47,
+ "tests/test_vault_schema.py": 1,
+ "tests/test_vault_service.py": 5,
+ "tests/test_version_identity.py": 2,
+ "tests/test_vibe_agent_archive.py": 27,
"tests/test_vibe_agent_model_prefill.py": 7,
"tests/test_vibe_cli.py": 7,
- "tests/test_wait_for_github_action_runs.py": 2,
+ "tests/test_wait_for_github_action_runs.py": 1,
"tests/test_wait_for_github_issue_activity.py": 1,
"tests/test_wait_for_github_pr_activity.py": 2,
- "tests/test_watch_worker.py": 3,
+ "tests/test_watch_worker.py": 2,
"tests/test_watches.py": 12,
- "tests/test_web_oauth_flow.py": 3,
+ "tests/test_web_oauth_flow.py": 2,
"tests/test_web_push_notifications.py": 9,
"tests/test_web_push_service.py": 6,
"tests/test_wechat_attachment_download.py": 1,
- "tests/test_wechat_auth.py": 4,
- "tests/test_wechat_bot.py": 4,
- "tests/test_wechat_cdn.py": 2,
- "tests/test_workbench_media.py": 13,
- "tests/test_workbench_only_runtime.py": 6,
+ "tests/test_wechat_auth.py": 2,
+ "tests/test_wechat_bot.py": 3,
+ "tests/test_wechat_cdn.py": 1,
+ "tests/test_workbench_media.py": 11,
+ "tests/test_workbench_only_runtime.py": 5,
"tests/test_workbench_prefs_api.py": 3,
- "tests/test_workbench_session_defaults.py": 4,
+ "tests/test_workbench_session_defaults.py": 3,
"tests/test_workspace_system_session.py": 4
}
}
diff --git a/scripts/ci_unit_tests.sh b/scripts/ci_unit_tests.sh
index ea891851c..3471f6858 100755
--- a/scripts/ci_unit_tests.sh
+++ b/scripts/ci_unit_tests.sh
@@ -60,7 +60,29 @@ if [ -z "$PYTHON_BIN" ]; then
fi
fi
-PYTEST=("$PYTHON_BIN" -m pytest)
+FILE_TIMEOUT="${CI_TEST_FILE_TIMEOUT_SECONDS:-300}"
+case "$FILE_TIMEOUT" in
+ ''|*[!0-9]*)
+ echo "CI_TEST_FILE_TIMEOUT_SECONDS must be a positive integer, got: $FILE_TIMEOUT" >&2
+ exit 2
+ ;;
+esac
+if ! [ "$FILE_TIMEOUT" -gt 0 ]; then
+ echo "CI_TEST_FILE_TIMEOUT_SECONDS must be a positive integer, got: $FILE_TIMEOUT" >&2
+ exit 2
+fi
+
+# Keep one interpreter per file. The watchdog also covers collection and
+# interpreter shutdown; pytest's per-test faulthandler timer would replace it.
+PYTEST=("$PYTHON_BIN" -u -c '
+import faulthandler, os, sys
+# Retain the original output even while pytest redirects descriptor 2.
+diagnostics = os.fdopen(os.dup(sys.stderr.fileno()), "w")
+faulthandler.enable(file=diagnostics)
+faulthandler.dump_traceback_later(int(sys.argv.pop(1)), file=diagnostics, exit=True)
+import pytest
+sys.exit(pytest.main(sys.argv[1:]))
+' "$FILE_TIMEOUT")
select_unit_test_files() {
"$PYTHON_BIN" scripts/ci_unit_test_shards.py "$SHARD_INDEX" "$SHARD_TOTAL"
@@ -74,7 +96,8 @@ while IFS= read -r f; do
discovered=$((discovered + 1))
selected=$((selected + 1))
started_at=$(date +%s)
- "${PYTEST[@]}" "$f" -m "not integration" -p no:randomly -o addopts="" -q
+ echo "Starting $f (timeout ${FILE_TIMEOUT}s)."
+ "${PYTEST[@]}" "$f" -m "not integration" -p no:randomly -p no:faulthandler -o addopts="" -v
rc=$?
finished_at=$(date +%s)
elapsed=$((finished_at - started_at))
diff --git a/tests/conftest.py b/tests/conftest.py
index abf976ab5..1220c3f2f 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -139,6 +139,25 @@ def _sqlite_state_template_factory(tmp_path_factory):
return get_template
+def sqlite_db_factory(tmp_path, _sqlite_state_template_factory):
+ """Give behavioral tests independent, fully initialized state databases.
+
+ This is opt-in: migration/import tests still initialize their own empty DBs.
+ Only new paths inside this test's temporary directory may receive a copy.
+ """
+
+ def create(db_path: Path) -> Path:
+ db_path = db_path.resolve()
+ db_path.relative_to(tmp_path.resolve())
+ db_path.parent.mkdir(parents=True, exist_ok=True)
+ with _sqlite_state_template_factory().open("rb") as source, db_path.open("xb") as target:
+ shutil.copyfileobj(source, target)
+ return db_path
+
+ return create
+
+
@pytest.fixture(autouse=True)
def _isolate_vibe_remote_home(request, tmp_path, monkeypatch):
if request.node.get_closest_marker("uses_real_paths"):
@@ -266,13 +285,14 @@ def _reset_cached_sqlite_engines():
"""
def _reset() -> None:
- try:
- from storage.db import dispose_cached_sqlite_engines
- from storage.importer import reset_ensured_sqlite_state
- except Exception:
- return
- dispose_cached_sqlite_engines()
- reset_ensured_sqlite_state()
+ # A module that has never been imported cannot own cached state. Re-read
+ # at teardown to include modules first imported by the test itself.
+ db = sys.modules.get("storage.db")
+ if db is not None:
+ db.dispose_cached_sqlite_engines()
+ importer = sys.modules.get("storage.importer")
+ if importer is not None:
+ importer.reset_ensured_sqlite_state()
_reset()
yield
@@ -358,19 +378,19 @@ def _reset_oauth_runtime_state():
so without this they would leak across tests sharing a pytest process — e.g. the
rate limiter accumulating across files and spuriously 429-ing an unrelated test.
"""
- try:
- from vibe import remote_access, ui_server
- except Exception:
- yield
- return
- caches = (remote_access._oauth_handshakes, ui_server._oauth_diag_log_state, ui_server._auth_ratelimit)
- remote_access._clear_active_hostnames_cache()
- for cache in caches:
- cache.clear()
+ def _reset() -> None:
+ remote_access = sys.modules.get("vibe.remote_access")
+ if remote_access is not None:
+ remote_access._clear_active_hostnames_cache()
+ remote_access._oauth_handshakes.clear()
+ ui_server = sys.modules.get("vibe.ui_server")
+ if ui_server is not None:
+ ui_server._oauth_diag_log_state.clear()
+ ui_server._auth_ratelimit.clear()
+
+ _reset()
yield
- remote_access._clear_active_hostnames_cache()
- for cache in caches:
- cache.clear()
+ _reset()
@pytest.fixture(autouse=True)
diff --git a/tests/test_ci_pipeline.py b/tests/test_ci_pipeline.py
index fe6869772..97720a7d4 100644
--- a/tests/test_ci_pipeline.py
+++ b/tests/test_ci_pipeline.py
@@ -3,8 +3,11 @@ from __future__ import annotations
import itertools
import os
from pathlib import Path
+import shutil
import subprocess
+import sys
+import pytest
import yaml
@@ -15,6 +18,71 @@ def _jobs() -> dict:
return yaml.safe_load((ROOT / ".github/workflows/lint.yml").read_text())["jobs"]
+def _run_isolated_unit_files(tmp_path: Path, sources: dict[str, str], *, timeout: str = "15"):
+ (tmp_path / "tests").mkdir()
+ (tmp_path / "scripts").mkdir()
+ for name, source in sources.items():
+ (tmp_path / "tests" / name).write_text(source, encoding="utf-8")
+ shutil.copyfile(ROOT / "scripts/ci_unit_test_shards.py", tmp_path / "scripts/ci_unit_test_shards.py")
+ return subprocess.run(
+ ["bash", str(ROOT / "scripts/ci_unit_tests.sh")], cwd=tmp_path,
+ env={**os.environ, "PYTHON": sys.executable, "CI_TEST_FILE_TIMEOUT_SECONDS": timeout,
+ "PYTEST_DISABLE_PLUGIN_AUTOLOAD": "1", "PYTEST_ADDOPTS": ""},
+ capture_output=True, text=True, timeout=40,
+ )
+
+
+def test_unit_shard_has_an_outer_deadline_without_weakening_failure_propagation() -> None:
+ shard = _jobs()["unit-test-shards"]
+ assert shard["timeout-minutes"] == 20
+ assert shard["strategy"]["fail-fast"] is False
+ assert not shard.get("continue-on-error")
+ assert all(not step.get("continue-on-error") for step in shard["steps"])
+
+
[email protected]("phase", ["collection", "test", "shutdown"])
+def test_unit_file_watchdog_dumps_stacks_and_continues_fail_closed(tmp_path: Path, phase: str) -> None:
+ sources = {
+ "collection": "import time\ntime.sleep(3600)\n",
+ "test": "import time\ndef test_stuck():\n time.sleep(3600)\n",
+ "shutdown": (
+ "import threading\n"
+ "def test_stuck():\n"
+ " threading.Thread(target=threading.Event().wait).start()\n"
+ ),
+ }
+ result = _run_isolated_unit_files(tmp_path, {
+ "test_a_stuck.py": sources[phase],
+ "test_b_pass.py": "def test_after_stuck_file():\n pass\n",
+ }, timeout="3")
+ assert result.returncode == 1, result.stdout + result.stderr
+ assert "Starting tests/test_a_stuck.py (timeout 3s)." in result.stdout
+ assert "Timeout (0:00:03)!" in result.stderr
+ assert "most recent call first" in result.stderr
+ assert "Finished tests/test_b_pass.py" in result.stdout
+ assert "test_after_stuck_file PASSED" in result.stdout
+ assert "FAILED files:\n tests/test_a_stuck.py" in result.stdout
+ assert "All unit test files passed." not in result.stdout
+
+
[email protected]("failed", [False, True])
+def test_unit_file_runner_preserves_assertions_and_integration_selection(tmp_path: Path, failed: bool) -> None:
+ result = _run_isolated_unit_files(tmp_path, {
+ "test_assertion.py": f"def test_assertion():\n assert {not failed}\n",
+ "test_integration.py": "import pytest\[email protected]\ndef test_excluded():\n assert False\n",
+ })
+ assert result.returncode == int(failed), result.stdout + result.stderr
+ assert "Ran 2 unit test file(s), one process each" in result.stdout
+ assert "No unit tests collected (skipped):\n tests/test_integration.py" in result.stdout
+
+
[email protected]("timeout", ["0", "00", "-1", "invalid"])
+def test_unit_file_runner_rejects_invalid_deadline(tmp_path: Path, timeout: str) -> None:
+ result = _run_isolated_unit_files(tmp_path, {"test_one.py": "def test_one():\n pass\n"}, timeout=timeout)
+ assert result.returncode == 2
+ assert "must be a positive integer" in result.stderr
+
+
def test_ui_checks_run_once_without_fencing_artifact_consumers() -> None:
jobs = _jobs()
checks = jobs["ui-checks"]
@@ -39,10 +107,53 @@ def test_ui_checks_run_once_without_fencing_artifact_consumers() -> None:
assert not job.get("if")
assert not job.get("continue-on-error")
assert all(not step.get("if") and not step.get("continue-on-error") for step in job["steps"])
- for name in ("install-upgrade-regression", "windows-install-smoke"):
+ for name in ("install-upgrade-shards", "windows-install-smoke"):
assert jobs[name]["needs"] == "build-linux-artifacts"
+def test_install_suites_run_independently_without_losing_checks() -> None:
+ jobs = _jobs()
+ shards = jobs["install-upgrade-shards"]
+ assert shards["strategy"]["fail-fast"] is False
+ suites = shards["strategy"]["matrix"]["suite"]
+ assert len(suites) == len(set(suites)) == 2
+ assert not shards.get("if")
+ assert not shards.get("continue-on-error")
+ assert all(not step.get("continue-on-error") for step in shards["steps"])
+ steps = {step["name"]: step for step in shards["steps"] if "name" in step}
+ test_steps = [steps["Run packaged Memory package-shape smoke"], steps["Run install and upgrade regressions"]]
+ for suite in suites:
+ selected = [step for step in test_steps if step["if"] == f"matrix.suite == '{suite}'"]
+ assert len(selected) == 1, f"Every suite must select exactly one regression command: {suite}"
+ # Both suites build real source wheels, including the released-generation
+ # bridge inside the Docker upgrade test.
+ prepare = steps["Prepare Show Runtime manifest for fixture wheels"]
+ assert not prepare.get("if")
+ assert "python scripts/prepare_local_show_runtime_manifest.py" in prepare["run"]
+ assert "tests/test_memory_upgrade_packaged.py -m integration" in test_steps[0]["run"]
+ assert "SKIPPED" in test_steps[0]["run"] and "exit 1" in test_steps[0]["run"]
+ for test_file in (
+ "tests/test_upgrade_flow.py", "tests/test_install_script.py",
+ "tests/e2e/test_install_command.py", "tests/e2e/test_upgrade_command.py",
+ ):
+ assert test_file in test_steps[1]["run"]
+ assert "docker info" in test_steps[1]["run"]
+ assert jobs["install-upgrade-regression"]["needs"] == "install-upgrade-shards"
+
+
[email protected]("result", ["success", "failure", "cancelled", "skipped", ""])
+def test_install_gate_fails_unless_all_suites_succeeded(tmp_path: Path, result: str) -> None:
+ gate = _jobs()["install-upgrade-regression"]
+ assert gate["if"] == "always()"
+ step, = gate["steps"]
+ assert step["env"] == {"INSTALL_RESULT": "${{ needs['install-upgrade-shards'].result }}"}
+ command = subprocess.run(
+ ["bash", "-e", "-c", step["run"]], cwd=tmp_path,
+ env={**os.environ, "INSTALL_RESULT": result}, capture_output=True, text=True,
+ )
+ assert (command.returncode == 0) == (result == "success"), command.stdout
+
+
def test_existing_required_gate_fails_unless_every_dependency_succeeded(tmp_path: Path) -> None:
gate = _jobs()["unit-tests"]
assert gate["if"] == "always()"
diff --git a/tests/test_ci_test_fixtures.py b/tests/test_ci_test_fixtures.py
new file mode 100644
index 000000000..3b6fb4454
--- /dev/null
+++ b/tests/test_ci_test_fixtures.py
@@ -0,0 +1,125 @@
+from __future__ import annotations
+
+import builtins
+from contextlib import closing
+import sqlite3
+import sys
+from types import SimpleNamespace
+from unittest.mock import Mock
+
+import pytest
+
+from tests.conftest import _reset_cached_sqlite_engines, _reset_oauth_runtime_state
+
+
+def test_database_copies_preserve_the_entire_template_and_isolate_mutations(
+ tmp_path, sqlite_db_factory, _sqlite_state_template_factory
+):
+ template = _sqlite_state_template_factory()
+ original = template.read_bytes()
+ first = sqlite_db_factory(tmp_path / "first" / "vibe.sqlite")
+ second = sqlite_db_factory(tmp_path / "second" / "vibe.sqlite")
+ assert first.read_bytes() == second.read_bytes() == original
+
+ with closing(sqlite3.connect(first)) as connection, connection:
+ connection.execute("CREATE TABLE test_mutation (value TEXT)")
+ connection.execute("INSERT INTO test_mutation VALUES ('first only')")
+ third = sqlite_db_factory(tmp_path / "third" / "vibe.sqlite")
+ assert template.read_bytes() == second.read_bytes() == third.read_bytes() == original
+ assert first.read_bytes() != original
+ with closing(sqlite3.connect(third)) as connection:
+ assert connection.execute("PRAGMA integrity_check").fetchone() == ("ok",)
+ assert connection.execute("SELECT version_num FROM alembic_version").fetchone()
+
+
+def test_database_factory_never_overwrites_existing_state(tmp_path, sqlite_db_factory):
+ target = tmp_path / "vibe.sqlite"
+ target.write_bytes(b"existing database")
+ with pytest.raises(FileExistsError):
+ sqlite_db_factory(target)
+ assert target.read_bytes() == b"existing database"
+
+
+def test_database_factory_rejects_paths_outside_test_isolation(tmp_path, sqlite_db_factory):
+ outside = tmp_path.parent / f"{tmp_path.name}-outside"
+ with pytest.raises(ValueError):
+ sqlite_db_factory(outside / "vibe.sqlite")
+ assert not outside.exists()
+
+ link = tmp_path / "outside-link"
+ link.symlink_to(tmp_path.parent, target_is_directory=True)
+ with pytest.raises(ValueError):
+ sqlite_db_factory(link / outside.name / "vibe.sqlite")
+ assert not outside.exists()
+
+
[email protected]_sqlite_template
+def test_migration_tests_still_begin_without_seeded_state():
+ from config import paths
+
+ assert not paths.get_sqlite_state_path().exists()
+
+
[email protected]("fixture", [_reset_cached_sqlite_engines, _reset_oauth_runtime_state])
+def test_cache_cleanup_does_not_import_unused_runtime_modules(monkeypatch, fixture):
+ names = ("storage.db", "storage.importer", "vibe.remote_access", "vibe.ui_server")
+ for name in names:
+ monkeypatch.delitem(sys.modules, name, raising=False)
+ imports = []
+ original_import = builtins.__import__
+
+ def record_import(name, *args, **kwargs):
+ imports.append(name)
+ return original_import(name, *args, **kwargs)
+
+ monkeypatch.setattr(builtins, "__import__", record_import)
+ lifecycle = fixture.__wrapped__()
+ next(lifecycle)
+ with pytest.raises(StopIteration):
+ next(lifecycle)
+ assert not imports
+ assert all(name not in sys.modules for name in names)
+
+
[email protected]("loaded_before_setup", [False, True])
+def test_cache_cleanup_covers_owners_loaded_before_or_during_the_test(monkeypatch, loaded_before_setup):
+ for name in ("storage.db", "storage.importer", "vibe.remote_access", "vibe.ui_server"):
+ monkeypatch.delitem(sys.modules, name, raising=False)
+ lifecycles = [
+ fixture.__wrapped__()
+ for fixture in (_reset_cached_sqlite_engines, _reset_oauth_runtime_state)
+ ]
+ dispose = Mock()
+ reset_importer = Mock()
+ clear_hostnames = Mock()
+ handshake = {"pending": {}}
+ diagnostics = {"client": [1.0]}
+ rate_limit = {"client": [1.0]}
+ modules = {
+ "storage.db": SimpleNamespace(dispose_cached_sqlite_engines=dispose),
+ "storage.importer": SimpleNamespace(reset_ensured_sqlite_state=reset_importer),
+ "vibe.remote_access": SimpleNamespace(
+ _clear_active_hostnames_cache=clear_hostnames, _oauth_handshakes=handshake,
+ ),
+ "vibe.ui_server": SimpleNamespace(_oauth_diag_log_state=diagnostics, _auth_ratelimit=rate_limit),
+ }
+ if loaded_before_setup:
+ for name, module in modules.items():
+ monkeypatch.setitem(sys.modules, name, module)
+ for lifecycle in lifecycles:
+ next(lifecycle)
+ if loaded_before_setup:
+ assert not handshake and not diagnostics and not rate_limit
+ else:
+ for name, module in modules.items():
+ monkeypatch.setitem(sys.modules, name, module)
+ handshake["pending"] = {}
+ diagnostics["client"] = [1.0]
+ rate_limit["client"] = [1.0]
+ for lifecycle in lifecycles:
+ with pytest.raises(StopIteration):
+ next(lifecycle)
+ for cleanup in (dispose, reset_importer, clear_hostnames):
+ assert cleanup.call_count == (2 if loaded_before_setup else 1)
+ cleanup.assert_called_with()
+ assert not handshake and not diagnostics and not rate_limit
diff --git a/tests/test_harness_failure_visibility.py b/tests/test_harness_failure_visibility.py
index 14e6313c6..afd3b5f43 100644
--- a/tests/test_harness_failure_visibility.py
+++ b/tests/test_harness_failure_visibility.py
@@ -40,6 +40,14 @@ from storage.background import (
)
[email protected](autouse=True)
+def _prepare_behavior_state(tmp_path, sqlite_db_factory, request):
+ # These cases exercise Harness behavior against the real current schema,
+ # not the migration path that produces it.
+ if not request.node.get_closest_marker("no_sqlite_template"):
+ sqlite_db_factory(tmp_path / "state" / "vibe.sqlite")
+
+
def _store(tmp_path: Path) -> tuple[SQLiteBackgroundTaskStore, TaskExecutionStore]:
sqlite = SQLiteBackgroundTaskStore(tmp_path / "state" / "vibe.sqlite")
requests = TaskExecutionStore(tmp_path / "task_requests")
diff --git a/tests/test_scheduled_tasks.py b/tests/test_scheduled_tasks.py
index 2e4049f44..485788fc1 100644
--- a/tests/test_scheduled_tasks.py
+++ b/tests/test_scheduled_tasks.py
@@ -114,6 +114,15 @@ from storage.agent_session_rows import create_agent_session_row
from storage.settings_service import upsert_scope
[email protected](autouse=True)
+def _prepare_behavior_state(tmp_path, sqlite_db_factory, request):
+ # Preserve per-test databases while avoiding a full migration for each
+ # explicit store path used by the scheduling/binding cases below.
+ if not request.node.get_closest_marker("no_sqlite_template"):
+ sqlite_db_factory(tmp_path / "vibe.sqlite")
+ sqlite_db_factory(tmp_path / "state" / "vibe.sqlite")
+
+
class _StubScheduler:
def __init__(self) -> None:
self.jobs = {}
diff --git a/tests/test_ui_show_pages.py b/tests/test_ui_show_pages.py
index 96b7f351d..38bb4373d 100644
--- a/tests/test_ui_show_pages.py
+++ b/tests/test_ui_show_pages.py
@@ -10279,6 +10279,82 @@ def test_show_runtime_candidate_reference_failure_never_publishes_pointer(
assert list(runtime_dir.rglob(".vibe-show-runtime.json")) == []
[email protected]("shared_owner", [False, True])
+def test_show_runtime_finalizer_can_collect_inside_reference_publication(tmp_path, shared_owner):
+ # A subprocess deadline turns a regressed deadlock into a useful failure.
+ probe = textwrap.dedent("""
+ import faulthandler
+ import gc
+ import sys
+ import weakref
+ from pathlib import Path
+ from core.show_runtime import ShowRuntimeManager
+
+ faulthandler.dump_traceback_later(10, exit=True)
+ gc.disable()
+ root = Path(sys.argv[1])
+ runtime = root / "runtime"
+ old_install = runtime / "versions" / "old"
+ new_install = runtime / "versions" / "new"
+ old_install.mkdir(parents=True)
+ new_install.mkdir(parents=True)
+ def manager():
+ return ShowRuntimeManager(runtime_dir=runtime, workspace_root=root / "show", offline=True)
+
+ previous = manager()
+ assert previous._retain_install_dir_locked(old_install)
+ old_marker, = previous._install_reference_dir(old_install.resolve()).glob("*.lock")
+ survivor = manager()
+ shared = sys.argv[2] == "True"
+ if shared:
+ assert survivor._retain_install_dir_locked(old_install)
+ previous.cycle = previous
+ old_ref = weakref.ref(previous)
+ del previous
+
+ current = manager()
+ original = current._install_reference_dir
+ def collect_during_publication(path):
+ gc.collect()
+ assert old_ref() is None
+ return original(path)
+ current._install_reference_dir = collect_during_publication
+ assert current._retain_install_dir_locked(new_install)
+ assert current._install_dir_has_live_reference(new_install)
+ assert current._install_dir_has_live_reference(old_install) is shared
+ assert old_marker.exists() is shared
+ survivor._install_reference_finalizer()
+ assert not current._install_dir_has_live_reference(old_install)
+ assert not old_marker.exists()
+ current._install_reference_finalizer()
+ assert not current._install_dir_has_live_reference(new_install)
+ print("finalizer completed; live ownership preserved")
+ """)
+ result = subprocess.run(
+ [sys.executable, "-c", probe, str(tmp_path), str(shared_owner)],
+ capture_output=True, text=True, timeout=20,
+ )
+ assert result.returncode == 0, result.stdout + result.stderr
+ assert "live ownership preserved" in result.stdout
+
+
+def test_show_runtime_reference_guard_still_excludes_other_threads():
+ acquired = []
+
+ def attempt():
+ locked = show_runtime._INSTALL_REFERENCE_LOCKS_GUARD.acquire(timeout=0.05)
+ acquired.append(locked)
+ if locked:
+ show_runtime._INSTALL_REFERENCE_LOCKS_GUARD.release()
+
+ with show_runtime._INSTALL_REFERENCE_LOCKS_GUARD:
+ thread = threading.Thread(target=attempt)
+ thread.start()
+ thread.join(timeout=2)
+ assert not thread.is_alive()
+ assert acquired == [False]
+
+
def test_show_runtime_live_cached_install_survives_distinct_identity_cleanup(monkeypatch, tmp_path):
runtime_dir = tmp_path / "runtime"
monkeypatch.setattr(
diff --git a/tests/test_vibe_agent_archive.py b/tests/test_vibe_agent_archive.py
index 9c2d2f611..7039e9a70 100644
--- a/tests/test_vibe_agent_archive.py
+++ b/tests/test_vibe_agent_archive.py
@@ -41,6 +41,14 @@ NOW = "2026-07-31T14:00:00+00:00"
SCOPE_ID = "avibe::project::proj_archive"
[email protected](autouse=True)
+def _prepare_behavior_state(tmp_path, sqlite_db_factory, request):
+ # Archive transactions and lock races need the current schema, not a fresh
+ # migration chain for every private database.
+ if not request.node.get_closest_marker("no_sqlite_template"):
+ sqlite_db_factory(tmp_path / "state" / "vibe.sqlite")
+
+
def _create_archive_fallback(store: VibeAgentStore) -> None:
store.create(name="archive-fallback", backend="codex")
diff --git a/ui/src/components/workbench/Composer.shortcut.test.tsx b/ui/src/components/workbench/Composer.shortcut.test.tsx
index 04fe27d7f..d22ea9195 100644
--- a/ui/src/components/workbench/Composer.shortcut.test.tsx
+++ b/ui/src/components/workbench/Composer.shortcut.test.tsx
@@ -307,7 +307,11 @@ describe('Composer voice shortcut', () => {
const textbox = screen.getByRole('textbox');
await act(async () => undefined);
- fireEvent.keyDown(textbox, { code: 'Escape', key: 'Escape', altKey: true });
+ // Recording startup crosses promises; flush its effects, including the
+ // plain-Escape listener, before dispatching the next keyboard interaction.
+ await act(async () => {
+ fireEvent.keyDown(textbox, { code: 'Escape', key: 'Escape', altKey: true });
+ });
await waitFor(() => expect(voiceMocks.getUserMedia).toHaveBeenCalledOnce());
await screen.findByRole('button', { name: en.chat.compose.stopRecording });
fireEvent.keyDown(textbox, { code: 'Escape', key: 'Escape', altKey: true });