Skip to content
This repository was archived by the owner on Nov 10, 2026. It is now read-only.

refactor: remove dead get_context_window and its core facade exports - #204

Merged
developerz-ai[bot] merged 2 commits into
mainfrom
dz/delete-the-dead-get-context-window-and-its-core--930a71a5
Nov 10, 2026
Merged

developerz-ai[bot] merged 2 commits into
mainfrom
dz/delete-the-dead-get-context-window-and-its-core--930a71a5

Conversation

@developerz-ai

@developerz-ai developerz-ai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

What

get_context_window (core/agent_models.py) had no caller anywhere in the
repo; it was only re-exported from the core facade. Delete the helper,
drop the core.init import and all entry, and reword the two
comments that pointed at it (the MODEL_CONTEXT_WINDOWS comment and the
ContextWindowsConfig docstring). MODEL_CONTEXT_WINDOWS and
MODEL_CONTEXT_WINDOWS_STANDARD are retained: they are still exported and
tested. CHANGELOG Unreleased records the removal of the public name.

Acceptance

  • Repo-wide grep for get_context_window returns zero hits in src/, tests/, docs/ and CHANGELOG.md
  • python -c "import claude_task_master.core" succeeds and every name in core.all resolves via hasattr
  • CHANGELOG.md [Unreleased] has a ### Removed section naming get_context_window
  • uv run pytest tests/core/test_agent_models.py passes unchanged (constants/facade tests green)
  • bin/check is green (full gate run by the harness after the team finishes)

Changes

  • src/claude_task_master/core/agent_models.py (edit) — Delete the dead get_context_window function (lines 186-211). Reword the comment at lines 106-109 that introduces MODEL_CONTEXT_WINDOWS: drop the 'for get_context_window' framing and the sentence 'The helper can read config.json ...', keep the inert-at-runtime warning. KEEP MODEL_CONTEXT_WINDOWS, MODEL_CONTEXT_WINDOWS_STANDARD and DEFAULT_COMPACT_THRESHOLD_PERCENT — they are still facade-exported and tested. Do not touch other functions.
  • src/claude_task_master/core/__init__.py (edit) — Remove get_context_window from the agent_models import block (line 27) and from all (line 222). Nothing else in the import list changes; grep proved no in-repo consumer of the facade export.
  • src/claude_task_master/core/config.py (edit) — Docstring-only edit in ContextWindowsConfig (lines 120-127): drop the clause 'and readable by get_context_window' so the repo has no reference to the deleted name. The config model, its fields and CLAUDETM_CONTEXT_* env loading stay exactly as they are.
  • CHANGELOG.md (edit) — Under ## [Unreleased], add a '### Removed' section ABOVE the existing '### Fixed' (Keep a Changelog order) with one entry: removed the dead public helper get_context_window from claude_task_master.core / core.agent_models; it had no caller and its return value set no compaction threshold or SDK window; constants MODEL_CONTEXT_WINDOWS etc. are retained. Match the file's bold-lead entry style; no links added.
  • README.md (edit) — [docs] minor — README.md:346 says the inert context_windows values can still be "read by the context-window helper"; that helper is get_context_window, which this diff deletes (was core/agent_models.py:189-211), so the sentence was true before the diff and is false after it — the same clause was corrected in config.py:122-123 but README was missed. A reader who believes it goes hunting for a helper that no longer exists or assumes the values still have a runtime consumer. Fix: change "Values can still be loaded from configuration, emitted by profiles, and read by the context-window h [trimmed]

Verification

./bin/check passed (exit 0) in 9m 55s.

What the editors ran to see the change working, and what they saw:

  • uv run python -c "import claude_task_master.core as c; assert all(hasattr(c, n) for n in c.__all__)" && uv run pytest tests/core/test_agent_models.py -q (core): Import and all hasattr assert passed silently, then '64 passed in 1.64s' from tests/core/test_agent_models.py.
  • grep 'get_context_window' over src/claude_task_master/core/ (core): Zero hits — no remaining references in agent_models.py, init.py or config.py.
  • python verify_docs_links.py (docs): exit 0 — 49 markdown files scanned, CHANGELOG.md extracted with 116 anchors, "All 299 links verified successfully!"
  • code_changes on CHANGELOG.md (docs): Uncommitted diff adds exactly the '### Removed' section (naming get_context_window, above '### Fixed') under '## [Unreleased]' — the section my brief required.
  • repo-wide grep for get_context_window (docs): Exactly one hit: CHANGELOG.md line 12 (the changelog entry itself, as the naming criterion requires); zero hits in src/, tests/, docs/ — the first pass's code deletion is confirmed in the tree.
  • repo-wide grep for the retained names (docs): MODEL_CONTEXT_WINDOWS and MODEL_CONTEXT_WINDOWS_STANDARD at agent_models.py:109/118 plus facade exports in core/init.py, DEFAULT_COMPACT_THRESHOLD_PERCENT at agent_models.py:186, ContextWindowsConfig at config.py:119 — the invariant my entry asserts holds.
  • python verify_docs_links.py (my scoped check) (docs): Exit 0: 'All 299 links verified successfully!' across 49 markdown files, CHANGELOG.md included (116 anchors, no broken links).
  • python verify_docs_links.py (docs): exit 0 — 'All 299 links verified successfully!' over 49 markdown files, README.md included
  • repo-wide grep for get_context_window in src/ and for 'context-window helper' in README.md (docs): zero hits for the helper name in src/ (deletion already in tree); README.md:346 was the only line naming the 'context-window helper' and now no longer does

