Skip to content

Commit 47ed940

Browse files
committed
chore: small improvements
1 parent d521c24 commit 47ed940

5 files changed

Lines changed: 11 additions & 35 deletions

File tree

apps/api/orpc/routers/ai/chat.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import { tools } from '@conar/ai/tools'
66
import { ConnectionType } from '@conar/shared/enums/connection-type'
77
import { streamToEventIterator } from '@orpc/server'
88
import { convertToModelMessages, smoothStream, stepCountIs, streamText } from 'ai'
9-
import { createRetryable } from 'ai-retry'
9+
import { createRetryableModel } from 'ai-retry/language-model'
1010
import { type } from 'arktype'
1111
import { v7 } from 'uuid'
1212
import { withPosthog } from '~/lib/posthog'
1313
import { orpc, subscriptionMiddleware } from '~/orpc'
1414

15-
const model = createRetryable({
15+
const model = createRetryableModel({
1616
model: anthropic('claude-opus-4-8'),
1717
retries: [
1818
openai('gpt-5.3-codex'),
@@ -114,6 +114,7 @@ export const chat = orpc
114114
},
115115
...(await convertToModelMessages(input.messages)),
116116
],
117+
allowSystemInMessages: true,
117118
stopWhen: stepCountIs(Number.POSITIVE_INFINITY),
118119
abortSignal: signal,
119120
model: withPosthog(model, {

apps/app/src/components/tiptap.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,6 @@ export function TipTap({
7777
editor,
7878
}), [editor])
7979

80-
useEffect(() => {
81-
if (editor && value !== editor.getText()) {
82-
editor.commands.setContent(value)
83-
}
84-
}, [value, editor])
85-
8680
const addImage = (e: React.ClipboardEvent<HTMLDivElement> | React.DragEvent<HTMLDivElement>, data: DataTransfer) => {
8781
if (!onImageAdd)
8882
return

apps/app/src/entities/connection/collections.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function notify() {
2020
listeners.forEach(l => l())
2121
}
2222

23-
export function createCollections(): Collections {
23+
export function getCollections(): Collections {
2424
if (current) {
2525
return current
2626
}
@@ -38,13 +38,6 @@ export function createCollections(): Collections {
3838
return current
3939
}
4040

41-
export function getCollections(): Collections {
42-
if (!current) {
43-
throw new Error('[collections] Not initialized. Call createCollections() first.')
44-
}
45-
return current
46-
}
47-
4841
export function cleanCollections() {
4942
if (!current)
5043
return

apps/app/src/routes/_protected.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { createFileRoute, Outlet } from '@tanstack/react-router'
22
import { useEffect } from 'react'
33
import { SubscriptionModal } from '~/components/subscriprion-modal'
4-
import { cleanCollections, createCollections } from '~/entities/connection/collections'
4+
import { cleanCollections, getCollections } from '~/entities/connection/collections'
55
import { EventsProvider } from '~/events'
66
import { enterAppAnimation } from '~/global-hooks'
77
import { useConnectionStringsSync } from '~/hooks/use-connection-strings-sync'
@@ -12,7 +12,7 @@ import { ActionsCenter } from './-components/actions-center'
1212
export const Route = createFileRoute('/_protected')({
1313
component: ProtectedLayout,
1414
beforeLoad: async () => {
15-
const c = createCollections()
15+
const c = getCollections()
1616

1717
await Promise.all([
1818
c.connectionStringsCollection.stateWhenReady(),

pnpm-lock.yaml

Lines changed: 5 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)