Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
feat(brain,realtime): retire the cost caps that shrank what the models see
rubenluetke10-beep7c985c1ba64a
diff --git a/jarvis/awareness/config.py b/jarvis/awareness/config.pyindex ad04a08fab..7264980515 100644--- a/jarvis/awareness/config.py+++ b/jarvis/awareness/config.py@@ -74,8 +74,8 @@ class AwarenessVerdichterConfig(BaseModel):Defaults (Plan §6 D-A4):provider = "claude-api"model = "claude-haiku-4-5-20251001"- max_input_tokens = 800 # hard cap on input per episode- max_output_tokens = 200 # hard cap on output per episode+ max_input_tokens = 8000 # bound on input per episode+ max_output_tokens = 2000 # bound on output per episodetimeout_s = 5.0 # asyncio.wait_for timeout"""model_config = ConfigDict(extra="allow")@@ -83,8 +83,8 @@ class AwarenessVerdichterConfig(BaseModel):enabled: bool = Trueprovider: str = "claude-api"model: str = "claude-haiku-4-5-20251001"- max_input_tokens: int = 800- max_output_tokens: int = 200+ max_input_tokens: int = 8_000+ max_output_tokens: int = 2_000timeout_s: float = 5.0diff --git a/jarvis/brain/dispatcher.py b/jarvis/brain/dispatcher.pyindex ce1834d2b9..6d6ccecd59 100644--- a/jarvis/brain/dispatcher.py+++ b/jarvis/brain/dispatcher.py@@ -33,9 +33,9 @@ class BrainDispatcher:tools: dict[str, Tool] | None = None,executor: ToolExecutor | None = None,system_prompt: str | None = None,- max_turns: int = 15,- max_tokens_total: int = 50_000,- max_tokens: int = 8192,+ max_turns: int = 100,+ max_tokens_total: int = 2_000_000,+ max_tokens: int = 32_768,deadline_s: float | None = None,reasoning_effort: Literal["none"] | None = None,tool_context: dict[str, Any] | None = None,diff --git a/jarvis/brain/identity_card.py b/jarvis/brain/identity_card.pyindex 04725ea26d..4f5b5e8827 100644--- a/jarvis/brain/identity_card.py+++ b/jarvis/brain/identity_card.py@@ -86,7 +86,7 @@ __all__ = [#: Chosen so the always-present block stays in the same order of magnitude as#: one retrieved wiki snippet: standing knowledge must never out-cost the#: knowledge that was actually asked for.-MAX_IDENTITY_CARD_CHARS = 600+MAX_IDENTITY_CARD_CHARS = 4_000#: Disk cache, under the data directory. Holds the rendered card plus the hash#: of the sources it was built from — nothing that is not already in thediff --git a/jarvis/brain/iteration_budget.py b/jarvis/brain/iteration_budget.pyindex e8f94fdaf4..9c0f037aae 100644--- a/jarvis/brain/iteration_budget.py+++ b/jarvis/brain/iteration_budget.py@@ -26,8 +26,9 @@ from dataclasses import dataclass@dataclassclass IterationBudget:"""Tracks turns and generated tokens for a conversation loop."""- max_turns: int = 15- max_tokens_total: int = 50_000+ # Maintainer mandate 2026-08-24: no cost backstop — these are loop guards.+ max_turns: int = 100+ max_tokens_total: int = 2_000_000#: Cost backstop over the CUMULATIVE re-sent prompt. Distinct from the#: 2026-06-01 trap above: input never counts against the small OUTPUT#: ceiling — this is its own bound, sized so no legitimate flow reaches@@ -36,7 +37,7 @@ class IterationBudget:#: configured tool model. Tripping this behaves exactly like the other#: two bounds: the loop's budget directive forces one final grounded#: synthesis round — an honest answer, never a silent drop.- max_input_tokens_total: int = 400_000+ max_input_tokens_total: int = 50_000_000turns_used: int = 0tokens_used: int = 0 # OUTPUT tokens accumulated (runaway-generation signal)input_tokens_seen: int = 0 # cumulative re-sent prompt (cost backstop + telemetry)diff --git a/jarvis/brain/manager.py b/jarvis/brain/manager.pyindex 72cca61536..892d16ef1d 100644--- a/jarvis/brain/manager.py+++ b/jarvis/brain/manager.py@@ -168,8 +168,8 @@ _SKILL_TURN_STATE: ContextVar[_SkillTurnState | None] = ContextVar(#: Computer-Use") carries no task of its own, so the goal must inherit the#: recent turns that defined it. Kept small: the CU step prompt repeats the#: goal on every screenshot cycle.-_CU_CONTEXT_MAX_MESSAGES = 8-_CU_CONTEXT_MAX_MESSAGE_CHARS = 240+_CU_CONTEXT_MAX_MESSAGES = 40+_CU_CONTEXT_MAX_MESSAGE_CHARS = 2_000# Plugin-paired skill capture (2026-08-18): whether a catalog plugin holds a# usable credential is a keyring read, remembered per plugin for this long so@@ -3999,7 +3999,7 @@ class BrainManager:_contacts = getattr(self, "_contacts", None)if _contacts is not None:try:- contacts_block = _contacts.render_for_prompt(max_chars=800)+ contacts_block = _contacts.render_for_prompt(max_chars=8_000)if contacts_block:parts.append(contacts_block)except Exception: # noqa: BLE001@@ -4035,7 +4035,7 @@ class BrainManager:# even 5-10 facts get cut off mid-block and the LLM claims it knows# nothing. 2500 corresponds to ~600 tokens, stays prompt-cache-friendly.if len(cm) > 2500:- cm = cm[:2500] + "…"+ cm = cm[:20_000] + "…"parts.append(cm)# Phase A1: awareness snapshot as fallback when the LLM does not@@ -4046,7 +4046,7 @@ class BrainManager:# prefix stays byte-stable across turns. Legacy mode keeps it here.if self._awareness_manager is not None and not self._cache_optimized():try:- snap = self._awareness_manager.state.snapshot_for_prompt(max_chars=600)+ snap = self._awareness_manager.state.snapshot_for_prompt(max_chars=4_000)if snap:parts.append("CURRENT CONTEXT (background, for orientation only, do "@@ -4305,7 +4305,7 @@ class BrainManager:]if self._awareness_manager is not None:try:- snap = self._awareness_manager.state.snapshot_for_prompt(max_chars=600)+ snap = self._awareness_manager.state.snapshot_for_prompt(max_chars=4_000)if snap:parts.append("CURRENT CONTEXT (background, for orientation only, do "@@ -5929,7 +5929,7 @@ class BrainManager:#: Cap on the conditionally-injected instruction text for a NARROW match.#: Bounded so one pathological skill body cannot flood a voice turn.- _NARROW_INJECTION_CHAR_CAP = 6_000+ _NARROW_INJECTION_CHAR_CAP = 60_000def _render_skill_candidate_hint(self, user_text: str = "") -> str | None:"""Narrow the skill choice for a turn the matcher did NOT capture.@@ -9738,8 +9738,8 @@ class BrainManager:def _build_history_hints(self,*,- max_turns: int = 3,- max_chars_per_msg: int = 240,+ max_turns: int = 20,+ max_chars_per_msg: int = 4_000,) -> list[str]:"""Formats the last N turn pairs as compact ``context_hints``.@@ -12392,7 +12392,8 @@ class BrainManager:_SEEDABLE_ROLES: frozenset[str] = frozenset({"user", "assistant", "system"})# Same window the auto-append paths enforce (see the ``self._history =# self._history[-40:]`` trims throughout generate()/force-spawn).- _HISTORY_MAX: int = 40+ # Maintainer mandate 2026-08-24: full call memory, not a cost window.+ _HISTORY_MAX: int = 400def seed_history(self, turns: Iterable[Any]) -> None:"""Preseed the conversation buffer with prior turns.diff --git a/jarvis/brain/tool_use_loop.py b/jarvis/brain/tool_use_loop.pyindex 0f08a1cfd0..1f1ca82145 100644--- a/jarvis/brain/tool_use_loop.py+++ b/jarvis/brain/tool_use_loop.py@@ -46,7 +46,9 @@ from .tool_call_recovery import extract_leaked_tool_calls# so one verbose provider can never flood the context, slow the turn and crowd# out the answer (live bug 2026-07-01). The event-bus/DB preview cap# (``safe_preview``) is a separate path and never touched what the model saw.-_MAX_TOOL_RESULT_CHARS = 8000+# Maintainer mandate 2026-08-24: context caps are not a cost lever; the bound+# exists only so one runaway result cannot exceed a provider window outright.+_MAX_TOOL_RESULT_CHARS = 100_000# Directive appended for the deadline-forced final round (see ``deadline_s``).# English on purpose: it is model-facing prompt text, never spoken to the user.@@ -578,7 +580,7 @@ class ToolUseLoop:*,system_prompt: str | None = None,budget: IterationBudget | None = None,- max_tokens: int = 8192,+ max_tokens: int = 32_768,deadline_s: float | None = None,reasoning_effort: Literal["none"] | None = None,tool_context: dict[str, Any] | None = None,diff --git a/jarvis/brain/wiki_context.py b/jarvis/brain/wiki_context.pyindex 73723cfef7..7039274050 100644--- a/jarvis/brain/wiki_context.py+++ b/jarvis/brain/wiki_context.py@@ -209,7 +209,7 @@ class WikiContextInjector:self,*,search: VaultSearch | None,- max_chars: int = 1500,+ max_chars: int = 12_000,latency_budget_ms: int = 150,min_keyword_length: int = 4,relevance_gate: bool = True,diff --git a/jarvis/core/config.py b/jarvis/core/config.pyindex a77f6a1b19..ec8d93f0d0 100644--- a/jarvis/core/config.py+++ b/jarvis/core/config.py@@ -1319,7 +1319,7 @@ class BrainConfig(BaseModel):# voice path sets no continuation). Raised 4096 -> 8192 on 2026-06-01 after# a live cut-off report; kept configurable so an operator can trade speech# length against latency/cost. ~8192 tokens ≈ several minutes of speech.- max_tokens: int = Field(default=8192, ge=256, le=32_768)+ max_tokens: int = Field(default=32_768, ge=256, le=32_768)# Phase 5 tiered routing — Wave-4 migration: the ``sub_jarvis`` tier was# replaced by the Jarvis-Agent bridge (see docs/jarvis-agents-bridge.md §11).# Only ``router`` remains as a tier; the heavy worker runs as an external@@ -1404,7 +1404,7 @@ class WikiCuratorConfig(BaseModel):provider: str = "" # "" = fall back to brain.primarymodel: str = "" # "" = provider default model- max_input_tokens: int = 8000+ max_input_tokens: int = 64_000# Headroom for a complete proposal; the streaming truncation guard# rejects any residual length-capped generation. The Stage-2 judge# returns FULL page bodies per add/update, so a batched response@@ -1562,7 +1562,7 @@ class ExtractorConfig(BaseModel):enabled: bool = True# Turns shorter than this never reach the LLM (smalltalk floor).min_user_chars: int = 12- max_output_tokens: int = 800+ max_output_tokens: int = 4_000timeout_s: float = 30.0# Personal-salience floor (1-5): candidates the model scores below this# are dropped in Stage 1. 3 keeps peripheral personal facts and drops@@ -2300,7 +2300,7 @@ class ScreenContextConfig(BaseModel):#: Character budget for on-screen text handed to the model. Text beyond it#: is cut and the cut is reported, never silently dropped.- max_text_chars: int = 4000+ max_text_chars: int = 32_000#: Seconds an unconsumed capture stays in memory before it is discarded.#: A capture is also discarded on first use, whichever comes first.@@ -2799,7 +2799,7 @@ class WikiContextConfig(BaseModel):model_config = ConfigDict(extra="allow")enabled: bool = True- max_chars: int = 1500+ max_chars: int = 12_000# 150 (was 80): the vault search opens its SQLite connection lazily# inside this budget, so the first qualifying turn of a process regularly# timed out. The factory warms the connection at boot; the wider budget@@ -2834,7 +2834,7 @@ class WikiContextConfig(BaseModel):# rides in the CACHED system-prompt prefix. ``false`` removes the block# entirely; the cap is an upper bound only (never raises the hard 600).identity_card: bool = True- identity_card_max_chars: int = 600+ identity_card_max_chars: int = 4_000class VoiceConfig(BaseModel):@@ -2886,7 +2886,7 @@ class VoiceConfig(BaseModel):# jarvis_action. A provider may declare a LOWER budget for its own wire# (``tool_declaration_budget_tokens`` capability, AP-21); the smaller of# the two applies. 0 disables the bound.- realtime_tool_declaration_budget_tokens: int = 20_000+ realtime_tool_declaration_budget_tokens: int = 0# ADR-0034 (2026-08-18). When the user opens a NEW turn while an earlier# order's provider function call (jarvis_action) is still unanswered on# the wire, the session answers that call at once with a closed "stilldiff --git a/jarvis/core/protocols.py b/jarvis/core/protocols.pyindex 2a7b5994af..f46d43632c 100644--- a/jarvis/core/protocols.py+++ b/jarvis/core/protocols.py@@ -105,7 +105,7 @@ class BrainRequest:tools: tuple[dict[str, Any], ...] = field(default_factory=tuple)system: str | None = Nonetemperature: float = 0.7- max_tokens: int = 4096+ max_tokens: int = 32_768stream: bool = True# Hint for providers whose models spend internal reasoning ("thinking")# tokens before answering. "none" asks the provider to disable/minimizediff --git a/jarvis/memory/soul.py b/jarvis/memory/soul.pyindex 42e58dbfb6..33fcc01e12 100644--- a/jarvis/memory/soul.py+++ b/jarvis/memory/soul.py@@ -20,7 +20,7 @@ from .frontmatter import append_to_section, parse_frontmatter, write_frontmatterlog = logging.getLogger(__name__)-MAX_PROMPT_CHARS = 1000+MAX_PROMPT_CHARS = 8_000@dataclassdiff --git a/jarvis/memory/user_profile.py b/jarvis/memory/user_profile.pyindex 61c6dbe544..21af83b7c9 100644--- a/jarvis/memory/user_profile.py+++ b/jarvis/memory/user_profile.py@@ -39,7 +39,7 @@ CLUSTERS = ("identity", "communication", "work_style", "values", "relationship")SECTIONS = ("context", "projects", "observations")# Maximum size of the prompt block — cache-friendly-MAX_PROMPT_CHARS = 2000+MAX_PROMPT_CHARS = 16_000@dataclassdiff --git a/jarvis/missions/result_reader.py b/jarvis/missions/result_reader.pyindex 38f479e83d..939b78c419 100644--- a/jarvis/missions/result_reader.py+++ b/jarvis/missions/result_reader.py@@ -11,9 +11,9 @@ from jarvis.missions.kontrollierer.deliverable_paths import (_MISSION_ID_RE = re.compile(r"^[0-9a-f-]{6,64}$", re.IGNORECASE)_MAX_FILES: Final[int] = 16-_MAX_FILE_CHARS: Final[int] = 12_000-_MAX_TOTAL_CHARS: Final[int] = 24_000-_MAX_READ_BYTES: Final[int] = 96_000+_MAX_FILE_CHARS: Final[int] = 120_000+_MAX_TOTAL_CHARS: Final[int] = 240_000+_MAX_READ_BYTES: Final[int] = 960_000_TEXT_SUFFIXES: Final[frozenset[str]] = frozenset({".adoc",diff --git a/jarvis/missions/workers/api_agent_worker.py b/jarvis/missions/workers/api_agent_worker.pyindex 37f6866ce7..252ca6dbe8 100644--- a/jarvis/missions/workers/api_agent_worker.py+++ b/jarvis/missions/workers/api_agent_worker.py@@ -178,7 +178,7 @@ def _resolve_worker_model(provider: str, explicit: str) -> str:_WORKER_TIMEOUT_S: float = 1200.0 # 20 min hard cap, mirrors the other workers_MAX_TURNS: int = 25-_MAX_TOKENS: int = 8192+_MAX_TOKENS: int = 32_768_SYSTEM_PROMPT = ("You are an autonomous software worker running inside an isolated git "diff --git a/jarvis/plugins/realtime/openai_realtime.py b/jarvis/plugins/realtime/openai_realtime.pyindex abb6894fec..d1fbe098ba 100644--- a/jarvis/plugins/realtime/openai_realtime.py+++ b/jarvis/plugins/realtime/openai_realtime.py@@ -1386,7 +1386,7 @@ class OpenAIRealtimeProvider:# on a setup-once transport. Tools over the budget stay reachable through# jarvis_action; ``[voice].realtime_tool_declaration_budget_tokens`` can# only lower this further (the smaller of the two applies).- tool_declaration_budget_tokens = 8_000+ tool_declaration_budget_tokens = 0implicit_usage_fallback_allowed = Trueinput_sample_rate = _INPUT_RATEoutput_sample_rate = _OUTPUT_RATE@@ -1605,7 +1605,7 @@ class LocalRealtimeProvider:supports_realtime = True# Same OpenAI-protocol wire, same per-response context billing model —# and a self-hosted model is usually the smaller one (ADR-0035 §4).- tool_declaration_budget_tokens = 8_000+ tool_declaration_budget_tokens = 0# Never an implicit stand-in: a self-hosted endpoint is a deliberate choice,# and quietly routing a call into one the user did not pick is the opposite# of what a local card is for.diff --git a/jarvis/plugins/tool/drive_rest.py b/jarvis/plugins/tool/drive_rest.pyindex 6a7743fbc5..60ab423acb 100644--- a/jarvis/plugins/tool/drive_rest.py+++ b/jarvis/plugins/tool/drive_rest.py@@ -46,7 +46,7 @@ _NEEDS_RECONNECT = (# Reading a file's content into the model context is bounded like Gmail's body:# a large document would blow the context and slow the voice turn for no answer# value. We cap the extracted text and mark the truncation.-_DRIVE_CONTENT_CHAR_CAP = 4000+_DRIVE_CONTENT_CHAR_CAP = 40_000# Field projection for list/get — only what actually answers a file question,# incl. the webViewLink (the "Drive URL" the usage card asks us to report back).diff --git a/jarvis/plugins/tool/gmail_rest.py b/jarvis/plugins/tool/gmail_rest.pyindex 2a9ae6073d..1847871b84 100644--- a/jarvis/plugins/tool/gmail_rest.py+++ b/jarvis/plugins/tool/gmail_rest.py@@ -36,7 +36,7 @@ _NEEDS_RECONNECT = (# context slowed a voice turn to ~20 s and added no answer value (live bug# 2026-07-01 "Was steht alles in meinen E-Mails drin?"). We project a read down# to the fields that actually answer a mail question and cap the plain-text body.-_GMAIL_BODY_CHAR_CAP = 2000+_GMAIL_BODY_CHAR_CAP = 20_000def _decode_b64url(data: str) -> str:@@ -156,7 +156,7 @@ class GmailRestTool:"default": "list_messages",},"query": {"type": "string", "description": "Gmail search query (list_messages)"},- "max_results": {"type": "integer", "default": 10},+ "max_results": {"type": "integer", "default": 50},"message_id": {"type": "string","description": "message id (get/modify/trash/delete_message)",@@ -265,7 +265,7 @@ class GmailRestTool:# -- public actions (also directly unit-testable) ------------------------ async def list_messages(self, *, query: str = "", max_results: int = 10) -> dict[str, Any]:+ async def list_messages(self, *, query: str = "", max_results: int = 50) -> dict[str, Any]:return await self._with_auth_retry(lambda headers: self._get("/messages", {"q": query, "maxResults": max_results}, headers@@ -340,7 +340,7 @@ class GmailRestTool:if action == "list_messages":out = await self.list_messages(query=args.get("query", ""),- max_results=int(args.get("max_results", 10)),+ max_results=int(args.get("max_results", 50)),)elif action == "get_message":mid = args.get("message_id")diff --git a/jarvis/plugins/tool/run_shell.py b/jarvis/plugins/tool/run_shell.pyindex c1abd4db1e..5a18d7da13 100644--- a/jarvis/plugins/tool/run_shell.py+++ b/jarvis/plugins/tool/run_shell.py@@ -244,8 +244,8 @@ class RunShellTool:success=success,output={"exit_code": proc.returncode,- "stdout": stdout[:4000],- "stderr": stderr[:2000],+ "stdout": stdout[:40_000],+ "stderr": stderr[:20_000],},error=None if success else f"exit {proc.returncode}",)diff --git a/jarvis/plugins/tool/spawn_worker.py b/jarvis/plugins/tool/spawn_worker.pyindex 67a31ce746..c3b1bd6539 100644--- a/jarvis/plugins/tool/spawn_worker.py+++ b/jarvis/plugins/tool/spawn_worker.py@@ -201,8 +201,8 @@ def _shares_content_word(a: str, b: str) -> bool:return bool(wa & wb)-_MAX_CONTEXT_HINTS = 8-_MAX_CONTEXT_HINT_CHARS = 320+_MAX_CONTEXT_HINTS = 40+_MAX_CONTEXT_HINT_CHARS = 4_000def _bounded_context_hints(context_hints: list[str] | None) -> list[str]:diff --git a/jarvis/plugins/tool/ultrawiki_search.py b/jarvis/plugins/tool/ultrawiki_search.pyindex e92b95f280..15d04489c9 100644--- a/jarvis/plugins/tool/ultrawiki_search.py+++ b/jarvis/plugins/tool/ultrawiki_search.py@@ -45,8 +45,8 @@ from jarvis.core.protocols import ToolResultlog = logging.getLogger(__name__)-_MAX_SNIPPET_CHARS = 220-_MAX_OUTPUT_CHARS = 4000+_MAX_SNIPPET_CHARS = 2_000+_MAX_OUTPUT_CHARS = 40_000def build_ultrawiki_service_resolver() -> Callable[[], Any]:diff --git a/jarvis/realtime/session.py b/jarvis/realtime/session.pyindex d517457688..334e11dfed 100644--- a/jarvis/realtime/session.py+++ b/jarvis/realtime/session.py@@ -277,8 +277,8 @@ _FAILURE_REASON_MAX_CHARS = 160# (``_lookup_facts``). Three search variants return up to fifteen rows between# them; the answer to a spoken question lives in the first few, and everything# past that is prompt weight paid on the turn-critical path for nothing.-_LOOKUP_FACT_MAX_ITEMS = 5-_LOOKUP_FACT_MAX_CHARS = 320+_LOOKUP_FACT_MAX_ITEMS = 50+_LOOKUP_FACT_MAX_CHARS = 4_000# A delegated turn fails for a handful of KNOWN internal reasons, and the raw# internal strings are engineering vocabulary ("No configured Tool Model# completed the delegated turn.") that must never be spoken. Each cause maps to@@ -666,8 +666,10 @@ _NATIVE_TOOL_DEADLINE_S = VOICE_TOOL_BUDGET_S# the original task was trimmed out exactly when the recovery turn needed it# (live forensic 2026-07-15 08:00: the final mission posted a placeholder# announcement because the announce request had just left the window).-_DELEGATE_HISTORY_MAX_MESSAGES = 20-_DELEGATE_HISTORY_MAX_CHARS = 1_200+# Maintainer mandate 2026-08-24: the call transcript is kept whole; the caps+# below are overflow guards, not cost windows.+_DELEGATE_HISTORY_MAX_MESSAGES = 400+_DELEGATE_HISTORY_MAX_CHARS = 100_000# Per-result room in a re-grounded retry prompt# (:meth:`RealtimeVoiceSession._tool_grounding_block`). Generous on purpose:# the cost of trimming is the model losing the very fact it must speak, and@@ -1235,7 +1237,7 @@ def _toolless_ambiguous_action(text: str) -> bool:# characters is roughly three spoken minutes — far beyond any real voice# answer, small enough to stop a runaway tool result from riding along in# every later turn of the call.-_DELEGATE_RESULT_MAX_CHARS = 4_000+_DELEGATE_RESULT_MAX_CHARS = 100_000# The one opener the transports' developer-message silence rule names as its@@ -2123,7 +2125,7 @@ _COMPLETE_THE_REQUEST_DIRECTIVE = (# instructions. The block is re-sent with every per-turn session update, so a# pathologically large file must never bloat that hot path; typical files are# a few hundred characters and pass through untouched.-_PREFERENCES_MAX_CHARS = 4000+_PREFERENCES_MAX_CHARS = 64_000#: Cap on a skill body injected straight into the live session. Tighter than the#: preferences cap above by precedent, not by guess: that block is the user's own@@ -2134,7 +2136,7 @@ _PREFERENCES_MAX_CHARS = 4000#: Over the cap the turn falls back to the delegate. It is NEVER truncated — a#: half-injected instruction list produces a half-executed skill, which is#: strictly worse than a slow correct answer.-_REALTIME_SKILL_MAX_CHARS = 1500+_REALTIME_SKILL_MAX_CHARS = 32_000#: A body mentioning tools cannot be honoured by a model that only has#: `jarvis_action` and `end_call`. An author declaring `requires_tools: []` whilediff --git a/jarvis/realtime/tools.py b/jarvis/realtime/tools.pyindex 314759717f..07a105da83 100644--- a/jarvis/realtime/tools.py+++ b/jarvis/realtime/tools.py@@ -49,14 +49,17 @@ from jarvis.voice.tool_confirmation import format_tool_confirmation_VALID_WIRE_NAME = re.compile(r"^[A-Za-z_][A-Za-z0-9_]{0,63}$")_MAX_DESCRIPTION_CHARS = 4_000_MAX_ARGUMENT_CHARS = 32_000-_MAX_RESULT_CHARS = 8_000+# Maintainer mandate 2026-08-24: context caps are not a cost lever. The old+# 8 000-char cut hid tool data the model had to speak one turn later. The+# remaining bound only keeps a single result inside the 128k live window.+_MAX_RESULT_CHARS = 100_000# ADR-0035 §4 compact rendering for the live model: router-brain tool# descriptions run to 500-2 900 characters of usage prose written for a# text model with a 12-round loop; the live model needs the purpose and the# parameters, and the ToolExecutor enforces the risk rules regardless. A# sentence boundary is preferred when cutting.-COMPACT_DESCRIPTION_CHARS = 450-COMPACT_PARAMETER_DESCRIPTION_CHARS = 120+COMPACT_DESCRIPTION_CHARS = 4_000+COMPACT_PARAMETER_DESCRIPTION_CHARS = 4_000#: Rough token estimate for the declaration budget (characters per token).CHARS_PER_TOKEN = 4# Drop order when a declaration set exceeds its budget (ADR-0035 §4): thediff --git a/tests/unit/brain/test_ambient_knowledge_cost_guard.py b/tests/unit/brain/test_ambient_knowledge_cost_guard.pyindex 18a66ec486..0c51345b97 100644--- a/tests/unit/brain/test_ambient_knowledge_cost_guard.py+++ b/tests/unit/brain/test_ambient_knowledge_cost_guard.py@@ -190,7 +190,7 @@ def test_identity_card_respects_its_cap_on_a_huge_profile(tmp_path: Path) -> Nonrecheck_interval_s=0.0,)card = cache.card()- assert 0 < len(card.text) <= ic.MAX_IDENTITY_CARD_CHARS == 600+ assert 0 < len(card.text) <= ic.MAX_IDENTITY_CARD_CHARS == 4_000def test_the_configured_cap_can_only_lower_the_budget(tmp_path: Path) -> None:diff --git a/tests/unit/brain/test_response_max_tokens_cap.py b/tests/unit/brain/test_response_max_tokens_cap.pyindex 0afa7195df..478cb540fd 100644--- a/tests/unit/brain/test_response_max_tokens_cap.py+++ b/tests/unit/brain/test_response_max_tokens_cap.py@@ -42,9 +42,10 @@ class _Executor:return ToolResult(success=True, output="ok")-def test_brain_config_default_response_cap_is_8192() -> None:- """The agreed safety ceiling per response is 8192 tokens (raised from 4096)."""- assert BrainConfig().max_tokens == 8192+def test_brain_config_default_response_cap_is_the_schema_maximum() -> None:+ """Maintainer mandate 2026-08-24: the per-response ceiling is not a cost+ lever — the default sits at the schema maximum (32 768)."""+ assert BrainConfig().max_tokens == 32_768@pytest.mark.asyncio@@ -59,13 +60,13 @@ async def test_tool_use_loop_threads_response_max_tokens() -> None:@pytest.mark.asyncio-async def test_tool_use_loop_default_cap_is_8192() -> None:+async def test_tool_use_loop_default_cap_is_the_schema_maximum() -> None:brain = _RecordingBrain()loop = ToolUseLoop(brain, {}, _Executor()) # type: ignore[arg-type]await loop.run([BrainMessage(role="user", content="Hallo")])- assert brain.requests[0].max_tokens == 8192+ assert brain.requests[0].max_tokens == 32_768@pytest.mark.asynciodiff --git a/tests/unit/brain/test_seed_history.py b/tests/unit/brain/test_seed_history.pyindex ff8b4fd6b1..f0d5dd2cc6 100644--- a/tests/unit/brain/test_seed_history.py+++ b/tests/unit/brain/test_seed_history.py@@ -70,12 +70,12 @@ def test_seed_history_drops_unknown_roles_and_empty_text() -> None:def test_seed_history_caps_to_last_turns() -> None:m = _bare_manager()- turns = [("user" if i % 2 == 0 else "assistant", f"m{i}") for i in range(120)]+ turns = [("user" if i % 2 == 0 else "assistant", f"m{i}") for i in range(1000)]m.seed_history(turns)- # Capped to the same 40-message window the auto-append paths enforce.- assert len(m._history) == 40- assert m._history[-1].content == "m119"- assert m._history[0].content == "m80"+ # Capped to the same 400-message window the auto-append paths enforce.+ assert len(m._history) == 400+ assert m._history[-1].content == "m999"+ assert m._history[0].content == "m600"def test_seed_history_empty_clears() -> None:diff --git a/tests/unit/brain/test_tool_use_loop.py b/tests/unit/brain/test_tool_use_loop.pyindex bf15f4afed..98bad8ebf4 100644--- a/tests/unit/brain/test_tool_use_loop.py+++ b/tests/unit/brain/test_tool_use_loop.py@@ -60,7 +60,7 @@ class _HugeOutputTool:class _ExecHuge:async def execute(self, tool: Any, args: dict[str, Any], **_: Any) -> ToolResult:- return ToolResult(success=True, output="X" * 50_000)+ return ToolResult(success=True, output="X" * (_MAX_TOOL_RESULT_CHARS + 50_000))class _ToolThenAnswerBrain:@@ -81,7 +81,7 @@ class _ToolThenAnswerBrain:async def test_tool_result_is_capped_before_reaching_brain() -> None:"""Systemic backstop (2026-07-01): no tool may flood the model context withan unbounded raw payload (a raw Gmail ``format=full`` message is ~23k chars).- A ~50k-char tool output must be truncated — with a marker — before it is+ A tool output far beyond the cap must be truncated — with a marker — before it isserialized into the tool-role message the brain sees on the next turn."""brain = _ToolThenAnswerBrain()loop = ToolUseLoop(diff --git a/tests/unit/plugins/tool/test_gmail_rest.py b/tests/unit/plugins/tool/test_gmail_rest.pyindex c5c85220ee..3cbadca3f5 100644--- a/tests/unit/plugins/tool/test_gmail_rest.py+++ b/tests/unit/plugins/tool/test_gmail_rest.py@@ -6,7 +6,7 @@ import base64import httpximport pytest-from jarvis.plugins.tool.gmail_rest import GmailRestTool+from jarvis.plugins.tool.gmail_rest import _GMAIL_BODY_CHAR_CAP, GmailRestTool@pytest.mark.asyncio@@ -281,7 +281,7 @@ async def test_get_message_returns_slim_projection_not_raw_mime():@pytest.mark.asyncioasync def test_get_message_caps_a_long_body():- long_body = "wort " * 2000 # ~10k chars decoded+ long_body = "wort " * 6000 # ~30k chars decoded, above the body capraw_body_b64 = base64.urlsafe_b64encode(long_body.encode("utf-8")).decode("ascii")fat = {"id": "m2",@@ -305,5 +305,5 @@ async def test_get_message_caps_a_long_body():result = await tool.execute({"action": "get_message", "message_id": "m2"}, ctx=None)assert result.success is Truebody = result.output["body"]- assert len(body) <= 2100 # cap (2000) + short truncation marker+ assert len(body) <= _GMAIL_BODY_CHAR_CAP + 100 # cap + short truncation markerassert "truncated" in bodydiff --git a/tests/unit/plugins/tool/test_spawn_worker_mission_prompt.py b/tests/unit/plugins/tool/test_spawn_worker_mission_prompt.pyindex b6516f9699..0669df14b2 100644--- a/tests/unit/plugins/tool/test_spawn_worker_mission_prompt.py+++ b/tests/unit/plugins/tool/test_spawn_worker_mission_prompt.py@@ -82,7 +82,7 @@ def test_no_action_falls_back_to_raw_utterance() -> None:def test_no_action_keeps_bounded_recent_context_for_references() -> None:"""A forced follow-up must not reach a stateless worker without its topic."""- long_hint = "bounded-marker " + ("x" * 1_000)+ long_hint = "bounded-marker " + ("x" * 10_000)prompt = _build_mission_prompt(utterance="Where is it? I also installed it as a plugin.",action="",diff --git a/tests/unit/realtime/test_factory.py b/tests/unit/realtime/test_factory.pyindex f28423109a..4c5bfce21e 100644--- a/tests/unit/realtime/test_factory.py+++ b/tests/unit/realtime/test_factory.py@@ -218,7 +218,9 @@ def test_realtime_tool_mode_defaults_to_hybrid_native_tools() -> None:"""ADR-0035: the live model holds the catalog itself; the Tool Model isfor computer use. ``delegate`` and ``direct`` remain explicit choices."""assert VoiceConfig().realtime_tool_mode == "hybrid"- assert VoiceConfig().realtime_tool_declaration_budget_tokens > 0+ # 0 = unbounded: the whole catalog is declared (maintainer mandate+ # 2026-08-24 — declaration budgets are not a cost lever).+ assert VoiceConfig().realtime_tool_declaration_budget_tokens == 0def test_one_realtime_key_builds_without_a_classic_brain(monkeypatch) -> None:diff --git a/tests/unit/realtime/test_hybrid_tool_mode.py b/tests/unit/realtime/test_hybrid_tool_mode.pyindex 4953b54344..55492a3497 100644--- a/tests/unit/realtime/test_hybrid_tool_mode.py+++ b/tests/unit/realtime/test_hybrid_tool_mode.py@@ -357,7 +357,8 @@ def test_router_catalog_renders_for_every_realtime_wire() -> None:assert _VALID_WIRE_NAME.fullmatch(declaration["name"]), declaration["name"]assert isinstance(declaration["parameters"], dict)assert len(declaration["description"]) <= COMPACT_DESCRIPTION_CHARS + 1- assert bridge.declaration_chars <= budget_chars+ if budget_chars > 0:+ assert bridge.declaration_chars <= budget_charssanitized = _sanitize_declarations(tuple(declarations))assert len(sanitized) == len(declarations)for entry in sanitized:diff --git a/tests/unit/realtime/test_live_usage_metering.py b/tests/unit/realtime/test_live_usage_metering.pyindex 73027b193c..2a06d524fe 100644--- a/tests/unit/realtime/test_live_usage_metering.py+++ b/tests/unit/realtime/test_live_usage_metering.py@@ -188,7 +188,7 @@ class TestDelegateResultCap:assert "[result shortened]" not in promptdef test_runaway_result_is_capped(self) -> None:- text = "A sentence about something. " * 1000+ text = "A sentence about something. " * 5000prompt = _delegate_result_prompt(text, language="en", success=True)assert "[result shortened]" in prompt# Framing adds ~1.2k chars; the injected payload stays bounded.diff --git a/tests/unit/test_iteration_budget.py b/tests/unit/test_iteration_budget.pyindex a1a90b0d75..eb218bc855 100644--- a/tests/unit/test_iteration_budget.py+++ b/tests/unit/test_iteration_budget.py@@ -42,7 +42,11 @@ def test_cumulative_input_backstop_trips_only_on_runaway_loops():# input backstop bounds that tail without touching legitimate flows —# and unlike the 2026-06-01 trap, a single large-context turn stays# far below it.- b = IterationBudget(max_turns=100, max_tokens_total=50_000)+ # The shipped default is far higher (maintainer mandate 2026-08-24: no+ # cost backstop); the guard itself still works when an operator sets one.+ b = IterationBudget(+ max_turns=100, max_tokens_total=50_000, max_input_tokens_total=400_000+ )b.record_turn(tokens_in=60_000, tokens_out=40)assert not b.exceeded(), "one large-context turn must not trip the backstop"for _ in range(6):