Notes

Handoffs this run could not complete:

  • CHANGELOG.md — Deleted the dead get_context_window helper (agent_models.py), its facade export (core/init.py import + all), and its last docstring mention (config.py ContextWindowsConfig).; The acceptance requires CHANGELOG.md [Unreleased] to gain a '### Removed' section naming get_context_window (Keep a Changelog 1.1.0: '### Removed' sits above '### Fixed' inside '## [Unreleased]'). CHANGELOG.md is not in my write set, so I did not touch it. (the editor sent to make it neither wrote it nor said why not)

Part 2/4 of goal rtk_9f27cc6e57494e1aa71249859e371c59


🤖 Opened by developerz.ai for task tsk_930a71a5c4d33b3f04b6f3e58161aa0c on developerz-ai/claude-task-master.

Raised automatically by the raw_task_triage lane.

🤖 developerz.ai, an automated agent, not a human — this PR is one slice of a stacked plan.
Dispatched automatically by the raw_task_triage lane
Model glm-5.3-flash on api.z.ai via native, funded by account_key
Ran on box hv-dedicated-dev-din
Cost ~$0.10 for 788.6k in / 32.7k out (estimate: list price x reported tokens, cached input at its cached rate)
Run timeline run_c1593d007aea4410a1150a39db663a96
Part 2/4 of plan rtk_9f27cc6e57494e1aa71249859e371c59

get_context_window (core/agent_models.py) had no caller anywhere in the
repo; it was only re-exported from the core facade. Delete the helper,
drop the core.__init__ import and __all__ entry, and reword the two
comments that pointed at it (the MODEL_CONTEXT_WINDOWS comment and the
ContextWindowsConfig docstring). MODEL_CONTEXT_WINDOWS and
MODEL_CONTEXT_WINDOWS_STANDARD are retained: they are still exported and
tested. CHANGELOG Unreleased records the removal of the public name.

Dz-Task-Id: tsk_930a71a5c4d33b3f04b6f3e58161aa0c
@developerz-ai developerz-ai Bot added dz/fleet-pr Opened by developerz.ai, an automated agent, from a fleet run. dz/model:glm-5.3-flash developerz.ai: model that wrote this bot PR. dz/provider:api.z.ai developerz.ai: provider that served this bot PR. labels Nov 10, 2026
@developerz-ai

developerz-ai Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

Delete the dead get_context_window and its core facade exports

Work landed on #204 — watching it toward merge.

24m · 46 tool calls · 19 messages

Sessions: coding run


🤖 developerz.ai, an automated agent, not a human — hv-dedicated-dev-din (developerz-ai[bot]) · model glm-5.3-flash on api.z.ai

@developerz-ai

developerz-ai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Reviewed — nothing blocking

0 actionable comment(s) · grounded on your code

⚠️ 1 config note(s): test files were not shown to the reviewer — this diff touched no path recognised as a test, so no assertion was available to read the change against

⏱ 47s wall clock · gpt-6.1-sol via custom · 2 model call(s) · 212 output token(s)

🤖 developerz.ai — automated review, running on your model and your box.

@developerz-ai developerz-ai Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review summary — 5 file(s), 0 finding(s).

Completed review removes the unused context-window helper and its facade exports, updates documentation, and records the removal. No blocking defects found in the supplied diff.

  • test files were not shown to the reviewer — this diff touched no path recognised as a test, so no assertion was available to read the change against

🤖 developerz.ai review — automated, running on your model and your box. What is this? · Reviewed by custom/gpt-6.1-sol on box hv-dedicated-dev-din — 64.9k in / 197 out over 2 calls, on your flat-rate plan: no per-token charge (~$0.13 at OpenRouter list rates).

@developerz-ai developerz-ai Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review summary — 5 file(s), 0 finding(s).

Completed review removes get_context_window and its facade exports, updates related documentation, and retains the metadata constants and configuration. No concrete defects found in the supplied diff.

  • test files were not shown to the reviewer — this diff touched no path recognised as a test, so no assertion was available to read the change against

🤖 developerz.ai review — automated, running on your model and your box. What is this? · Reviewed by custom/gpt-6.1-sol on box hv-dedicated-dev-din — 64.9k in / 212 out over 2 calls, on your flat-rate plan: no per-token charge (~$0.13 at OpenRouter list rates).

@developerz-ai
developerz-ai Bot merged commit 33df3bf into main Nov 10, 2026
4 checks passed
@developerz-ai
developerz-ai Bot deleted the dz/delete-the-dead-get-context-window-and-its-core--930a71a5 branch November 10, 2026 03:27
developerz-ai Bot added a commit that referenced this pull request Nov 10, 2026
## What

