Skip to content
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
4 changes: 2 additions & 2 deletions src/lingtai/kernel/meta_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
import time as _time
import copy as _copy
from collections.abc import Mapping
from typing import NamedTuple
from typing import Any, Dict, NamedTuple

from .config import (
CONTEXT_PRESSURE_HIGH_RATIO,
Expand Down Expand Up @@ -464,7 +464,7 @@ def static_adapter_comment(agent):
return None


def dynamic_adapter_comment(agent: AgentState) -> Mapping[str, Any] | None:
def dynamic_adapter_comment(agent: object) -> Mapping[str, Any] | None:
"""Return adapter-owned dynamic tail state for ``_meta.agent_meta``.

Adapters that can separate static guidance from dynamic runtime state should
Expand Down
15 changes: 15 additions & 0 deletions tests/test_meta_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import json
import re
from types import SimpleNamespace
from typing import get_type_hints

import pytest
import lingtai.kernel.meta_block as meta_block
Expand Down Expand Up @@ -37,6 +38,20 @@
from lingtai.kernel.llm.interface import ToolResultBlock


@pytest.mark.parametrize(
"helper",
[
dynamic_adapter_comment,
slim_adapter_comment_for_tail,
meta_block.build_meta_readme_section,
build_guidance_with_meta_readme,
],
)
def test_helper_type_hints_are_runtime_resolvable(helper):
"""Public helper annotations must resolve without caller-supplied globals."""
assert get_type_hints(helper)


def _fake_agent(*, time_awareness: bool = True, timezone_awareness: bool = True):
"""Minimal agent stand-in: build_meta only reads agent._config.*."""
return SimpleNamespace(
Expand Down
Loading