mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
collect Agno persistence regression in CI
This commit is contained in:
@@ -46,6 +46,9 @@ agent = Agent(
|
||||
# the frontend handler, which returns a Promise that only resolves
|
||||
# once the user picks a slot -- equivalent to `interrupt()` in the
|
||||
# LangGraph reference.
|
||||
# A database is intentionally unnecessary here: this agent has no Agno
|
||||
# `external_execution` tools, and the custom route forwards the frontend
|
||||
# tool-result messages directly on the second leg.
|
||||
tools=[],
|
||||
tool_call_limit=5,
|
||||
description="Scheduling assistant for the interrupt-adapted demos.",
|
||||
|
||||
@@ -248,6 +248,8 @@ def _create_session_db():
|
||||
# Keep this import outside the public weather-tool region above.
|
||||
from agno.db.sqlite import SqliteDb
|
||||
|
||||
# The production container runs as an unprivileged user with a read-only
|
||||
# application directory, so its SQLite file belongs in writable /tmp.
|
||||
return SqliteDb(db_file="/tmp/agno.db")
|
||||
|
||||
|
||||
|
||||
+2
-7
@@ -1,16 +1,11 @@
|
||||
"""Regression coverage for Agno frontend-tool session persistence."""
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
PACKAGE_ROOT = Path(__file__).resolve().parent.parent
|
||||
sys.path.insert(0, str(PACKAGE_ROOT))
|
||||
sys.path.insert(0, str(PACKAGE_ROOT / "src"))
|
||||
from agents.main import agent
|
||||
from agno.db.sqlite import SqliteDb
|
||||
|
||||
|
||||
def test_showcase_agent_has_sqlite_session_storage():
|
||||
from agents.main import agent
|
||||
from agno.db.sqlite import SqliteDb
|
||||
|
||||
assert isinstance(agent.db, SqliteDb)
|
||||
assert Path(agent.db.db_file).resolve() == Path("/tmp/agno.db").resolve()
|
||||
+4
-1
@@ -8,7 +8,7 @@
|
||||
pip install sqlalchemy
|
||||
```
|
||||
|
||||
Use SQLite for local development:
|
||||
Use a project-relative SQLite file for local development:
|
||||
|
||||
```python
|
||||
from agno.agent import Agent
|
||||
@@ -22,6 +22,9 @@
|
||||
)
|
||||
```
|
||||
|
||||
The deployed showcase uses `/tmp/agno.db` because its application directory
|
||||
is read-only to the runtime user.
|
||||
|
||||
For production, use durable shared storage such as `PgDb`. An ephemeral
|
||||
container file cannot resume a run on another instance.
|
||||
</Callout>
|
||||
|
||||
@@ -43,6 +43,8 @@ test.each(agnoRoutes)("documents Agno session persistence on %s", (route) => {
|
||||
expect(content).toContain("from agno.db.sqlite import SqliteDb");
|
||||
expect(content).toContain('SqliteDb(db_file="tmp/agno.db")');
|
||||
expect(content).toContain("db=db");
|
||||
expect(content).toContain("/tmp/agno.db");
|
||||
expect(content).toContain("read-only to the runtime user");
|
||||
expect(content).toContain("PgDb");
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user