fix: canonicalize app name variants in cross-app detection#7409
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 778c065aa0
ℹ️ 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".
| ['vellum assistant', 'vellum'], | ||
| ['visual studio code', 'vscode'], | ||
| ['iterm2', 'iterm'], | ||
| ['gmail', 'mail'], |
There was a problem hiding this comment.
Keep Gmail distinct from Mail in canonicalization
Mapping gmail to mail in APP_CANONICAL_MAP causes taskExplicitlyRequestsCrossApp to collapse two genuinely different apps into one canonical key. For tasks like “copy this from Gmail into Mail,” the detector now records only one app mention, so the cross-app escape path is not activated and later computer_use_open_app / computer_use_run_applescript calls can be blocked even though the user explicitly requested a cross-app workflow.
Useful? React with 👍 / 👎.
| ['vellum assistant', 'vellum'], | ||
| ['visual studio code', 'vscode'], | ||
| ['iterm2', 'iterm'], | ||
| ['gmail', 'mail'], |
There was a problem hiding this comment.
🔴 Incorrect canonical mapping 'gmail' → 'mail' collapses two distinct apps into one
The APP_CANONICAL_MAP maps 'gmail' to 'mail', but Gmail (Google's web-based email service) and Mail (Apple's native macOS email client) are genuinely different applications. This causes taskExplicitlyRequestsCrossApp() to fail to detect cross-app intent when a user mentions both.
Root Cause and Impact
When iterating over KNOWN_APP_NAMES in taskExplicitlyRequestsCrossApp(), both 'gmail' and 'mail' will canonicalize to 'mail' — 'gmail' via the canonical map at line 349, and 'mail' via normalizeAppLabel('mail') → 'mail' (fallback at line 402). This means mentionedApps will only ever contain one entry for both, so the mentionedApps.size >= 2 check at line 406 won't trigger.
For example, a task like "forward the email from Mail to Gmail" mentions two distinct applications but the function returns false, causing the cross-app guard at computer-use-session.ts:650-666 to block the workflow instead of allowing it.
Every other entry in the canonical map correctly maps a long-form name to its short-form equivalent for the same application (e.g. 'google chrome' → 'chrome', 'microsoft teams' → 'teams'). The 'gmail' → 'mail' entry is the only one that conflates two genuinely different apps.
| ['gmail', 'mail'], | |
| ['gmail', 'gmail'], |
Was this helpful? React with 👍 or 👎 to provide feedback.
|
Addressed in #7460 |
Fixes false cross-app triggers from PR #7292 where 'Google Chrome' matched both 'chrome' and 'google chrome' as distinct apps.