

























@@ -70,18 +70,17 @@ describe("directive parsing", () => {
7070});
71717272it("parses default thinking and fast directives as override clears", () => {
73-expect(parseInlineDirectives("/think default")).toMatchObject({
74-hasThinkDirective: true,
75-thinkLevel: undefined,
76-rawThinkLevel: "default",
77-clearThinkLevel: true,
78-});
79-expect(parseInlineDirectives("/fast inherit")).toMatchObject({
80-hasFastDirective: true,
81-fastMode: undefined,
82-rawFastMode: "inherit",
83-clearFastMode: true,
84-});
73+const think = parseInlineDirectives("/think default");
74+expect(think.hasThinkDirective).toBe(true);
75+expect(think.thinkLevel).toBeUndefined();
76+expect(think.rawThinkLevel).toBe("default");
77+expect(think.clearThinkLevel).toBe(true);
78+79+const fast = parseInlineDirectives("/fast inherit");
80+expect(fast.hasFastDirective).toBe(true);
81+expect(fast.fastMode).toBeUndefined();
82+expect(fast.rawFastMode).toBe("inherit");
83+expect(fast.clearFastMode).toBe(true);
8584});
86858786it("matches elevated with leading space", () => {
@@ -201,17 +200,15 @@ describe("directive parsing", () => {
201200});
202201203202it("strips inline /model and /think directives while keeping user text", () => {
204-expect(parseInlineDirectives("please sync /model openai/gpt-4.1-mini now")).toMatchObject({
205-cleaned: "please sync now",
206-hasModelDirective: true,
207-rawModelDirective: "openai/gpt-4.1-mini",
208-});
209-210-expect(parseInlineDirectives("please sync /think:high now")).toMatchObject({
211-cleaned: "please sync now",
212-hasThinkDirective: true,
213-thinkLevel: "high",
214-});
203+const model = parseInlineDirectives("please sync /model openai/gpt-4.1-mini now");
204+expect(model.cleaned).toBe("please sync now");
205+expect(model.hasModelDirective).toBe(true);
206+expect(model.rawModelDirective).toBe("openai/gpt-4.1-mini");
207+208+const think = parseInlineDirectives("please sync /think:high now");
209+expect(think.cleaned).toBe("please sync now");
210+expect(think.hasThinkDirective).toBe(true);
211+expect(think.thinkLevel).toBe("high");
215212});
216213217214it("preserves spacing when stripping think directives before paths", () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。