diff --git a/backend/apps/agents/agent_manager.py b/backend/apps/agents/agent_manager.py index 93dc07fd..eb210c38 100644 --- a/backend/apps/agents/agent_manager.py +++ b/backend/apps/agents/agent_manager.py @@ -50,7 +50,6 @@ from backend.apps.agents.tool_catalog import ( ) from backend.apps.agents.aux_llm import _safe_resp_text from backend.apps.agents.history_compaction import ( - _approx_tokens, _build_history_prefix, _get_branch_messages, _summarize_message_block, diff --git a/backend/apps/agents/history_compaction.py b/backend/apps/agents/history_compaction.py index 44841895..aaa30a25 100644 --- a/backend/apps/agents/history_compaction.py +++ b/backend/apps/agents/history_compaction.py @@ -62,14 +62,6 @@ def _build_history_prefix(messages) -> str: return "\n" + "\n".join(lines) + "\n" -def _approx_tokens(text: str) -> int: - """Conservative chars/4 estimate. Used for the pre-send guard - and the compaction trigger when a precise count_tokens isn't - cheap (or the route isn't Anthropic). Errs slightly high so we - compact a touch earlier than strictly necessary.""" - return max(1, len(text or "") // 4) - - def _summarize_message_block(messages: list) -> str: """Programmatic, no-LLM summary of a message slice. Mirrors the shape of browser_agent._summarize_messages: extracts the original diff --git a/linter/config/vulture_whitelist.py b/linter/config/vulture_whitelist.py index 5bd9d198..e73921b3 100644 --- a/linter/config/vulture_whitelist.py +++ b/linter/config/vulture_whitelist.py @@ -48,7 +48,6 @@ requests_delta # This task is tooling-only and must not edit backend source, so these stay # whitelisted rather than deleted. They have zero call sites today; a future # non-additive cleanup pass should remove the definitions and these lines. -_approx_tokens _summarize_message_block thinking_params_for _resolve_model