Commit Graph
14 Commits
Author SHA1 Message Date
David Gageot c37dfa34d6 fix(sqlite): verify connection in OpenDB
Adds a Ping() call to sqliteutil.OpenDB to ensure the database connection is valid and the file can be opened.

This ensures that file permission or missing directory errors are caught and diagnosed immediately.

Assisted-By: cagent
2026-01-05 07:58:47 +01:00
David Gageot 78c9113fa3 refactor(sqlite): centralize connection logic in pkg/sqliteutil
Creates a new pkg/sqliteutil package to handle SQLite connection opening with consistent pragmas.

Enables foreign key support (_pragma=foreign_keys(1)) globally, fixing ignored cascade deletes in RAG strategies.

Refactors pkg/memory, pkg/session, and pkg/rag to use the new utility.

Fixes a resource leak in NewMemoryDatabase where the connection wasn't closed on table creation failure.

Assisted-By: cagent
2026-01-05 07:46:58 +01:00
David Gageot 897fda38ff fix(sqlite): use _pragma for connection parameters
Updates SQLite connection strings to use _pragma query parameters for busy_timeout and journal_mode configuration in both memory database and session store.

Removes redundant manual file cleanup in sqlite tests.

Assisted-By: cagent
2026-01-05 07:42:45 +01:00
David Gageot 20cb811892 Remove useless comments
Signed-off-by: David Gageot <david.gageot@docker.com>
2025-11-06 19:59:37 +01:00
Trung Nguyen 77ae3630cf Fix SQLite database locking issues with concurrent access
Configure SQLite connections with proper concurrency handling to prevent
"database is locked" errors when multiple operations access the database
simultaneously.

Changes:
- Add busy_timeout (5s) to wait for locks instead of failing immediately
- Enable WAL mode for better concurrent read/write performance
- Configure connection pool to serialize writes (SQLite best practice)

Fixes session store and memory database SQLite implementations.
2025-10-17 11:20:05 +02:00
David Gageot 1c394cc871 Also lint tests
Signed-off-by: David Gageot <david.gageot@docker.com>
2025-09-30 18:35:27 +02:00
CrazyMax 968c0d7d6f switch to modernc.org/sqlite
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-09-15 11:52:52 +02:00
David Gageot b7d70acbdb Use t.Context()
Signed-off-by: David Gageot <david.gageot@docker.com>
2025-09-01 17:08:02 +02:00
David Gageot 9e37ffa0a1 Better assertions
Signed-off-by: David Gageot <david.gageot@docker.com>
2025-07-28 15:42:52 +02:00
David Gageot 5d1441a1af Format code
Signed-off-by: David Gageot <david.gageot@docker.com>
2025-07-18 13:37:26 +02:00
Djordje Lukic b5ae4cff7f Rename rumpl/cagent to docker/cagent
Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2025-07-17 11:02:24 +02:00
Djordje Lukic 2fa0f6b696 Add tests for sqlite
Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2025-06-12 22:59:03 +02:00
Djordje LukicandClaude 6188fa83d4 Fix lint warning: rename SqliteMemoryDatabase to MemoryDatabase
Addresses revive linter warning about stuttering type name.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2025-06-12 17:49:55 +02:00
Djordje LukicandClaude f4e8ddb9b5 Add memory system with SQLite database support
Introduces comprehensive memory management capabilities including:
- Memory database interface with SQLite implementation
- Memory manager for storing and retrieving agent memories
- Memory tool for agent interaction with memory system

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2025-06-12 17:43:35 +02:00