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

Cleanup Adapt ContextManager implementation #2886

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

forslund
Copy link
Collaborator

Description

Makes the Mycroft-core Adapt Context Manager depend on the ContextManager in Adapt. This removes a bunch of duplicated code. The current state of the class reflects only the modifications done to integrate the context with the Mycroft intent system. The handling of timeout has been moved into the earlier weird tuple-thing into the context frame metadata.

The key differences from the default Adapt context manager are

  1. Frames are timed out after a set time
  2. get_context() will only return the latest match
  3. methods for removing context (all and specific)

This keeps the current implementation as-is, I need to dig into the history to see why point 2 was added and will be working to integrate some of the functionality in the context manager from adapt. (clear, remove and maybe a canonical way to limit the frame_stack)

I do however think this is a good first step.

How to test

Ensure unit tests still work, check that wikipedia skill "tell more" functionality works

Contributor license agreement signed?

CLA [ Yes ]

@forslund forslund added the Type: Refactoring and other improvements Improvement of code and documentation that does not alter functionality. label Apr 27, 2021
@devops-mycroft devops-mycroft added the CLA: Yes Contributor License Agreement exists (see https://github.com/MycroftAI/contributors) label Apr 27, 2021
@devops-mycroft
Copy link

devops-mycroft commented Apr 27, 2021

Voight Kampff Integration Test Succeeded (Results)

@krisgesling krisgesling added the Status: To be reviewed Concept accepted and PR has sufficient information for full review label Jun 1, 2021
JarbasAl pushed a commit to HelloChatterbox/HolmesIV that referenced this pull request Jul 1, 2021
cherry pick of MycroftAI#2886

Timed Context Manager

Makes the Mycroft-core Adapt Context Manager depend on the
ContextManager in Adapt. This removes a bunch of duplicated code. The
current state of the class reflects _only_ the modifications done to
integrate the context with the Mycroft intent system.

The key differences from the default Adapt context manager are
- Frames are timedout after a set time
- get_context will only return the latest match
- methods for removing context (all and specific)
JarbasAl pushed a commit to HelloChatterbox/HolmesIV that referenced this pull request Jul 1, 2021
cherry pick of MycroftAI#2886

Timed Context Manager

Makes the Mycroft-core Adapt Context Manager depend on the
ContextManager in Adapt. This removes a bunch of duplicated code. The
current state of the class reflects _only_ the modifications done to
integrate the context with the Mycroft intent system.

The key differences from the default Adapt context manager are
- Frames are timedout after a set time
- get_context will only return the latest match
- methods for removing context (all and specific)
JarbasAl pushed a commit to HelloChatterbox/HolmesIV that referenced this pull request Jul 1, 2021
cherry pick of MycroftAI#2886

Timed Context Manager

Makes the Mycroft-core Adapt Context Manager depend on the
ContextManager in Adapt. This removes a bunch of duplicated code. The
current state of the class reflects _only_ the modifications done to
integrate the context with the Mycroft intent system.

The key differences from the default Adapt context manager are
- Frames are timedout after a set time
- get_context will only return the latest match
- methods for removing context (all and specific)
JarbasAl pushed a commit to HelloChatterbox/HolmesIV that referenced this pull request Jul 1, 2021
cherry pick of MycroftAI#2886

Timed Context Manager

Makes the Mycroft-core Adapt Context Manager depend on the
ContextManager in Adapt. This removes a bunch of duplicated code. The
current state of the class reflects _only_ the modifications done to
integrate the context with the Mycroft intent system.

The key differences from the default Adapt context manager are
- Frames are timedout after a set time
- get_context will only return the latest match
- methods for removing context (all and specific)
JarbasAl pushed a commit to HelloChatterbox/HolmesIV that referenced this pull request Jul 5, 2021
cherry pick of MycroftAI#2886

Timed Context Manager

Makes the Mycroft-core Adapt Context Manager depend on the
ContextManager in Adapt. This removes a bunch of duplicated code. The
current state of the class reflects _only_ the modifications done to
integrate the context with the Mycroft intent system.

The key differences from the default Adapt context manager are
- Frames are timedout after a set time
- get_context will only return the latest match
- methods for removing context (all and specific)
JarbasAl pushed a commit to HelloChatterbox/HolmesIV that referenced this pull request Jul 5, 2021
cherry pick of MycroftAI#2886

Timed Context Manager

Makes the Mycroft-core Adapt Context Manager depend on the
ContextManager in Adapt. This removes a bunch of duplicated code. The
current state of the class reflects _only_ the modifications done to
integrate the context with the Mycroft intent system.

The key differences from the default Adapt context manager are
- Frames are timedout after a set time
- get_context will only return the latest match
- methods for removing context (all and specific)
JarbasAl pushed a commit to HelloChatterbox/HolmesIV that referenced this pull request Jul 5, 2021
cherry pick of MycroftAI#2886

Timed Context Manager

Makes the Mycroft-core Adapt Context Manager depend on the
ContextManager in Adapt. This removes a bunch of duplicated code. The
current state of the class reflects _only_ the modifications done to
integrate the context with the Mycroft intent system.

The key differences from the default Adapt context manager are
- Frames are timedout after a set time
- get_context will only return the latest match
- methods for removing context (all and specific)
JarbasAl pushed a commit to HelloChatterbox/HolmesIV that referenced this pull request Jul 6, 2021
cherry pick of MycroftAI#2886

Timed Context Manager

Makes the Mycroft-core Adapt Context Manager depend on the
ContextManager in Adapt. This removes a bunch of duplicated code. The
current state of the class reflects _only_ the modifications done to
integrate the context with the Mycroft intent system.

The key differences from the default Adapt context manager are
- Frames are timedout after a set time
- get_context will only return the latest match
- methods for removing context (all and specific)
JarbasAl pushed a commit to HelloChatterbox/HolmesIV that referenced this pull request Jul 6, 2021
cherry pick of MycroftAI#2886

Timed Context Manager

Makes the Mycroft-core Adapt Context Manager depend on the
ContextManager in Adapt. This removes a bunch of duplicated code. The
current state of the class reflects _only_ the modifications done to
integrate the context with the Mycroft intent system.

The key differences from the default Adapt context manager are
- Frames are timedout after a set time
- get_context will only return the latest match
- methods for removing context (all and specific)
JarbasAl pushed a commit to HelloChatterbox/HolmesIV that referenced this pull request Jul 6, 2021
cherry pick of MycroftAI#2886

Timed Context Manager

Makes the Mycroft-core Adapt Context Manager depend on the
ContextManager in Adapt. This removes a bunch of duplicated code. The
current state of the class reflects _only_ the modifications done to
integrate the context with the Mycroft intent system.

The key differences from the default Adapt context manager are
- Frames are timedout after a set time
- get_context will only return the latest match
- methods for removing context (all and specific)
JarbasAl pushed a commit to HelloChatterbox/HolmesIV that referenced this pull request Jul 7, 2021
cherry pick of MycroftAI#2886

Timed Context Manager

Makes the Mycroft-core Adapt Context Manager depend on the
ContextManager in Adapt. This removes a bunch of duplicated code. The
current state of the class reflects _only_ the modifications done to
integrate the context with the Mycroft intent system.

The key differences from the default Adapt context manager are
- Frames are timedout after a set time
- get_context will only return the latest match
- methods for removing context (all and specific)
JarbasAl pushed a commit to HelloChatterbox/HolmesIV that referenced this pull request Jul 7, 2021
cherry pick of MycroftAI#2886

Timed Context Manager

Makes the Mycroft-core Adapt Context Manager depend on the
ContextManager in Adapt. This removes a bunch of duplicated code. The
current state of the class reflects _only_ the modifications done to
integrate the context with the Mycroft intent system.

The key differences from the default Adapt context manager are
- Frames are timedout after a set time
- get_context will only return the latest match
- methods for removing context (all and specific)
JarbasAl pushed a commit to HelloChatterbox/HolmesIV that referenced this pull request Jul 7, 2021
cherry pick of MycroftAI#2886

Timed Context Manager

Makes the Mycroft-core Adapt Context Manager depend on the
ContextManager in Adapt. This removes a bunch of duplicated code. The
current state of the class reflects _only_ the modifications done to
integrate the context with the Mycroft intent system.

The key differences from the default Adapt context manager are
- Frames are timedout after a set time
- get_context will only return the latest match
- methods for removing context (all and specific)
JarbasAl pushed a commit to HelloChatterbox/HolmesIV that referenced this pull request Jul 7, 2021
cherry pick of MycroftAI#2886

Timed Context Manager

Makes the Mycroft-core Adapt Context Manager depend on the
ContextManager in Adapt. This removes a bunch of duplicated code. The
current state of the class reflects _only_ the modifications done to
integrate the context with the Mycroft intent system.

The key differences from the default Adapt context manager are
- Frames are timedout after a set time
- get_context will only return the latest match
- methods for removing context (all and specific)
JarbasAl pushed a commit to HelloChatterbox/HolmesIV that referenced this pull request Jul 7, 2021
cherry pick of MycroftAI#2886

Timed Context Manager

Makes the Mycroft-core Adapt Context Manager depend on the
ContextManager in Adapt. This removes a bunch of duplicated code. The
current state of the class reflects _only_ the modifications done to
integrate the context with the Mycroft intent system.

The key differences from the default Adapt context manager are
- Frames are timedout after a set time
- get_context will only return the latest match
- methods for removing context (all and specific)
JarbasAl pushed a commit to HelloChatterbox/HolmesIV that referenced this pull request Jul 9, 2021
cherry pick of MycroftAI#2886

Timed Context Manager

Makes the Mycroft-core Adapt Context Manager depend on the
ContextManager in Adapt. This removes a bunch of duplicated code. The
current state of the class reflects _only_ the modifications done to
integrate the context with the Mycroft intent system.

The key differences from the default Adapt context manager are
- Frames are timedout after a set time
- get_context will only return the latest match
- methods for removing context (all and specific)
JarbasAl pushed a commit to HelloChatterbox/HolmesIV that referenced this pull request Jul 9, 2021
cherry pick of MycroftAI#2886

Timed Context Manager

Makes the Mycroft-core Adapt Context Manager depend on the
ContextManager in Adapt. This removes a bunch of duplicated code. The
current state of the class reflects _only_ the modifications done to
integrate the context with the Mycroft intent system.

The key differences from the default Adapt context manager are
- Frames are timedout after a set time
- get_context will only return the latest match
- methods for removing context (all and specific)
JarbasAl pushed a commit to HelloChatterbox/HolmesIV that referenced this pull request Jul 9, 2021
cherry pick of MycroftAI#2886

Timed Context Manager

Makes the Mycroft-core Adapt Context Manager depend on the
ContextManager in Adapt. This removes a bunch of duplicated code. The
current state of the class reflects _only_ the modifications done to
integrate the context with the Mycroft intent system.

The key differences from the default Adapt context manager are
- Frames are timedout after a set time
- get_context will only return the latest match
- methods for removing context (all and specific)
JarbasAl pushed a commit to HelloChatterbox/HolmesIV that referenced this pull request Jul 9, 2021
cherry pick of MycroftAI#2886

Timed Context Manager

Makes the Mycroft-core Adapt Context Manager depend on the
ContextManager in Adapt. This removes a bunch of duplicated code. The
current state of the class reflects _only_ the modifications done to
integrate the context with the Mycroft intent system.

The key differences from the default Adapt context manager are
- Frames are timedout after a set time
- get_context will only return the latest match
- methods for removing context (all and specific)
Makes the Mycroft-core Adapt Context Manager depend on the
ContextManager in Adapt. This removes a bunch of duplicated code. The
current state of the class reflects _only_ the modifications done to
integrate the context with the Mycroft intent system.

The key differences from the default Adapt context manager are
- Frames are timedout after a set time
- get_context will only return the latest match
- methods for removing context (all and specific)
@forslund forslund force-pushed the refactor/adapt-context branch 2 times, most recently from e05e323 to c88f703 Compare August 3, 2021 12:18
@codecov-commenter
Copy link

Codecov Report

Merging #2886 (3c97918) into dev (c21e74d) will decrease coverage by 0.01%.
The diff coverage is 60.00%.

❗ Current head 3c97918 differs from pull request most recent head c88f703. Consider uploading reports for the commit c88f703 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #2886      +/-   ##
==========================================
- Coverage   52.85%   52.84%   -0.02%     
==========================================
  Files         123      123              
  Lines       11043    11014      -29     
==========================================
- Hits         5837     5820      -17     
+ Misses       5206     5194      -12     
Impacted Files Coverage Δ
mycroft/skills/intent_service.py 68.03% <0.00%> (ø)
mycroft/skills/intent_services/adapt_service.py 86.36% <64.28%> (+5.78%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c21e74d...c88f703. Read the comment docs.

@krisgesling krisgesling added this to Sprint 23: Skill interactions in Upcoming Sprints Aug 19, 2021
@forslund forslund force-pushed the refactor/adapt-context branch 2 times, most recently from bc97282 to c88f703 Compare February 13, 2022 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA: Yes Contributor License Agreement exists (see https://github.com/MycroftAI/contributors) Status: To be reviewed Concept accepted and PR has sufficient information for full review Type: Refactoring and other improvements Improvement of code and documentation that does not alter functionality.
Projects
No open projects
Upcoming Sprints
Sprint 3x: Review proposed changes
Development

Successfully merging this pull request may close these issues.

None yet

5 participants