Skip to content

Commit e05ab7b

Browse files
authored
fix: Python 3.14 regex crash in qyl-continuation (1.0.0 → 1.0.1) (#160)
Python 3.14 rejects inline (?i) flags mid-pattern (re.PatternError). Moved QUESTION_RX, COMPLETION_RX, NEXT_STEP_RX to use re.IGNORECASE flag parameter.
1 parent 236cf8f commit e05ab7b

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

.claude-plugin/marketplace.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
{
8484
"name": "qyl-continuation",
8585
"description": "Smart auto-continuation for Claude Code. Heuristic pre-filter eliminates ~80% of unnecessary Haiku calls; improved judge prompt handles the rest. Based on double-shot-latte (MIT).",
86-
"version": "1.0.0",
86+
"version": "1.0.1",
8787
"source": "./plugins/qyl-continuation"
8888
}
8989
]

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ and the project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
66

77
## [Unreleased]
88

9+
### Fixed
10+
11+
- **`qyl-continuation` (1.0.0 → 1.0.1)**: Fixed Python 3.14 regex crash — inline `(?i)` flags mid-pattern are now errors in Python 3.14. Moved all three regex patterns (`QUESTION_RX`, `COMPLETION_RX`, `NEXT_STEP_RX`) to use `re.IGNORECASE` flag parameter instead
12+
913
### Added
1014

1115
- **`qyl-continuation` plugin (1.0.0)**: Smart auto-continuation for Claude Code. Two-phase stop hook: heuristic pre-filter eliminates ~80% of unnecessary Haiku calls (questions, completion signals, addressed tool results, substantial text), Haiku judge handles the ambiguous ~20%. Throttled to max 3 continuations per 5-minute window. Based on double-shot-latte (MIT)

plugins/qyl-continuation/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "qyl-continuation",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "Smart auto-continuation for Claude Code. Heuristic pre-filter eliminates ~80% of unnecessary Haiku calls; improved judge prompt handles the rest. Based on double-shot-latte (MIT).",
55
"author": {
66
"name": "AncpLua",

plugins/qyl-continuation/hooks/stop-judge.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,9 @@ def has_block_type(msg: dict, block_type: str) -> bool:
133133
# --- Phase 1: Heuristics ---
134134

135135
NEXT_STEP_RX = re.compile(
136-
r"(?i)(?:next|now) (?:I(?:'ll| will| need to)|let me)|"
137-
r"moving on to|(?:still|also) need to|remaining (?:items|tasks|steps)"
136+
r"(?:next|now) (?:I(?:'ll| will| need to)|let me)|"
137+
r"moving on to|(?:still|also) need to|remaining (?:items|tasks|steps)",
138+
re.IGNORECASE,
138139
)
139140

140141
last_assistant = ""
@@ -145,20 +146,22 @@ def has_block_type(msg: dict, block_type: str) -> bool:
145146

146147
# H1: Assistant asked user a question
147148
QUESTION_RX = re.compile(
148-
r"\?\s*$|(?i)(?:would you like|do you want|shall I|should I|"
149+
r"\?\s*$|(?:would you like|do you want|shall I|should I|"
149150
r"what do you think|does this look|let me know|how would you like|"
150-
r"which (?:one|option|approach))"
151+
r"which (?:one|option|approach))",
152+
re.IGNORECASE,
151153
)
152154
if last_assistant and QUESTION_RX.search(last_assistant):
153155
clear_throttle()
154156
approve("Heuristic: question to user")
155157

156158
# H2: Completion signals (only if no stated next steps)
157159
COMPLETION_RX = re.compile(
158-
r"(?i)\b(?:done|complete|finished|ready|all set)\b|"
159-
r"(?i)successfully (?:created|updated|fixed|applied|installed|configured)|"
160-
r"(?i)that(?:'s| should be) (?:it|all|everything)|"
161-
r"(?i)here(?:'s| is) (?:the|your|a) (?:summary|result|output)"
160+
r"\b(?:done|complete|finished|ready|all set)\b|"
161+
r"successfully (?:created|updated|fixed|applied|installed|configured)|"
162+
r"that(?:'s| should be) (?:it|all|everything)|"
163+
r"here(?:'s| is) (?:the|your|a) (?:summary|result|output)",
164+
re.IGNORECASE,
162165
)
163166
if last_assistant and COMPLETION_RX.search(last_assistant) and not NEXT_STEP_RX.search(last_assistant):
164167
clear_throttle()

0 commit comments

Comments
 (0)