refactor: drop unreferenced dead code
Every removed symbol has no reference anywhere in the tree (Python AST and TypeScript identifier scans over all tracked files, including tests, docs, WebUI/TUI clients, and JSON/YAML data): - nanobot/webui/settings_api.py: four aliases with no importer and no in-module use; the helpers that tests still import stay. - nanobot/sdk/types.py: snapshot_from_payload had no caller since session restore moved to snapshot_from_session. - nanobot/session/jsonl_migration.py: INTRODUCED_VERSION and LAST_SUPPORTED_RELEASE_LINE duplicated the module docstring. - nanobot/providers/transcription.py: StepFunTranscriptionProvider._DEFAULT_URL was superseded by _resolve_stepfun_asr_url. - nanobot/channels/whatsapp_agent/protocol.py: CODE_MISSING_AUTH is neither exported nor compared; validation still checks the wire value 190. - webui/src/lib/canonical-run-snapshot.ts: canonicalRunSnapshot had no caller. - webui/src/components/icons/product-icons.tsx: SendIcon and RunningTaskIcon are not rendered anywhere. - webui/src/components/thread/AgentActivityCluster.tsx: drop an unused isAgentActivityMember re-export and its import. - webui: drop the unused micromark-util-decode-string dependency. Framework-dispatched code (Typer commands, pydantic validators, pytest hooks and fixtures, channel runtime classes, ast visitor hooks) was excluded from the scans, so the change removes only code nothing references.
This commit is contained in:
1 parent
eb8546c321
commit
25ed91ffeb
10 files changed
+1
-56
No files matched your search
@@ -29,7 +29,6 @@ RATE_LIMITS = {
|
||||
|
||||
# error.code values that carry a specific recovery contract.
|
||||
CODE_INVALID_TOKEN = 100
|
||||
CODE_MISSING_AUTH = 190
|
||||
CODE_RATE_LIMITED = 130429
|
||||
CODE_NOT_CREATOR = 131005
|
||||
CODE_BAD_REQUEST = 131009
|
||||
|
||||
@@ -708,8 +708,6 @@ class XiaomiMiMoTranscriptionProvider:
|
||||
class StepFunTranscriptionProvider:
|
||||
"""Voice transcription provider using StepFun ASR SSE endpoint."""
|
||||
|
||||
_DEFAULT_URL = "https://api.stepfun.com/v1/audio/asr/sse"
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
api_key: str | None = None,
|
||||
|
||||
+1
-23
@@ -2,7 +2,7 @@ from __future__ import annotations
|
||||
|
||||
from copy import deepcopy
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Any, Literal, Mapping, TypeAlias, cast
|
||||
from typing import Any, Literal, TypeAlias, cast
|
||||
|
||||
from nanobot.providers.base import LLMUsage
|
||||
from nanobot.runtime_context import public_history_messages
|
||||
@@ -137,28 +137,6 @@ def snapshot_from_session(
|
||||
)
|
||||
|
||||
|
||||
def snapshot_from_payload(
|
||||
payload: Mapping[str, Any],
|
||||
*,
|
||||
include_runtime_context: bool = False,
|
||||
) -> SessionSnapshot:
|
||||
raw_messages: list[Any] = list(payload.get("messages") or [])
|
||||
messages: list[dict[str, Any]] = [
|
||||
deepcopy(dict(cast(Mapping[str, Any], message)))
|
||||
for message in raw_messages
|
||||
if isinstance(message, Mapping)
|
||||
]
|
||||
if not include_runtime_context:
|
||||
messages = public_history_messages(messages)
|
||||
return SessionSnapshot(
|
||||
key=str(payload.get("key") or ""),
|
||||
created_at=payload.get("created_at"),
|
||||
updated_at=payload.get("updated_at"),
|
||||
metadata=deepcopy(dict(cast(Mapping[str, Any], payload.get("metadata") or {}))),
|
||||
messages=messages,
|
||||
)
|
||||
|
||||
|
||||
def result_from_response(response: Any, capture: Any) -> RunResult:
|
||||
content = (response.content if response else None) or ""
|
||||
metadata = dict(response.metadata) if response and response.metadata else {}
|
||||
|
||||
@@ -26,8 +26,6 @@ from nanobot.session.manager import Session
|
||||
if TYPE_CHECKING:
|
||||
from nanobot.session.sqlite_store import SqliteSessionStore
|
||||
|
||||
INTRODUCED_VERSION = "0.3.6"
|
||||
LAST_SUPPORTED_RELEASE_LINE = "0.4.x"
|
||||
SUNSET_VERSION = "0.5.0"
|
||||
WORKSPACE_BACKUP_DIR = "jsonl-backup"
|
||||
_WORKSPACE_SOURCES_KEY = "jsonl_workspace_sources"
|
||||
|
||||
@@ -31,14 +31,9 @@ RuntimeSurface = Literal["browser", "native"]
|
||||
|
||||
# Preserve established direct imports of focused helpers.
|
||||
_docs_version = system.docs_version
|
||||
_parse_bool = contracts.parse_bool
|
||||
_query_first = contracts.query_first
|
||||
_query_first_alias = contracts.query_first_alias
|
||||
_query_has_alias = contracts.query_has_alias
|
||||
_model_catalog_kind = models.model_catalog_kind
|
||||
_oauth_provider_status = models.oauth_provider_status
|
||||
_provider_requires_api_key = models.provider_requires_api_key
|
||||
_reasoning_effort_values_for = models.reasoning_effort_values_for
|
||||
|
||||
|
||||
_RUNTIME_CAPABILITIES = {
|
||||
|
||||
Reference in new issue
Block a user