chore: default context window to 200k

This commit is contained in:
chengyongru
2026-06-22 18:33:49 +08:00
committed by Xubin Ren
parent 991422a328
commit 0db9fbe250
10 changed files with 29 additions and 22 deletions
+2 -2
View File
@@ -183,7 +183,7 @@ class TestRestartCommand:
assert response is not None
assert "Model: test-model" in response.content
assert "Tokens: 0 in / 0 out" in response.content
assert "Context: 20k/65k (31% of input budget)" in response.content
assert "Context: 20k/200k (10% of input budget)" in response.content
assert "Session: 3 messages" in response.content
assert "Uptime: 2m 5s" in response.content
assert "Tasks: 0 active" in response.content
@@ -256,7 +256,7 @@ class TestRestartCommand:
assert response is not None
assert "Tokens: 1200 in / 34 out" in response.content
assert "Context: 1k/65k (1% of input budget)" in response.content
assert "Context: 1k/200k (0% of input budget)" in response.content
assert "Tasks: 0 active" in response.content
@pytest.mark.asyncio
+4 -2
View File
@@ -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 == 65_536
assert config.agents.defaults.context_window_tokens == 200_000
assert not hasattr(config.agents.defaults, "memory_window")
@@ -60,7 +60,7 @@ def test_save_config_writes_context_window_tokens_but_not_memory_window(tmp_path
defaults = saved["agents"]["defaults"]
assert defaults["maxTokens"] == 2222
assert defaults["contextWindowTokens"] == 65_536
assert defaults["contextWindowTokens"] == 200_000
assert "memoryWindow" not in defaults
@@ -85,6 +85,7 @@ def test_onboard_does_not_crash_with_legacy_memory_window(tmp_path, monkeypatch)
monkeypatch.setattr("nanobot.cli.commands.get_workspace_path", lambda _workspace=None: workspace)
from typer.testing import CliRunner
from nanobot.cli.commands import app
runner = CliRunner()
result = runner.invoke(app, ["onboard"], input="n\n")
@@ -131,6 +132,7 @@ def test_onboard_refresh_backfills_missing_channel_fields(tmp_path, monkeypatch)
)
from typer.testing import CliRunner
from nanobot.cli.commands import app
runner = CliRunner()
result = runner.invoke(app, ["onboard"], input="n\n")
+7 -4
View File
@@ -233,11 +233,11 @@ def test_update_agent_settings_accepts_context_window_options(
save_config(config, config_path)
monkeypatch.setattr("nanobot.config.loader._current_config_path", config_path)
payload = update_agent_settings({"context_window_tokens": ["262144"]})
payload = update_agent_settings({"context_window_tokens": ["200000"]})
assert payload["agent"]["context_window_tokens"] == 262144
assert payload["agent"]["context_window_tokens"] == 200000
saved = load_config(config_path)
assert saved.agents.defaults.context_window_tokens == 262144
assert saved.agents.defaults.context_window_tokens == 200000
def test_update_model_configuration_accepts_context_window_options(
@@ -274,7 +274,10 @@ def test_update_context_window_rejects_unknown_values(
save_config(Config(), config_path)
monkeypatch.setattr("nanobot.config.loader._current_config_path", config_path)
with pytest.raises(WebUISettingsError, match="context_window_tokens must be 65536 or 262144"):
with pytest.raises(
WebUISettingsError,
match="context_window_tokens must be 65536, 200000, or 262144",
):
update_agent_settings({"context_window_tokens": ["128000"]})