Skip to content

Commit c90b94c

Browse files
phase3devclaude
andcommitted
refactor(context-icon): standalone patcher emits the ownership-marked form
Keeps fix-context-icon.py byte-consistent with the launcher, so the launcher's reconcile recognizes a standalone-patched bundle (no spurious anchor warning). --revert stays backup-based in this PR. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 4c1b67f commit c90b94c

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

‎fixes/context-icon/fix-context-icon.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
for virtually an entire normal session. This script flips the threshold so the
2121
icon is visible whenever a context window is known (t>0), at any usage level.
2222
23-
if(c>=50)return null -> if(c>=101)return null (c maxes at 100, so never hides)
23+
if(c>=50)return null -> if(c>=101)return null}/*ccwa-context-icon*/ (marked; c maxes at 100)
2424
2525
The (t===0) guard is left intact. In a resumed window, the webview can still show
2626
a transient 0% before the first fresh response updates context metadata. After
@@ -53,7 +53,7 @@
5353
import tempfile
5454

5555
OLD = ">=50)return null}"
56-
NEW = ">=101)return null}"
56+
NEW = ">=101)return null}/*ccwa-context-icon*/"
5757
BACKUP_SUFFIX = ".bak-context-icon"
5858

5959
DISCOVERY_GLOBS = [

‎tests/test_regressions.py‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,12 @@ def test_fix_context_icon_atomic_replace_preserves_metadata_and_docs_limitation(
254254
# path is verified by inspection only.
255255
self.assertEqual(after.st_uid, before.st_uid)
256256
self.assertEqual(after.st_gid, before.st_gid)
257-
self.assertEqual(
258-
target.read_text(encoding="utf-8"), f"before {NEW_ICON} after"
259-
)
257+
patched_text = target.read_text(encoding="utf-8")
258+
self.assertIn("/*ccwa-context-icon*/", patched_text)
259+
self.assertEqual(patched_text, f"before {mod.NEW} after")
260260
self.assertTrue((pathlib.Path(str(target) + mod.BACKUP_SUFFIX)).exists())
261+
# Idempotent: a second patch is a no-op.
262+
self.assertEqual(mod.patch_file(str(target)), "already-patched")
261263

262264
def test_patch_extension_avoids_bash4_mapfile(self):
263265
source = (REPO / "fixes" / "thinking-summaries" / "patch-extension.sh").read_text(encoding="utf-8")

0 commit comments

Comments
 (0)