You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(glue): drop "chat" from the Intent classifier
Removes the dead "chat" intent value, the isGreeting regex shortcut,
and the GREETING_PATTERNS table. classifyIntent now decides only
between agent | plan | clarify, and the rewritten system prompt
tells the classifier that greetings, gratitude, and meta-questions
all belong to the agent.
parseIntent returns null on the legacy "chat" string so an old
classifier model that still emits "chat" from training data
defaults to "agent" via the existing fallback path — no silent
stranding of real requests.
Copy file name to clipboardExpand all lines: src/glue/intent.ts
+26-45Lines changed: 26 additions & 45 deletions
Original file line number
Diff line number
Diff line change
@@ -1,57 +1,42 @@
1
1
importtype{GlueClient}from"./client.js";
2
2
3
-
exporttypeIntent="agent"|"plan"|"chat"|"clarify";
4
-
5
-
constINTENT_SYSTEM_PROMPT=`You classify the user's message into ONE of these intents:
3
+
/**
4
+
* Intent classifications the router actually acts on. "chat" used to
5
+
* be in this set but was removed when we ripped out the
6
+
* cheap-model chat intercept — small talk now goes to the main agent.
7
+
* "clarify" remains so we can wire an ask-back path later, but for
8
+
* now it routes the same as "agent".
9
+
*/
10
+
exporttypeIntent="agent"|"plan"|"clarify";
6
11
7
-
- agent: a coding/automation/build/fix request. Run-the-tools work. (Default for anything actionable.)
8
-
- plan: a complex multi-step ask that benefits from upfront planning before code is written ("add auth to my Next app", "rewrite the worker as a state machine").
9
-
- chat: small talk, gratitude, greetings, meta-questions about the agent itself.
10
-
- clarify: ambiguous request where the agent couldn't act productively without more info.
12
+
constINTENT_SYSTEM_PROMPT=`Classify the user's message into ONE of these intents. Output exactly one word, no prose.
11
13
12
-
Output exactly one word: agent | plan | chat | clarify. No prose.`;
14
+
- agent: a coding, automation, build, fix, or run-the-tools request. Default for anything actionable, including small talk, greetings, gratitude, and meta-questions about the agent itself — the main agent handles those directly now.
15
+
- plan: a complex multi-step ask that benefits from upfront planning before any code is written (e.g. "add auth to my Next app", "rewrite the worker as a state machine"). Reserve this for genuinely multi-file architectural work.
16
+
- clarify: ambiguous or contradictory request where acting without more information would be a mistake.
13
17
14
-
constGREETING_PATTERNS=[
15
-
/^h(i|ello|ey)\b/i,
16
-
/^howdy\b/i,
17
-
/^thanks?\b/i,
18
-
/^thankyou\b/i,
19
-
/^ty\b/i,
20
-
/^ok\b/i,
21
-
/^okay\b/i,
22
-
/^nice\b/i,
23
-
/^cool\b/i,
24
-
/^great\b/i,
25
-
/^good(morning|afternoon|evening|night)\b/i,
26
-
];
18
+
Reply with exactly one of: agent | plan | clarify.`;
27
19
28
20
exportinterfaceClassifyOptions{
29
21
hasHistory: boolean;
30
22
signal?: AbortSignal;
31
23
}
32
24
33
25
/**
34
-
* Decide whether the user's message should run the main agent (tool
35
-
* work), enter plan mode (Q&A → reviewable plan), be answered as chat
36
-
* (no agent run), or trigger a clarifying question.
37
-
*
38
-
* Fast-tracks:
39
-
* - First message in a session: default to "agent" for anything
0 commit comments