Skip to content
This repository was archived by the owner on Nov 10, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Removed

- **Removed the dead public helper `get_context_window` from `claude_task_master.core`.** Defined in `core/agent_models.py`, re-exported through the `core` package facade and referenced by a docstring clause in `core/config.py`, it had no caller anywhere in the codebase, and its return value set no compaction threshold and no SDK context window — a model-to-window mapping nothing consumed. The data behind it is retained: `MODEL_CONTEXT_WINDOWS`, `MODEL_CONTEXT_WINDOWS_STANDARD`, `DEFAULT_COMPACT_THRESHOLD_PERCENT` and `ContextWindowsConfig` are unchanged; only the unreachable accessor and the text naming it are deleted.

### Fixed

- **The committed `requirements.txt` pinned `claude-agent-sdk==0.2.168` while the authoritative `uv.lock` resolved 0.2.150.** The artifact is a `uv pip compile` output regenerated in v0.1.90, and that compile floated the SDK 18 versions past the one this project developed against: `requirements.txt:41` carried `claude-agent-sdk==0.2.168`, while `uv.lock:277-279` resolves `claude-agent-sdk` to **0.2.150** and `pyproject.toml:29` declares `claude-agent-sdk>=0.2.150,<0.3`. The two disagreed about which SDK a downstream install would get. Nothing in CI reads the artifact — CI installs the project with `uv pip install -e ".[all]"` (`.github/workflows/ci.yml:42`) rather than from the lock — and the repo-setup handler reaches a target project's `requirements.txt` only in a narrow case: `uv pip install -r requirements.txt` (`src/claude_task_master/mcp/tool_handlers_setup.py:212-225`) runs for a project that has a `requirements.txt` but neither a `pyproject.toml` nor a `uv.lock` — a setup.py-style project — and only with `uv` on PATH; a project with a `pyproject.toml` is installed with `uv sync` (:179) or `pip install -e .[dev]` (:261) instead, and that same narrow class without `uv` on PATH gets `pip install -r requirements.txt` (:289-302). This repository has both a `pyproject.toml` and a `uv.lock`, so pointing the handler at it takes the `uv sync` path and never reads the artifact: no automated consumer here ever saw the stale pin. The artifact now pins `claude-agent-sdk==0.2.150`, matching the lock. `pyproject.toml` and `uv.lock` are untouched: this is a correction **down** to the already-resolved version, not an SDK upgrade. `tests/test_sdk_pin_consistency.py` guards the pair — it compares the committed files only (never the installed SDK) and asserts that the artifact's single `==` pin equals the lock's resolution and that both satisfy the declared range.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ This creates `.claude-task-master/config.json`. The smartest tier (`opus`) defau
}
```

> **Note:** `context_windows` and `CLAUDETM_CONTEXT_*` are **currently inert metadata** retained for compatibility. Values can still be loaded from configuration, emitted by profiles, and read by the context-window helper, but they do not drive runtime auto-compaction, prevent context overflow, or grant a larger context window. Actual context limits and compaction behavior depend on Claude Code/SDK and the provider, not these settings.
> **Note:** `context_windows` and `CLAUDETM_CONTEXT_*` are **currently inert metadata** retained for compatibility. Values can still be loaded from configuration and emitted by profiles, but they do not drive runtime auto-compaction, prevent context overflow, or grant a larger context window. Actual context limits and compaction behavior depend on Claude Code/SDK and the provider, not these settings.
>
> Existing configurations such as the following remain accepted, but changing these values for an account tier or gateway has no runtime compaction effect:
> ```json
Expand Down
2 changes: 0 additions & 2 deletions src/claude_task_master/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
MODEL_CONTEXT_WINDOWS_STANDARD,
ModelType,
TaskComplexity,
get_context_window,
get_tools_for_phase,
parse_task_complexity,
)
Expand Down Expand Up @@ -219,7 +218,6 @@
"MODEL_CONTEXT_WINDOWS",
"MODEL_CONTEXT_WINDOWS_STANDARD",
"DEFAULT_COMPACT_THRESHOLD_PERCENT",
"get_context_window",
# Rate limit classes
"RateLimitConfig",
# State exceptions
Expand Down
35 changes: 3 additions & 32 deletions src/claude_task_master/core/agent_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,9 @@ def get_model_name_for_complexity(cls, complexity: TaskComplexity) -> ModelType:
# Constants
# =============================================================================

# Retained context-window metadata defaults (tokens) for get_context_window.
# The helper can read config.json "context_windows" overrides, but has no runtime
# compaction caller. These values do not set compaction thresholds or select a
# larger SDK window; they are retained for compatibility.
# Retained context-window metadata defaults (tokens), inert at runtime. These
# values do not set compaction thresholds or select a larger SDK window; they
# are retained for compatibility.
MODEL_CONTEXT_WINDOWS = {
ModelType.OPUS: 1_000_000,
ModelType.FABLE: 1_000_000,
Expand Down Expand Up @@ -183,34 +182,6 @@ def get_fallback_chain(model: ModelType) -> list[ModelType]:
return chain


def get_context_window(
model: ModelType,
config: ClaudeTaskMasterConfig | None = None,
) -> int:
"""Read retained context-window metadata, using config when supplied.

This compatibility helper has no runtime compaction caller. Its return value
does not set a compaction threshold or select the SDK's context window.

Args:
model: The model type.
config: Optional config object. If None, uses hardcoded defaults.

Returns:
Context-window metadata in tokens, not a runtime capacity guarantee.
"""
if config is not None:
context_map = {
ModelType.OPUS: config.context_windows.opus,
ModelType.FABLE: config.context_windows.fable,
ModelType.SONNET: config.context_windows.sonnet,
ModelType.HAIKU: config.context_windows.haiku,
ModelType.SONNET_1M: config.context_windows.sonnet_1m,
}
return context_map.get(model, MODEL_CONTEXT_WINDOWS[model])
return MODEL_CONTEXT_WINDOWS[model]


# Legacy compact-threshold constant, retained for compatibility and unused at runtime.
DEFAULT_COMPACT_THRESHOLD_PERCENT = 0.85

Expand Down
2 changes: 1 addition & 1 deletion src/claude_task_master/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class ContextWindowsConfig(BaseModel):
"""Retained context-window metadata per model (in tokens).

Values remain loadable from configuration and ``CLAUDETM_CONTEXT_*`` environment
variables, including those emitted by profiles, and readable by ``get_context_window``.
variables, including those emitted by profiles.
They are currently inert for runtime compaction and window selection: changing them
does not set a compaction threshold, prevent context overflow, or grant a larger
SDK context window. Defaults and keys are retained for compatibility.
Expand Down
Loading