The GraphQL review-thread formatter _format_pr_comments had no call site
anywhere in the codebase or tests. Remove its definition
(client_pr_helpers.py:408-434), its __all__ entry
(client_pr_helpers.py:477), and the backward-compat re-export import and
__all__ entry in client_pr.py (lines 17 and 317) as one atomic change —
ruff selects pyflakes (F822), so the definition and the exports must go
together. The five live siblings (_get_comment_resolved_map,
_build_pr_status_query, _parse_pr_status_response,
_parse_check_contexts,
_format_pr_comments_from_rest) are unchanged. CHANGELOG Unreleased gains
a Removed note.

## Acceptance

- Repo-wide grep for _format_pr_comments matches only historical
CHANGELOG prose and the cli.py comment naming
_format_pr_comments_from_rest — no definition, __all__ entry, or import
of _format_pr_comments remains in src/
- _format_pr_comments_from_rest, _get_comment_resolved_map,
_build_pr_status_query, _parse_pr_status_response and
_parse_check_contexts remain defined in client_pr_helpers.py and listed
in both module __all__ lists (client_pr_helpers.py:472-478 → 5 entries,
client_pr.py:309-319 → 8 entries)
- uv run ruff check src/claude_task_master/github/client_pr.py
src/claude_task_master/github/client_pr_helpers.py is clean (F/F822
selected via pyproject.toml:115)
- CHANGELOG.md Unreleased has a Removed note for _format_pr_comments and
all historical entries are byte-identical
- bin/check is green (harness full gate)

## Changes

- `src/claude_task_master/github/client_pr_helpers.py` (edit) — Delete
the dead GraphQL formatter _format_pr_comments (lines 408-434, keeping
exactly two blank lines before _format_pr_comments_from_rest at 437) and
drop "_format_pr_comments", from __all__ (line 477). The five sibling
helpers (lines 13, 97, 226, 370, 437) are untouched.
- `src/claude_task_master/github/client_pr.py` (edit) — Remove
_format_pr_comments, from the client_pr_helpers import block (line 17)
and "_format_pr_comments", from __all__ (line 317). Keep the block's `#
noqa: F401 — re-exported for backward compat` comment and all five
sibling names; the live calls at lines 118, 149, 303, 306 are untouched.
- `CHANGELOG.md` (edit) — Add one bullet under the existing Unreleased
'### Removed' section (after the get_context_window entry, line 12): the
dead _format_pr_comments GraphQL formatter (github/client_pr_helpers.py)
was removed — no call site anywhere; removed together with both __all__
entries and the client_pr backward-compat re-export. Historical release
notes below are NOT edited.

## Verification

`./bin/check` passed (exit 0) in 3m 19s.

What the editors ran to see the change working, and what they saw:

- `uv run ruff check src/claude_task_master/github/client_pr.py
src/claude_task_master/github/client_pr_helpers.py` (github): EXIT=0 —
All checks passed! (F selected via pyproject.toml:115, so F822 would
fail on any leftover __all__ entry/import of the deleted name; proves
the three removals landed atomically)
- `grep _format_pr_comments over
src/claude_task_master/github/client_pr*.py` (github): only
_format_pr_comments_from_rest remains: client_pr.py:17 (import), :305
(live call), :316 (__all__); client_pr_helpers.py:408 (def), :448
(__all__) — no bare _format_pr_comments token left

Part 3/4 of goal `rtk_9f27cc6e57494e1aa71249859e371c59`
- #200
- #204
- #195

<!-- dz-task:tsk_a2b402fa733df2802883bdbd46e33a72 -->

---

🤖 Opened by **developerz.ai** for task
`tsk_a2b402fa733df2802883bdbd46e33a72` on
developerz-ai/claude-task-master.

Raised automatically by the `raw_task_triage` lane.

<!-- dz-stack:start -->
> 🤖 developerz.ai, an automated agent, not a human — this PR is one
slice of a stacked plan.
> Dispatched automatically by the `raw_task_triage` lane
> Model `glm-5.3-flash` on `api.z.ai` via `native`, funded by
`account_key`
> Ran on box `hv-dedicated-reviewer-1`
> Cost ~$0.04 for 266.8k in / 21.5k out (estimate: list price x reported
tokens, cached input at its cached rate)
> Run timeline
[`run_15db90b89057460cb959e5caa13dfb2c`](https://app.developerz.ai/fleet/runs/run_15db90b89057460cb959e5caa13dfb2c)
> Part 3/4 of plan
[`rtk_9f27cc6e57494e1aa71249859e371c59`](https://app.developerz.ai/fleet/plans/rtk_9f27cc6e57494e1aa71249859e371c59)
<!-- dz-stack:end -->

Co-authored-by: developerz-ai[bot] <286432749+developerz-ai[bot]@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

dz/fleet-pr Opened by developerz.ai, an automated agent, from a fleet run. dz/model:glm-5.3-flash developerz.ai: model that wrote this bot PR. dz/provider:api.z.ai developerz.ai: provider that served this bot PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants