Files
e07824e6a9 Fix/agent env usage workspace (#351)
* fix: inject Admin env into running agents and sum turn token usage

Running shells and Docker sandboxes now pick up ~/.octop/env (and workspace .env) without a full reload; MCP stdio no longer inherits the entire host environment. Usage accounting adds every model call in the turn, and workspace I/O survives the harness rebuild window.

Co-authored-by: Cursor <cursoragent@cursor.com>

* feat: schema v7 identity, expert profiles, chat artifacts, and KB citations (#346)

* feat: schema v7 identity, expert profiles, chat artifacts, and KB citations

Fold integer PKs plus public string ids, document folders, agent profile columns, and thread artifacts into v7 SQL (not only Python helpers). Experts get workspace avatars and a single welcome_message; chat keeps file changes across sessions, shows knowledge citations, and can drag workspace files.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore: drop cron JobDrawer UX from the schema v7 PR

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix: prefer tool-arg paths when recording chat artifacts

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: jubaoliang <jubaoliang@tencent.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: jubaoliang <jubaoliang@tencent.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-20 10:17:39 +08:00

22 lines
585 B
Python

from __future__ import annotations
import pytest
from octop.infra.knowledge.relpath import (
ancestor_dirs,
normalize_kb_path,
path_is_direct_child,
)
def test_normalize_kb_path_rejects_parent_segments() -> None:
assert normalize_kb_path("/a/b/c.md") == "a/b/c.md"
with pytest.raises(ValueError):
normalize_kb_path("../secret")
def test_path_helpers() -> None:
assert ancestor_dirs("notes/law/act.md") == ["notes", "notes/law"]
assert path_is_direct_child("notes/law", "notes")
assert not path_is_direct_child("notes/law/act.md", "notes")