Commit Graph
7 Commits
Author SHA1 Message Date
chengyongru 7008473a3e test(session): cover equivalent paths on Windows 2026-09-07 10:54:26 +08:00
KDB db918bddd3 test: stabilize flaky and environment-dependent tests
- test_catalog_bounds_failure_only_keys failed 3/5 runs on Windows: all
  three get() calls land within one time.monotonic() tick, so the eviction
  victim in _reserve() is decided by hash-seeded set iteration order among
  tied recency keys. Pin the catalog to a synthetic strictly-increasing
  monotonic clock (the constructor already accepts one) so the oldest
  entry is evicted deterministically. 5/5 stable after, 3/5 failures before.
- test_equivalent_workspace_paths_share_one_store requires directory
  symlinks, which need admin/developer mode on Windows (WinError 1314).
  Skip with the same pattern the file already uses for file symlinks.
- tests/agent/conftest.py: make_provider() assigned through a spec'd mock
  by reading provider.estimate_prompt_tokens first, which raises
  AttributeError because the attribute is not on the LLMProvider class
  spec; assign a MagicMock directly instead. Latent - no test hit the
  default-provider path until now.
2026-09-07 10:54:26 +08:00
chengyongru 251a1ccd40 refactor: simplify cross-session messaging 2026-08-19 01:15:56 +08:00
chengyongru 0e184965e8 feat(webui): add lightweight session messaging via mentions 2026-08-19 01:15:56 +08:00
Xubin Renandlmzopq cd7480945b fix(session): preserve history across storage relocation
Co-authored-by: lmzopq <1646888+lmzopq@users.noreply.github.com>
2026-08-13 01:41:10 +09:00
Xubin Ren d2cbe6536e fix(session): reject symlinked legacy session migration 2026-08-13 01:41:10 +09:00
李明振 b34f1bd0e8 fix(session): store session history outside the agent workspace
Session files lived under <workspace>/sessions/ (since #713), which is the
on-disk scope of the agent's filesystem tools. With restrict_to_workspace
enabled, an agent could read_file / list_dir every session transcript —
including other users' or channels' conversations — bypassing the scoped
sessions.py access layer entirely.

Move session storage to ~/.nanobot/sessions/<sha256-of-resolved-workspace>[:16]/,
outside the workspace. Per-workspace isolation (the goal of #713) is preserved
via a hash of the resolved workspace path, so different workspaces keep
independent session stores. A one-shot, idempotent migration moves legacy
in-workspace *.jsonl files into the new location at store init.

Scope note: this protects sessions whenever restrict_to_workspace=true. The
default restrict_to_workspace=false leaves read_file unrestricted in general
(not only sessions) and is a separate concern.

Refs #5278
2026-08-13 01:41:10 +09:00