Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible Regression using two or more regex #102

Closed
stratus-ss opened this issue Apr 24, 2020 · 3 comments
Closed

Possible Regression using two or more regex #102

stratus-ss opened this issue Apr 24, 2020 · 3 comments

Comments

@stratus-ss
Copy link

stratus-ss commented Apr 24, 2020

Be clear about the software, hardware and version you are running

For example:

  • With version 20.2.2 of the Mycroft software (latest version as of Apr 24, 2020)
  • With the standard Wake Word
  • With Jarvis keyword

Try to provide steps that we can use to replicate the Issue

Given the following intent methods:

@intent_handler(IntentBuilder('SearchChild').require('SearchKeyword').require("Title").require("ParentTitle"))
def handle_search_confluence_child_page(self, message):
    print("\/\/\/\/\/ stuf happened!")

@intent_handler(IntentBuilder('SearchTitle').require('SearchKeyword').require("Title"))
def handle_search_confluence_title(self, message):
    print(message.data)

I have tried the following regex in find.title.rx

search confluence for (?P<Title>.*) 

With these regexes (all tested one at a time) in find.child.rx

.* under (?P<ParentTitle>.*) page

and

under (?P<ParentTitle>.*) page

and

\b^.* under (?P<ParentTitle>.*) page

Using the trigger:

search confluence for chicken under breakfast page

The output of message.data happens every time to be this:

~~~~st', 'key': 'chicken under breakfast', 'from_context': False}], 'utterance': 'search confluence for chicken under breakfast page', 'SearchKeyword': 'search confluence', 'Title': 'chicken under breakfast page'}

I believe this to be a regression because using a similar method in a different skill which I have not changed no longer works.

This intent no longer gets called

@intent_handler(IntentBuilder('').require('CreateItemKeyword').require("Food")
                    .require("ShoppingList").optionally("Category"))`

With the regex file1

add (?P<Food>.*) (to my) (?P<ShoppingList>.*) list
add (?P<Food>.*) (to the) (?P<ShoppingList>.*) list

and regex file 2

under (?P<Category>.*)

Output of message.data

~~~~tems', 'key': 'steves items', 'from_context': False}], 'utterance': 'add something to the steves items list under ai', 'CreateItemKeyword': 'add', 'Food': 'something', 'ShoppingList': 'steves items'}

This was known working on Apr 11 when I committed this to my master branch

@clusterfudge
Copy link
Collaborator

Hey @stratus-ss , thanks for bringing this up. Regexes are particularly dicey in Adapt; they have the ability to collide with each other in weird ways, and tend not to behave the way you expect when there are multiple in play.

I suspect that this is not a regression, as there have been no material changes (docstrings aside) to adapt since this commit in May 2019. If you updated your version of adapt since your most recent change, that may point to a latent regression. If you only updated mycroft, this issue might be more appropriate for that forum.

I would recommend using git-bisect to try to track down the exact change that broke your flow.

@stratus-ss
Copy link
Author

I appreciate the reply but git bisect isnt going to help. Nothing related to either of those functions or the regex changed.

I may have to investigate building the other intent.

If you don't think that this is a valid report please feel free to close it and clear up your issues :)

@clusterfudge
Copy link
Collaborator

clusterfudge commented Apr 3, 2021

Hey @stratus-ss , sorry for the long silence here. I suspect that this is a collision of regexes interacting with each other, either via code changes in mycroft, addition/removal of skills or vocabulary, introduction of padatious, or other downstream changes. Adapt regexes are known to be flaky, especially when multiple skills come into play.

If you have not already resolved this issue, I would recommend looking for assistance debugging mycroft-core with the relevant channels. I'm going to close this issue now, but please feel free to re-open if you have a stable reproduction (outside of mycroft-core). Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants