From 4e1ca13d60fc4ce98b74dbac188bc9ea3892a527 Mon Sep 17 00:00:00 2001 From: monkut Date: Wed, 22 Apr 2026 10:09:48 +0900 Subject: [PATCH] :sparkles: Add 'xhigh' effort level, default to it, bump to 0.2.5 Adds XHIGH = "xhigh" to VALID_EFFORT_LEVELS between HIGH and MAX and changes DEFAULT_EFFORT_LEVEL to XHIGH, matching Anthropic's recommended starting point for coding/agentic work on Opus 4.7. Refs #81 --- askcc/settings.py | 3 ++- pyproject.toml | 2 +- tests/test_askcc.py | 13 +++++++++++++ uv.lock | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/askcc/settings.py b/askcc/settings.py index 2629f7c..3a4ded9 100644 --- a/askcc/settings.py +++ b/askcc/settings.py @@ -40,10 +40,11 @@ class VALID_EFFORT_LEVELS(enum.StrEnum): # noqa: N801 LOW = "low" MEDIUM = "medium" HIGH = "high" + XHIGH = "xhigh" MAX = "max" -DEFAULT_EFFORT_LEVEL = VALID_EFFORT_LEVELS.MAX +DEFAULT_EFFORT_LEVEL = VALID_EFFORT_LEVELS.XHIGH def _resolve_effort_level() -> VALID_EFFORT_LEVELS: diff --git a/pyproject.toml b/pyproject.toml index 3c586bb..f533080 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "askcc" -version = "0.2.4" +version = "0.2.5" description = "A one-shot cc cli executor" authors = [{ name = "mknt", email = "shane.cousins@gmail.com" }] readme = "README.md" diff --git a/tests/test_askcc.py b/tests/test_askcc.py index 2834299..bf087c2 100644 --- a/tests/test_askcc.py +++ b/tests/test_askcc.py @@ -50,6 +50,7 @@ CLAUDE_ENV_MAX_THINKING_TOKENS, DEFAULT_EFFORT_LEVEL, DEFAULT_MAX_THINKING_TOKENS, + VALID_EFFORT_LEVELS, _resolve_effort_level, ) @@ -1582,6 +1583,18 @@ def test_invalid_effort_level_logged_and_ignored( assert result == DEFAULT_EFFORT_LEVEL assert "Invalid ASKCC_CLAUDE_EFFORT_LEVEL" in caplog.text + def test_xhigh_effort_level_resolves_without_warning( + self, monkeypatch: pytest.MonkeyPatch, caplog: pytest.LogCaptureFixture + ): + monkeypatch.setenv("ASKCC_CLAUDE_EFFORT_LEVEL", "xhigh") + with caplog.at_level("WARNING", logger="askcc.settings"): + result = _resolve_effort_level() + assert result == VALID_EFFORT_LEVELS.XHIGH + assert "Invalid ASKCC_CLAUDE_EFFORT_LEVEL" not in caplog.text + + def test_default_effort_level_is_xhigh(self): + assert DEFAULT_EFFORT_LEVEL == VALID_EFFORT_LEVELS.XHIGH + def test_max_thinking_tokens_from_env(self, monkeypatch: pytest.MonkeyPatch): monkeypatch.setenv("ASKCC_CLAUDE_MAX_THINKING_TOKENS", "50000") raw = os.getenv("ASKCC_CLAUDE_MAX_THINKING_TOKENS", "") diff --git a/uv.lock b/uv.lock index dc6c6f4..e07c76f 100644 --- a/uv.lock +++ b/uv.lock @@ -4,7 +4,7 @@ requires-python = "==3.14.*" [[package]] name = "askcc" -version = "0.2.4" +version = "0.2.5" source = { editable = "." } [package.dev-dependencies]