Your lightweight open-source personal agent.
Python agent-frameworkai-agentai-agentschatbotchatopsdiscord-botllm-agentsllmslocal-llmmcpmodel-context-protocolmulti-agentopenai-compatibleopenclawpersonal-ai-assistantpythonself-hostedtelegram-bot-ai-assistantwebuiworkflow-automation
fix(config): reduce max_tokens and context_window_tokens in schema
Xubin Ren858b6610c371
diff --git a/nanobot/config/schema.py b/nanobot/config/schema.pyindex 8b8a0a297..c8556ec9f 100644--- a/nanobot/config/schema.py+++ b/nanobot/config/schema.py@@ -93,8 +93,8 @@ class ModelPresetConfig(Base):model: strprovider: str = "auto"- max_tokens: int = 32_000- context_window_tokens: int = 262_144+ max_tokens: int = 8192+ context_window_tokens: int = 65_536temperature: float = 0.1reasoning_effort: str | None = None@@ -116,8 +116,8 @@ class AgentDefaults(Base):provider: str = ("auto" # Provider name (e.g. "anthropic", "openrouter") or "auto" for auto-detection)- max_tokens: int = 32_000- context_window_tokens: int = 262_144+ max_tokens: int = 8192+ context_window_tokens: int = 65_536context_block_limit: int | None = Nonetemperature: float = 0.1fallback_models: list[FallbackCandidate] = Field(default_factory=list)diff --git a/tests/cli/test_restart_command.py b/tests/cli/test_restart_command.pyindex 9748ff55c..f61e18923 100644--- a/tests/cli/test_restart_command.py+++ b/tests/cli/test_restart_command.py@@ -176,7 +176,7 @@ class TestRestartCommand:assert response is not Noneassert "Model: test-model" in response.contentassert "Tokens: 0 in / 0 out" in response.content- assert "Context: 20k/262k (7% of input budget)" in response.content+ assert "Context: 20k/65k (31% of input budget)" in response.contentassert "Session: 3 messages" in response.contentassert "Uptime: 2m 5s" in response.contentassert "Tasks: 0 active" in response.content@@ -240,7 +240,7 @@ class TestRestartCommand:assert response is not Noneassert "Tokens: 1200 in / 34 out" in response.content- assert "Context: 1k/262k (0% of input budget)" in response.content+ assert "Context: 1k/65k (1% of input budget)" in response.contentassert "Tasks: 0 active" in response.content@pytest.mark.asynciodiff --git a/tests/config/test_config_migration.py b/tests/config/test_config_migration.pyindex 9e28ff660..b27926ec0 100644--- a/tests/config/test_config_migration.py+++ b/tests/config/test_config_migration.py@@ -34,7 +34,7 @@ def test_load_config_keeps_max_tokens_and_ignores_legacy_memory_window(tmp_path)config = load_config(config_path)assert config.agents.defaults.max_tokens == 1234- assert config.agents.defaults.context_window_tokens == 262_144+ assert config.agents.defaults.context_window_tokens == 65_536assert not hasattr(config.agents.defaults, "memory_window")@@ -60,7 +60,7 @@ def test_save_config_writes_context_window_tokens_but_not_memory_window(tmp_pathdefaults = saved["agents"]["defaults"]assert defaults["maxTokens"] == 2222- assert defaults["contextWindowTokens"] == 262_144+ assert defaults["contextWindowTokens"] == 65_536assert "memoryWindow" not in defaults