feat(backend): bound the messages kept per project
A project that lives for months would otherwise grow the SQLite file without limit, even though the model only ever reads the most recent messages. Pruning the oldest rows on every write keeps a project to a fixed budget without touching what the context is built from.
This commit is contained in:
6 files changed
+150
-5
No files matched your search
@@ -19,9 +19,12 @@ export async function startServer(options = {}) {
|
||||
dbPath: ':memory:',
|
||||
ollamaUrl: mock.url,
|
||||
ollamaModel: 'mock:1',
|
||||
maxMessagesPerProject: options.maxMessagesPerProject,
|
||||
});
|
||||
|
||||
const db = createDatabase(config.dbPath);
|
||||
const db = createDatabase(config.dbPath, {
|
||||
maxMessagesPerProject: config.messages.maxPerProject,
|
||||
});
|
||||
const ollama = createOllama(config);
|
||||
const app = await buildApp({ config, db, ollama });
|
||||
|
||||
|
||||
Reference in new issue
Block a user