Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

address review (copilot): require a time unit in the 'ran for …' workout-intent branch so 'ran for a report' no longer matches

Adam Eivy6b20192ef6a1
diff --git a/server/services/voice/tools.js b/server/services/voice/tools.js
index 62f852ecda..895e44c7f2 100644
--- a/server/services/voice/tools.js
+++ b/server/services/voice/tools.js
@@ -220,10 +220,12 @@ const GROUP_INTENT = {
// for/on a … run" phrasing and the "ran …" branch below, which requires a
// fitness OBJECT — a distance/race ("ran a 5k", "ran 3 miles", "ran a
// marathon"), a route ("ran my usual route", "ran my loop"), or a duration
- // ("ran for 30 minutes") — so "I ran a report", "ran an errand", and "ran my
- // mouth" no longer match. The other activity nouns (jog/yoga/cardio/gym/…)
- // rarely collide in voice commands.
- meatspace: /\b(drink|drank|beer|wine|whiskey|shot|cocktail|cigarette|vape|pouch|nicotine|weigh|pound|kilo|kg|smoke|smoking|workout|exercise|exercised|jog|yoga|lift(?:ed|ing)?|cardio|gym|cycling|cycled|swim|swam|how am I|summary today|log (?:a|my) (?:drink|weight|nicotine|workout|run|exercise))\b|\bwent (?:for|on) (?:a |an )?(?:\w+ ){0,2}(?:run|jog|swim|ride|walk|hike|workout)\b|\bran (?:a |an |my )?(?:\w+ ){0,2}(?:\d+\s?k\b|\d+\s?km\b|miles?\b|marathons?\b|half[- ]?marathons?\b|5k\b|10k\b|loops?\b|routes?\b|trails?\b|laps?\b)|\bran for (?:about |around |roughly )?(?:\d|an? |half|the )/i,
+ // WITH a time unit ("ran for 30 minutes", "ran for an hour"). The duration
+ // branch insists on a minute/hour/second unit so "ran for a report", "ran for
+ // office", and "ran for president" no longer match, just as "I ran a report",
+ // "ran an errand", and "ran my mouth" don't. Other activity nouns
+ // (jog/yoga/cardio/gym/…) rarely collide in voice commands.
+ meatspace: /\b(drink|drank|beer|wine|whiskey|shot|cocktail|cigarette|vape|pouch|nicotine|weigh|pound|kilo|kg|smoke|smoking|workout|exercise|exercised|jog|yoga|lift(?:ed|ing)?|cardio|gym|cycling|cycled|swim|swam|how am I|summary today|log (?:a|my) (?:drink|weight|nicotine|workout|run|exercise))\b|\bwent (?:for|on) (?:a |an )?(?:\w+ ){0,2}(?:run|jog|swim|ride|walk|hike|workout)\b|\bran (?:a |an |my )?(?:\w+ ){0,2}(?:\d+\s?k\b|\d+\s?km\b|miles?\b|marathons?\b|half[- ]?marathons?\b|5k\b|10k\b|loops?\b|routes?\b|trails?\b|laps?\b)|\bran for (?:\w+ ){0,3}(?:hours?|hrs?|mins?|minutes?|seconds?|secs?)\b/i,
// Calendar reads — "what's on my calendar", "what do I have today",
// "next meeting", "what's next", "upcoming", "any appointments". Tight-ish
// so plain "open calendar" still routes to ui_navigate, not calendar_today.
diff --git a/server/services/voice/tools.test.js b/server/services/voice/tools.test.js
index ec7313dfc2..437a6b168d 100644
--- a/server/services/voice/tools.test.js
+++ b/server/services/voice/tools.test.js
@@ -1116,6 +1116,7 @@ describe('new tool intent routing', () => {
expect(classifyIntent('ran a marathon yesterday').has('meatspace')).toBe(true);
expect(classifyIntent('ran my usual route').has('meatspace')).toBe(true);
expect(classifyIntent('ran for 30 minutes').has('meatspace')).toBe(true);
+ expect(classifyIntent('ran for an hour').has('meatspace')).toBe(true);
expect(classifyIntent('did some cardio at the gym').has('meatspace')).toBe(true);
});
it('does NOT route command phrasings of run/ran to the meatspace group', () => {
@@ -1129,6 +1130,10 @@ describe('new tool intent routing', () => {
expect(classifyIntent('ran an errand').has('meatspace')).toBe(false);
expect(classifyIntent('ran my mouth').has('meatspace')).toBe(false);
expect(classifyIntent('ran for office').has('meatspace')).toBe(false);
+ // The duration branch requires a real time unit — "for a/the X" without a
+ // minute/hour/second unit must NOT route to the workout tool.
+ expect(classifyIntent('ran for a report').has('meatspace')).toBe(false);
+ expect(classifyIntent('ran for president').has('meatspace')).toBe(false);
});
it('routes visual-description utterances to the vision group', () => {
expect(classifyIntent("what's on this chart?").has('vision')).toBe(true);