fix: avoid magic keyword activation on informational queries#1737
fix: avoid magic keyword activation on informational queries#1737Yeachan-Heo merged 1 commit intodevfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2617876b95
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| const INFORMATIONAL_INTENT_PATTERNS: RegExp[] = [ | ||
| /\b(?:what(?:'s|\s+is)|what\s+are|how\s+(?:to|do\s+i)\s+use|explain|explanation|tell\s+me\s+about|describe)\b/i, |
There was a problem hiding this comment.
Stop treating imperative "explain" prompts as informational
The English informational regex now includes bare verbs like explain and describe, so actionable prompts such as use ralph to explain this bug or autopilot explain this code are classified as informational and no mode is activated. This is a functional regression from the previous keyword behavior and breaks common command phrasing where users intentionally invoke a mode to provide an explanation.
Useful? React with 👍 / 👎.
| const start = Math.max(0, position - INFORMATIONAL_CONTEXT_WINDOW); | ||
| const end = Math.min(text.length, position + keywordLength + INFORMATIONAL_CONTEXT_WINDOW); | ||
| const context = text.slice(start, end); | ||
| return INFORMATIONAL_INTENT_PATTERNS.some(pattern => pattern.test(context)); |
There was a problem hiding this comment.
Scope informational checks to the matched clause
The fixed ±80-character context window can suppress a valid command mention if an informational phrase appears nearby in the same prompt; for example, What is ralph? ralph fix this bug fails to trigger because the second ralph still falls inside the what is window. This causes mixed "ask then execute" prompts to be dropped even when they contain an explicit actionable keyword.
Useful? React with 👍 / 👎.
Summary
Testing
Notes