hermes-agent/tests
Ben Barclay ce6dd1a65f
fix(sync): read org state from the org endpoints, not the personal ones (#75237)
Org-shared skills were unusable past the first propose. Three defects, one
root cause plus two that it masked.

ROOT CAUSE — org reads went to the personal endpoint.

`SyncClient.get_refs()` / `get_object()` only ever called `/v1/sync/refs`
and `/v1/sync/objects/:hash`. Those routes are hard-scoped server-side to
the token's own owner, so asking them for `refs/org/<id>/` returns the
caller's PERSONAL refs rather than an error, and org objects 404. Both org
call sites read org state through them:

- `pull_org_skills` resolved head=None for a populated org and reported
  `{"ok": true, "head": null, "updated": []}` — org skills silently never
  arrived, which reads as "my org has no skills" rather than as a failure.
- `propose_skill` resolved base_head=None, so the FIRST propose to an org
  succeeded by accident (`from: null` happened to be correct) and EVERY
  later one CAS'd against a head it had never seen -> 409 -> a raw
  `SyncConflict` traceback. Worse, it built its root from an empty skill
  map, so a landed CAS would have REPLACED the org set rather than splicing
  into it — the 409 was accidentally preventing data loss.

Fix: `org_scope=True` on `get_refs`/`get_object`, threaded through
`get_commit_json`, `get_tree_json`, `_root_tree_of_commit`,
`_skill_trees_of_root`, and `materialize_tree` — walking an org commit needs
the org route on every hop, not just the first. Both org call sites now go
through one `_read_org_head()` helper.

ALSO FIXED

- `propose_skill` retries on conflict. When the org HEAD moves between the
  read and the CAS (another member proposing, an admin merging), it
  re-splices this one skill onto the NEW head and retries, bounded at 5
  attempts. Re-splicing rather than replaying the old root is what stops a
  concurrent proposal being dropped.
- An empty `actual` in a 409 means "the ref does not exist", not "here is a
  commit". `SyncConflict` normalizes "" to None in its constructor, and the
  personal push path redoes the CAS as a create instead of fetching "" as an
  object — which surfaced as the baffling `object  not found` (doubled
  space). This is what a client hits after switching sync planes, since
  `.sync_state` is not environment-scoped and carries a foreign head.

THE MOCK WAS THE REASON THIS SHIPPED

The test mock served org refs and org objects off the personal routes, so
21 org tests passed against a client that could not work against the real
plane. The mock now mirrors production: `/v1/sync/org/refs` and
`/v1/sync/org/objects/:hash` exist, org objects live in a separate scope,
and the personal routes refuse org content. Two existing tests had to be
corrected to assert against the org scope — they had been passing on the
mock's over-permissiveness.

Tests: 5 new (org head invisible on the personal route; second propose
splices and preserves the first; pull resolves a real org head; empty
`actual` -> None; push recovers from a stale cross-plane head). Verified
they FAIL without the fix: reverting just `_read_org_head` to the personal
route fails the second-propose test and the pre-existing splice test.
1278 passed / 0 failed across 54 suites via scripts/run_tests.sh.

Verified against PRODUCTION with a real org token, not just the mock:
- `pull_org_skills` -> head `sha256:1adf9333…`, materialized
  `software-development/gateway-gateway-connector` into the `_org` mirror
  (was head=None, updated=[]).
- A second `hermes sync propose` succeeded where it previously raised, and
  the org set afterwards contains BOTH skills with the new commit
  descending from the first.
2026-07-30 22:31:42 -07:00
..
acp test: prune wave 2 + speed fixes — 28,106 → 19,757 test functions, suite wall 315s → 294s 2026-07-29 13:39:40 -07:00
acp_adapter test: prune wave 2 + speed fixes — 28,106 → 19,757 test functions, suite wall 315s → 294s 2026-07-29 13:39:40 -07:00
agent fix(compression): choose summary role by template-visible alternation 2026-07-30 21:07:36 +05:30
ci test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
cli fix(cli): route Cmd+Backspace and Cmd+ForwardDelete to the kill bindings 2026-07-30 03:39:26 -05:00
computer_use Merge remote-tracking branch 'origin/main' into tests/prune-low-value 2026-07-29 14:12:25 -07:00
conformance test: prune wave 2 + speed fixes — 28,106 → 19,757 test functions, suite wall 315s → 294s 2026-07-29 13:39:40 -07:00
cron test(tests): assert SessionDB timeout without wall-clock 2026-07-29 18:55:10 -07:00
dashboard test: prune wave 2 + speed fixes — 28,106 → 19,757 test functions, suite wall 315s → 294s 2026-07-29 13:39:40 -07:00
docker test: prune wave 2 + speed fixes — 28,106 → 19,757 test functions, suite wall 315s → 294s 2026-07-29 13:39:40 -07:00
e2e
fakes
fixtures feat(computer_use): align cua-driver 0.9 contracts 2026-07-29 12:19:37 -07:00
gateway fix(gateway): preserve voice_only semantics for text input 2026-07-30 00:11:33 -07:00
hermes_cli auto populate flux3 in tools for nous portal users 2026-07-30 16:34:08 -07:00
hermes_state test: prune wave 2 + speed fixes — 28,106 → 19,757 test functions, suite wall 315s → 294s 2026-07-29 13:39:40 -07:00
honcho_plugin fix(honcho): network-hermetic unit tests + lazy async writer start 2026-07-29 18:55:10 -07:00
integration
manual
monitoring test: prune wave 2 + speed fixes — 28,106 → 19,757 test functions, suite wall 315s → 294s 2026-07-29 13:39:40 -07:00
openviking_plugin test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
plugins test: prove concurrency with barriers/witnesses instead of wall-clock bounds 2026-07-29 21:30:53 -07:00
providers modernize re-added Vercel integrations: SDK 0.7.2, telemetry off, sibling-site wiring 2026-07-29 19:48:37 -07:00
run_agent Revert "remove Vercel AI Gateway and Vercel Sandbox (#33067)" 2026-07-29 19:48:37 -07:00
scripts test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
secret_sources test: prune wave 2 + speed fixes — 28,106 → 19,757 test functions, suite wall 315s → 294s 2026-07-29 13:39:40 -07:00
skills test: prune wave 2 + speed fixes — 28,106 → 19,757 test functions, suite wall 315s → 294s 2026-07-29 13:39:40 -07:00
state fix(state): time-based write-lock patience so busy sibling processes can't destroy turns 2026-07-29 17:59:02 -07:00
stress
tools fix(sync): read org state from the org endpoints, not the personal ones (#75237) 2026-07-30 22:31:42 -07:00
tui_gateway test(tui_gateway): pin goal-command config home against collection-time _hermes_home freeze 2026-07-29 21:30:53 -07:00
website
__init__.py
conftest.py test(tui_gateway): make the tui gateway suite order-independent 2026-07-29 21:30:53 -07:00
run_interrupt_test.py
test_account_usage.py
test_atomic_replace_symlinks.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_audio_playback_guard.py fix(tests): stop the test suite speaking aloud and launching a browser 2026-07-28 14:07:21 -07:00
test_background_review_list_shapes.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_background_review_session_isolation.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_base_url_hostname.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_batch_runner_checkpoint.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_bitwarden_secrets.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_cli_manual_compress.py
test_cli_skin_integration.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_code_skew.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_command_secret_source.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_conftest_wal_gate.py
test_copilot_initiator.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_credential_file_permissions.py
test_ctx_halving_fix.py fix(tests): eliminate flaky/broken tests — shadow sys.path inserts, unmocked network in compressor tests, stale-SDK feishu pin guard, quadratic redact regexes 2026-07-29 15:12:28 -07:00
test_delegate_cascade_49148.py
test_dispatch_session_id.py
test_empty_model_fallback.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_empty_session_hygiene.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_env_loader_applied_homes.py
test_env_loader_op_bootstrap.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_env_loader_secret_sources.py
test_evidence_store.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_fast_safe_load.py
test_fts_cjk_bigram.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_gateway_streaming_nested_config.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_get_tool_definitions_cache_isolation.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_hermes_bootstrap.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_hermes_constants.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_hermes_home_profile_warning.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_hermes_logging.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_hermes_state.py fix(config): respect database.journal_mode from config.yaml 2026-07-29 18:13:09 -07:00
test_hermes_state_compression_locks.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_hermes_state_readonly_preflight.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_hermes_state_wal_fallback.py fix(state): reconcile salvaged WAL fixes with current main 2026-07-29 18:13:09 -07:00
test_hermetic_side_effect_guards.py test: guard browser and Keychain side effects suite-wide (#35404) 2026-07-29 18:55:10 -07:00
test_honcho_client_concurrency.py
test_honcho_client_config.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_honcho_session_context.py
test_honcho_startup_fail_open.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_install_autostash_conflict_recovery.py
test_install_commit_pin_rollback.py fix(installer): never let a stale --commit pin roll an install backwards 2026-07-29 17:35:16 -05:00
test_install_diverged_update.py
test_install_lockfile_churn.py
test_install_macos_launcher.py
test_install_no_initial_commit.py
test_install_ps1_ascii_only.py
test_install_ps1_native_stderr_eap.py
test_install_ps1_node_path_for_npm.py
test_install_ps1_python_fallback_venv.py
test_install_ps1_uv_powershell_host.py
test_install_ps1_web_server_syntax_probe.py
test_install_sh_acp_launcher.py
test_install_sh_bootstrap_marker.py
test_install_sh_browser_install.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_install_sh_install_method_stamp.py
test_install_sh_node_global_prefix.py
test_install_sh_pythonpath_sanitization.py
test_install_sh_root_fhs_uv_python_path.py
test_install_sh_setup_wizard_tty_probe.py
test_install_sh_symlink_stomp.py
test_install_sh_termux_network_prereqs.py
test_install_unmerged_index.py
test_ipv4_preference.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_iron_proxy.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_iron_proxy_cli.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_iron_proxy_e2e.py
test_journal_mode_config.py fix(state): make journal mode canonical and behaviorally verified 2026-07-29 18:13:09 -07:00
test_lazy_session_regressions.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_live_system_guard.py test(tui_gateway): make the tui gateway suite order-independent 2026-07-29 21:30:53 -07:00
test_live_system_guard_self_test.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_log_isolation.py fix(tests): stop the suite writing into the operator's real Hermes logs 2026-07-29 19:53:17 -07:00
test_mcp_serve.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_message_reactions.py fix(state): make _row_id opt-in per consumer instead of universal 2026-07-30 00:08:28 -05:00
test_mini_swe_runner.py
test_minimax_model_validation.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_minimax_oauth.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_minisweagent_path.py
test_model_forces_max_completion_tokens.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_model_picker_scroll.py fix(tests): eliminate flaky/broken tests — shadow sys.path inserts, unmocked network in compressor tests, stale-SDK feishu pin guard, quadratic redact regexes 2026-07-29 15:12:28 -07:00
test_model_tools.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_model_tools_async_bridge.py
test_ollama_num_ctx.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_onepassword_secrets.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_output_cap_parsing.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_packaging_build_guard.py
test_packaging_metadata.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_plugin_skills.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_plugin_utils.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_process_loop_event_loop_warning.py
test_profile_isolation_runtime.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_project_metadata.py Revert "remove Vercel AI Gateway and Vercel Sandbox (#33067)" 2026-07-29 19:48:37 -07:00
test_pty_keepalive_ws.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_pty_session.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_retry_utils.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_run_tests_parallel.py fix(test-runner): native Windows venv probe + glyph-safe stdio 2026-07-29 21:30:53 -07:00
test_run_tests_parallel_stdio.py fix(test-runner): native Windows venv probe + glyph-safe stdio 2026-07-29 21:30:53 -07:00
test_sanitize_tool_error.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_search_slow_query_log.py
test_session_db_read_path_split.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_session_skill_previews.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_session_workspace_binding.py
test_slack_thread_require_mention.py
test_slash_worker_watchdog.py
test_sql_injection.py
test_sqlite_lock_safe_inspection.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_sqlite_wal_reset_gate.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_stale_utils_module_import.py
test_state_db_malformed_repair.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_subprocess_home_isolation.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_telegram_polling_progress_ptb.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_termux_all_extra_compat.py
test_timezone.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_tini_shim.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_toolset_distributions.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_toolsets.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_trajectory_compressor.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_trajectory_compressor_async.py
test_transform_llm_output_hook.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_transform_tool_result_hook.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_tui_entry_mcp_owner.py
test_tui_gateway_loop_noise.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_tui_gateway_queue_on_busy.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_tui_gateway_server.py test(tui): make _load_enabled_toolsets assertions tolerant of first-release back-filled toolsets 2026-07-30 16:34:08 -07:00
test_tui_gateway_ws.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_tui_mcp_late_refresh.py
test_utils_truthy_values.py
test_voice_max_recording_seconds.py fix(voice): enforce voice.max_recording_seconds (was dead config) 2026-07-28 11:57:37 -07:00
test_wal_checkpoint_strategy.py
test_web_server.py fix(web): raise uvicorn WS frame cap for Desktop file.attach 2026-07-28 19:20:14 -05:00
test_web_server_sessiondb_eventloop.py refactor(web): extract sessions/mcp/skills/tools routes to APIRouter modules (wave 2; route-table equality verified) 2026-07-29 16:21:54 -07:00
test_windows_subprocess_no_window_flags.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_yaml_indent_consistency_31999.py
test_yuanbao_integration.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_yuanbao_markdown.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_yuanbao_pipeline.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_yuanbao_proto.py test: prune low-value tests suite-wide (wave 1) — 46,820 → 28,106 test functions 2026-07-29 13:10:23 -07:00
test_yuanbao_reconnect_set_active.py
test_yuanbao_shutdown.py
test_zeroed_state_db.py