fix: set temperature to 0.0 for deterministic routing #29
Annotations
24 errors
|
typecheck:
src/routes/demo/index.ts#L788
Type '({ id: string; topic: string; context: string | undefined; facts: Record<string, { value: string; messageId: string; confidence: number; status: "active" | "superseded" | "removed"; supersededBy?: string | undefined; }[]>; newMessagesProcessed: number; } | { ...; })[]' is not assignable to type '{ context?: string | undefined; id: string; topic: string; facts: string[]; newMessagesProcessed: number; }[]'.
|
|
typecheck:
src/routes/demo/index.ts#L759
Type '{ topic: string; context: string; facts: any[]; lastFactExtractionIndex: number; id: string; parentId: string | null; messageCount: number; createdAt: Date; }' is not assignable to type 'EphemeralBranch'.
|
|
typecheck:
src/routes/demo/index.ts#L751
This expression is not callable.
|
|
typecheck:
src/routes/demo/index.ts#L751
'branch.facts.includes' is possibly 'undefined'.
|
|
typecheck:
src/routes/demo/index.ts#L751
Cannot invoke an object which is possibly 'undefined'.
|
|
typecheck:
src/routes/demo/index.ts#L748
Type 'Record<string, { value: string; messageId: string; confidence: number; status: "active" | "superseded" | "removed"; supersededBy?: string | undefined; }[]>' must have a '[Symbol.iterator]()' method that returns an iterator.
|
|
typecheck:
src/routes/demo/index.ts#L214
'apiKey' is declared but its value is never read.
|
|
typecheck:
src/routes/branches/index.ts#L324
Argument of type '500' is not assignable to parameter of type '200 | 404 | 403'.
|
|
typecheck:
src/routes/branches/index.ts#L258
Property 'fact' does not exist on type '{ value: string; key: string; id: string; createdAt: Date; branchId: string; confidence: number; messageIds: string[]; }'.
|
|
typecheck:
src/routes/branches/index.ts#L168
Argument of type '500' is not assignable to parameter of type '200 | 404 | 403'.
|
|
lint
Process completed with exit code 1.
|
|
lint:
src/plugins/env.ts#L22
Delete `·`
|
|
lint:
src/plugins/env.ts#L7
Delete `·`
|
|
lint:
src/plugins/cors.ts#L12
Replace `'Content-Type',·'Authorization',·'X-LLM-Key',·'X-Routing-Provider',·'x-routing-provider'` with `⏎······'Content-Type',⏎······'Authorization',⏎······'X-LLM-Key',⏎······'X-Routing-Provider',⏎······'x-routing-provider',⏎····`
|
|
src/services/drift/operations/classify-route/helpers/parse-response.test.ts > parseResponse > parses ROUTE action with targetBranchId:
src/services/drift/operations/classify-route/helpers/parse-response.ts#L12
TypeError: Cannot read properties of undefined (reading 'action')
❯ Module.parseResponse src/services/drift/operations/classify-route/helpers/parse-response.ts:12:23
❯ src/services/drift/operations/classify-route/helpers/parse-response.test.ts:44:20
|
|
src/services/drift/operations/classify-route/helpers/parse-response.test.ts > parseResponse > parses BRANCH action with newBranchTopic:
src/services/drift/operations/classify-route/helpers/parse-response.ts#L12
TypeError: Cannot read properties of undefined (reading 'action')
❯ Module.parseResponse src/services/drift/operations/classify-route/helpers/parse-response.ts:12:23
❯ src/services/drift/operations/classify-route/helpers/parse-response.test.ts:29:20
|
|
src/services/drift/operations/classify-route/helpers/parse-response.test.ts > parseResponse > parses STAY action correctly:
src/services/drift/operations/classify-route/helpers/parse-response.ts#L12
TypeError: Cannot read properties of undefined (reading 'action')
❯ Module.parseResponse src/services/drift/operations/classify-route/helpers/parse-response.ts:12:23
❯ src/services/drift/operations/classify-route/helpers/parse-response.test.ts:12:20
|
|
src/services/drift/operations/classify-route/helpers/build-prompt.test.ts > buildPrompt > formats multiple branches correctly:
src/services/drift/operations/classify-route/helpers/build-prompt.test.ts#L73
AssertionError: expected 'You are a conversation router. Your j…' to contain '- a: Topic A\n- b: Topic B\n- c: Topi…'
- Expected
+ Received
- - a: Topic A
- - b: Topic B
- - c: Topic C
+ You are a conversation router. Your job: Route the message to the right branch.
+
+ WHY: Each branch has separate memory. Splitting too early = AI loses context.
+
+ Current topic: None
+ Other topics:
+ 1. Topic A
+ 2. Topic B
+ 3. Topic C
+
+ New message: "Test"
+
+ ROUTING RULES:
+ - STAY: Message relates to current topic, or would benefit from current context
+ - ROUTE: Message fits an OTHER topic better - semantically related topics should share branches (return topic NUMBER)
+ - BRANCH: Message is fundamentally different - needs separate memory. MUST provide a short topic name (3-6 words).
+
+ Ask: "Would the AI respond BETTER with current context?" → Yes = STAY
+ Ask: "Is this semantically related to an existing topic?" → Yes = ROUTE to that topic
+ Ask: "Is this a completely different domain/category?" → Yes = BRANCH
+
+ Examples of ROUTE (not BRANCH):
+ - "golden retrievers" → "cavoodles" (both dog breeds, same domain)
+ - "Paris hotels" → "London hotels" (both travel/hotels, same domain)
+ - "mortgage rates" → "property tax" (both home buying, same domain)
+
+ Examples of BRANCH:
+ - "Paris hotels" → "what's the weather?" (travel → weather, different domains)
+ - "golden retrievers" → "recipe for pasta" (dogs → cooking, different domains)
+
+ Default to STAY if uncertain.
+ Confidence: How certain are you? 0 = no idea, 0.5 = uncertain, 0.8 = confident, 1 = absolutely certain.
+
+ IMPORTANT: If action=BRANCH, you MUST provide a newBranchTopic (3-6 words describing the new topic).
❯ src/services/drift/operations/classify-route/helpers/build-prompt.test.ts:73:20
|
|
src/services/drift/operations/classify-route/helpers/build-prompt.test.ts > buildPrompt > uses fallback text when no current branch:
src/services/drift/operations/classify-route/helpers/build-prompt.test.ts#L61
AssertionError: expected 'You are a conversation router. Your j…' to contain 'STAY: Message DIRECTLY continues disc…'
- Expected
+ Received
- STAY: Message DIRECTLY continues discussing "the current topic"
+ You are a conversation router. Your job: Route the message to the right branch.
+
+ WHY: Each branch has separate memory. Splitting too early = AI loses context.
+
+ Current topic: None
+ Other topics:
+ None
+
+ New message: "Test"
+
+ ROUTING RULES:
+ - STAY: Message relates to current topic, or would benefit from current context
+ - ROUTE: Message fits an OTHER topic better - semantically related topics should share branches (return topic NUMBER)
+ - BRANCH: Message is fundamentally different - needs separate memory. MUST provide a short topic name (3-6 words).
+
+ Ask: "Would the AI respond BETTER with current context?" → Yes = STAY
+ Ask: "Is this semantically related to an existing topic?" → Yes = ROUTE to that topic
+ Ask: "Is this a completely different domain/category?" → Yes = BRANCH
+
+ Examples of ROUTE (not BRANCH):
+ - "golden retrievers" → "cavoodles" (both dog breeds, same domain)
+ - "Paris hotels" → "London hotels" (both travel/hotels, same domain)
+ - "mortgage rates" → "property tax" (both home buying, same domain)
+
+ Examples of BRANCH:
+ - "Paris hotels" → "what's the weather?" (travel → weather, different domains)
+ - "golden retrievers" → "recipe for pasta" (dogs → cooking, different domains)
+
+ Default to STAY if uncertain.
+ Confidence: How certain are you? 0 = no idea, 0.5 = uncertain, 0.8 = confident, 1 = absolutely certain.
+
+ IMPORTANT: If action=BRANCH, you MUST provide a newBranchTopic (3-6 words describing the new topic).
❯ src/services/drift/operations/classify-route/helpers/build-prompt.test.ts:61:20
|
|
src/services/drift/operations/classify-route/helpers/build-prompt.test.ts > buildPrompt > references current topic in STAY description:
src/services/drift/operations/classify-route/helpers/build-prompt.test.ts#L55
AssertionError: expected 'You are a conversation router. Your j…' to contain 'STAY: Message DIRECTLY continues disc…'
- Expected
+ Received
- STAY: Message DIRECTLY continues discussing "Machine Learning"
+ You are a conversation router. Your job: Route the message to the right branch.
+
+ WHY: Each branch has separate memory. Splitting too early = AI loses context.
+
+ Current topic: Machine Learning
+ Other topics:
+ None
+
+ New message: "Test"
+
+ ROUTING RULES:
+ - STAY: Message relates to current topic, or would benefit from current context
+ - ROUTE: Message fits an OTHER topic better - semantically related topics should share branches (return topic NUMBER)
+ - BRANCH: Message is fundamentally different - needs separate memory. MUST provide a short topic name (3-6 words).
+
+ Ask: "Would the AI respond BETTER with current context?" → Yes = STAY
+ Ask: "Is this semantically related to an existing topic?" → Yes = ROUTE to that topic
+ Ask: "Is this a completely different domain/category?" → Yes = BRANCH
+
+ Examples of ROUTE (not BRANCH):
+ - "golden retrievers" → "cavoodles" (both dog breeds, same domain)
+ - "Paris hotels" → "London hotels" (both travel/hotels, same domain)
+ - "mortgage rates" → "property tax" (both home buying, same domain)
+
+ Examples of BRANCH:
+ - "Paris hotels" → "what's the weather?" (travel → weather, different domains)
+ - "golden retrievers" → "recipe for pasta" (dogs → cooking, different domains)
+
+ Default to STAY if uncertain.
+ Confidence: How certain are you? 0 = no idea, 0.5 = uncertain, 0.8 = confident, 1 = absolutely certain.
+
+ IMPORTANT: If action=BRANCH, you MUST provide a newBranchTopic (3-6 words describing the new topic).
❯ src/services/drift/operations/classify-route/helpers/build-prompt.test.ts:55:20
|
|
src/services/drift/operations/classify-route/helpers/build-prompt.test.ts > buildPrompt > includes quick check guidelines:
src/services/drift/operations/classify-route/helpers/build-prompt.test.ts#L46
AssertionError: expected 'You are a conversation router. Your j…' to contain 'Filler (Yes, Ok, Sure, Thanks) → STAY'
- Expected
+ Received
- Filler (Yes, Ok, Sure, Thanks) → STAY
+ You are a conversation router. Your job: Route the message to the right branch.
+
+ WHY: Each branch has separate memory. Splitting too early = AI loses context.
+
+ Current topic: None
+ Other topics:
+ None
+
+ New message: "Test"
+
+ ROUTING RULES:
+ - STAY: Message relates to current topic, or would benefit from current context
+ - ROUTE: Message fits an OTHER topic better - semantically related topics should share branches (return topic NUMBER)
+ - BRANCH: Message is fundamentally different - needs separate memory. MUST provide a short topic name (3-6 words).
+
+ Ask: "Would the AI respond BETTER with current context?" → Yes = STAY
+ Ask: "Is this semantically related to an existing topic?" → Yes = ROUTE to that topic
+ Ask: "Is this a completely different domain/category?" → Yes = BRANCH
+
+ Examples of ROUTE (not BRANCH):
+ - "golden retrievers" → "cavoodles" (both dog breeds, same domain)
+ - "Paris hotels" → "London hotels" (both travel/hotels, same domain)
+ - "mortgage rates" → "property tax" (both home buying, same domain)
+
+ Examples of BRANCH:
+ - "Paris hotels" → "what's the weather?" (travel → weather, different domains)
+ - "golden retrievers" → "recipe for pasta" (dogs → cooking, different domains)
+
+ Default to STAY if uncertain.
+ Confidence: How certain are you? 0 = no idea, 0.5 = uncertain, 0.8 = confident, 1 = absolutely certain.
+
+ IMPORTANT: If action=BRANCH, you MUST provide a newBranchTopic (3-6 words describing the new topic).
❯ src/services/drift/operations/classify-route/helpers/build-prompt.test.ts:46:20
|
|
src/services/drift/operations/classify-route/helpers/build-prompt.test.ts > buildPrompt > handles no other branches:
src/services/drift/operations/classify-route/helpers/build-prompt.test.ts#L32
AssertionError: expected 'You are a conversation router. Your j…' to contain 'Other branches:\nNone'
- Expected
+ Received
- Other branches:
+ You are a conversation router. Your job: Route the message to the right branch.
+
+ WHY: Each branch has separate memory. Splitting too early = AI loses context.
+
+ Current topic: Current topic
+ Other topics:
None
+
+ New message: "Test message"
+
+ ROUTING RULES:
+ - STAY: Message relates to current topic, or would benefit from current context
+ - ROUTE: Message fits an OTHER topic better - semantically related topics should share branches (return topic NUMBER)
+ - BRANCH: Message is fundamentally different - needs separate memory. MUST provide a short topic name (3-6 words).
+
+ Ask: "Would the AI respond BETTER with current context?" → Yes = STAY
+ Ask: "Is this semantically related to an existing topic?" → Yes = ROUTE to that topic
+ Ask: "Is this a completely different domain/category?" → Yes = BRANCH
+
+ Examples of ROUTE (not BRANCH):
+ - "golden retrievers" → "cavoodles" (both dog breeds, same domain)
+ - "Paris hotels" → "London hotels" (both travel/hotels, same domain)
+ - "mortgage rates" → "property tax" (both home buying, same domain)
+
+ Examples of BRANCH:
+ - "Paris hotels" → "what's the weather?" (travel → weather, different domains)
+ - "golden retrievers" → "recipe for pasta" (dogs → cooking, different domains)
+
+ Default to STAY if uncertain.
+ Confidence: How certain are you? 0 = no idea, 0.5 = uncertain, 0.8 = confident, 1 = absolutely certain.
+
+ IMPORTANT: If action=BRANCH, you MUST provide a newBranchTopic (3-6 words describing the new topic).
❯ src/services/drift/operations/classify-route/helpers/build-prompt.test.ts:32:20
|
|
src/services/drift/operations/classify-route/helpers/build-prompt.test.ts > buildPrompt > handles no current branch (new conversation):
src/services/drift/operations/classify-route/helpers/build-prompt.test.ts#L23
AssertionError: expected 'You are a conversation router. Your j…' to contain 'Current branch topic: None (new conve…'
- Expected
+ Received
- Current branch topic: None (new conversation)
+ You are a conversation router. Your job: Route the message to the right branch.
+
+ WHY: Each branch has separate memory. Splitting too early = AI loses context.
+
+ Current topic: None
+ Other topics:
+ None
+
+ New message: "Hello there"
+
+ ROUTING RULES:
+ - STAY: Message relates to current topic, or would benefit from current context
+ - ROUTE: Message fits an OTHER topic better - semantically related topics should share branches (return topic NUMBER)
+ - BRANCH: Message is fundamentally different - needs separate memory. MUST provide a short topic name (3-6 words).
+
+ Ask: "Would the AI respond BETTER with current context?" → Yes = STAY
+ Ask: "Is this semantically related to an existing topic?" → Yes = ROUTE to that topic
+ Ask: "Is this a completely different domain/category?" → Yes = BRANCH
+
+ Examples of ROUTE (not BRANCH):
+ - "golden retrievers" → "cavoodles" (both dog breeds, same domain)
+ - "Paris hotels" → "London hotels" (both travel/hotels, same domain)
+ - "mortgage rates" → "property tax" (both home buying, same domain)
+
+ Examples of BRANCH:
+ - "Paris hotels" → "what's the weather?" (travel → weather, different domains)
+ - "golden retrievers" → "recipe for pasta" (dogs → cooking, different domains)
+
+ Default to STAY if uncertain.
+ Confidence: How certain are you? 0 = no idea, 0.5 = uncertain, 0.8 = confident, 1 = absolutely certain.
+
+ IMPORTANT: If action=BRANCH, you MUST provide a newBranchTopic (3-6 words describing the new topic).
❯ src/services/drift/operations/classify-route/helpers/build-prompt.test.ts:23:20
|
|
src/services/drift/operations/classify-route/helpers/build-prompt.test.ts > buildPrompt > builds prompt with current branch and other branches:
src/services/drift/operations/classify-route/helpers/build-prompt.test.ts#L14
AssertionError: expected 'You are a conversation router. Your j…' to contain 'Current branch topic: Discussing Type…'
- Expected
+ Received
- Current branch topic: Discussing TypeScript
+ You are a conversation router. Your job: Route the message to the right branch.
+
+ WHY: Each branch has separate memory. Splitting too early = AI loses context.
+
+ Current topic: Discussing TypeScript
+ Other topics:
+ 1. Python tutorials
+ 2. Database design
+
+ New message: "What about generics?"
+
+ ROUTING RULES:
+ - STAY: Message relates to current topic, or would benefit from current context
+ - ROUTE: Message fits an OTHER topic better - semantically related topics should share branches (return topic NUMBER)
+ - BRANCH: Message is fundamentally different - needs separate memory. MUST provide a short topic name (3-6 words).
+
+ Ask: "Would the AI respond BETTER with current context?" → Yes = STAY
+ Ask: "Is this semantically related to an existing topic?" → Yes = ROUTE to that topic
+ Ask: "Is this a completely different domain/category?" → Yes = BRANCH
+
+ Examples of ROUTE (not BRANCH):
+ - "golden retrievers" → "cavoodles" (both dog breeds, same domain)
+ - "Paris hotels" → "London hotels" (both travel/hotels, same domain)
+ - "mortgage rates" → "property tax" (both home buying, same domain)
+
+ Examples of BRANCH:
+ - "Paris hotels" → "what's the weather?" (travel → weather, different domains)
+ - "golden retrievers" → "recipe for pasta" (dogs → cooking, different domains)
+
+ Default to STAY if uncertain.
+ Confidence: How certain are you? 0 = no idea, 0.5 = uncertain, 0.8 = confident, 1 = absolutely certain.
+
+ IMPORTANT: If action=BRANCH, you MUST provide a newBranchTopic (3-6 words describing the new topic).
❯ src/services/drift/operations/classify-route/helpers/build-prompt.test.ts:14:20
|
Artifacts
Produced during runtime
| Name | Size | Digest | |
|---|---|---|---|
|
dist
Expired
|
86.1 KB |
sha256:f9f7a4950f3f12e7597a5429b5d12978d76caf0e09a403568c06abded7cec3d9
|
|