fix(agent): expand regex auto-escalation to cover contacts, files, and sessions - #5749
Open
holden093 wants to merge 3 commits into
Open
fix(agent): expand regex auto-escalation to cover contacts, files, and sessions#5749holden093 wants to merge 3 commits into
holden093 wants to merge 3 commits into
Conversation
The chat-to-agent auto-escalation via _classify_tool_intent only covered
calendar, notes, email, UI, web search, research, and shell tools.
Questions like 'mi dici il numero di X?' or 'what is Mario's phone number?'
stayed in chat mode, leaving the model unable to call resolve_contact.
Add three patterns for contacts/address-book lookup:
- phone/number/address lookup requests (IT/EN/ES)
- explicit contact search ('look up X in contacts', 'cerca X nei contatti')
- bare contacts/address-book search ('search my contacts', 'find contacts')
Add regex patterns for chat-to-agent auto-escalation of:
- files: read/show/open/what's-in-file requests in IT/EN
- sessions: search/find in chat history in IT/EN
File patterns require the target to mention 'file' or look like a
filename (extension, path prefix, or leading capital) to avoid
collisions with UI panel names ('open settings' stays UI).
Combined with the earlier contacts patterns this covers the main
remaining tool domains reachable from a plain chat message.
Contributor
Author
Heads-up: the failing
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The chat→agent auto-escalation (
_classify_tool_intent) only covered calendar, notes, email, UI, web, research, and shell intents. Three domains reachable from plain chat were missing: contacts, files, and sessions.This adds 15 regex patterns (IT/EN) covering:
File patterns guard against UI collisions by requiring a filename-like target (extension, path, or capital letter).
Target branch
dev, notmain.Linked Issue
Fixes #5030
Type of Change
Checklist
devdocker compose uporuvicorn app:app) and verified the change works end-to-end. Type-checks and unit tests are not enough.How to Test
mi dici il numero di [Name]?in chat mode → auto-escalates to agent withcategory=contactsleggi il README→ auto-escalates to agent withcategory=filesopen settings→ staysui(not files)cerca nelle chat il progetto→ auto-escalates to agent withcategory=sessionshow do I read files?/what is a file system?→ stay in chat modeVisual / UI changes
None — backend-only change.