Skip to content
This repository was archived by the owner on May 26, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions tests/agent/test_anthropic_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,34 @@
from agent.transports import get_transport


# ---------------------------------------------------------------------------
# Module-level isolation — KR-TEST-STABILITY-SWEEP
# ---------------------------------------------------------------------------
#
# ``resolve_anthropic_token`` + ``read_claude_code_credentials`` read
# from the OS keychain on macOS (via
# ``_read_claude_code_credentials_from_keychain``) in addition to the
# env vars + filesystem credential files individual tests
# monkeypatch. Without an autouse keychain-stub a developer's real
# OAuth token bleeds into TestResolveAnthropicToken assertions
# (observed during pre-existing-failure sweep: keychain returned a
# live ``sk-ant-oat01-...`` token regardless of the test's env setup).
#
# ``TestReadClaudeCodeCredentials`` already had its own per-class
# autouse fixture stubbing the keychain reader. Promoted to module
# scope so every Test* class in the file gets the same isolation by
# default — same shape, broader reach. The per-class fixture in
# TestReadClaudeCodeCredentials is now redundant but kept verbatim
# for self-documentation; both fire on those tests with no side
# effects (both patch to the same lambda value).
@pytest.fixture(autouse=True)
def _module_no_keychain(monkeypatch):
monkeypatch.setattr(
"agent.anthropic_adapter._read_claude_code_credentials_from_keychain",
lambda: None,
)


# ---------------------------------------------------------------------------
# Auth helpers
# ---------------------------------------------------------------------------
Expand Down
4 changes: 3 additions & 1 deletion tests/gateway/test_dingtalk.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,9 @@ async def test_send_posts_to_webhook(self):
assert call_args[0][0] == "https://dingtalk.example/webhook"
payload = call_args[1]["json"]
assert payload["msgtype"] == "markdown"
assert payload["markdown"]["title"] == "Hermes"
# Identity rebrand: PlatformConfig.display_name defaults to
# "Kora" since the Hermes→Kora fork (see gateway/config.py:304).
assert payload["markdown"]["title"] == "Kora"
assert payload["markdown"]["text"] == "Hello!"

@pytest.mark.asyncio
Expand Down
10 changes: 9 additions & 1 deletion tests/plugins/memory/test_scratchpad.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,17 @@
import logging
from typing import Any, List, Optional

import blake3
import pytest

# blake3 is an optional plugin dep (declared in the ``isokron`` extra
# in pyproject.toml + the plugin.yaml). The production module
# ``plugins.memory.isokron.scratchpad`` already imports it inside a
# try/except — test side mirrors that with importorskip so the suite
# collects cleanly in environments where the isokron extra isn't
# installed (e.g. the default ``--extra dev --extra all`` test
# invocation). Collection-time skip > collection-time ImportError.
blake3 = pytest.importorskip("blake3")

from plugins.memory.isokron.scratchpad import (
DEFAULT_SCRATCHPAD_READ_LIMIT,
ScratchpadEntry,
Expand Down