Skip to content

Commit e788104

Browse files
committed
fix: correct regex pattern for context length detection in agent.py
Signed-off-by: Frost Ming <me@frostming.com>
1 parent 804e1c8 commit e788104

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/bub/builtin/agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
CONTINUE_PROMPT = "Continue the task."
4242
HINT_RE = re.compile(r"\$([A-Za-z0-9_.-]+)")
4343
_CONTEXT_LENGTH_PATTERNS = re.compile(
44-
r"context.{0,20}length|maximum.{0,20}context|token.{0,10}limit|prompt.{0,10}too long|tokens? > \d+ maximum",
44+
r"context.{0,20}(?:length|window)|maximum.{0,20}context|token.{0,10}limit|prompt.{0,10}too long|tokens? > \d+ maximum",
4545
re.IGNORECASE,
4646
)
4747
MAX_AUTO_HANDOFF_RETRIES = 1

0 commit comments

Comments
 (0)