mirror of
https://github.com/parcadei/Continuous-Claude-v3.git
synced 2026-09-14 20:06:55 +08:00
fix: resolve setup artifacts from earlier experiments (#39)
- Change archival_memory.embedding from vector(4096) to vector(1024) to match BGE-large-en-v1.5 output dimensions - Add DATABASE_URL as first priority in postgres_pool.py (matches what setup wizard generates) - Fix recall_learnings.py sys.path to add project root (opc/) instead of scripts/ directory Reported-by: @mxcrowe
This commit is contained in:
@@ -38,7 +38,7 @@ CREATE TABLE IF NOT EXISTS archival_memory (
|
||||
agent_id TEXT,
|
||||
content TEXT NOT NULL,
|
||||
metadata JSONB DEFAULT '{}',
|
||||
embedding vector(4096),
|
||||
embedding vector(1024),
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
||||
);
|
||||
|
||||
|
||||
@@ -104,17 +104,22 @@ def get_connection_string() -> str:
|
||||
"""Get PostgreSQL connection string from environment or defaults.
|
||||
|
||||
Checks env vars in order (single source of truth pattern):
|
||||
1. OPC_POSTGRES_URL - primary config used by wizard/docker-compose
|
||||
2. AGENTICA_POSTGRES_URL - legacy/alternative name
|
||||
3. Development default if neither set
|
||||
1. DATABASE_URL - standard name, generated by wizard
|
||||
2. OPC_POSTGRES_URL - alternative name
|
||||
3. AGENTICA_POSTGRES_URL - legacy name
|
||||
4. Development default if none set
|
||||
|
||||
In production mode, one of these must be explicitly set.
|
||||
|
||||
Raises:
|
||||
ValueError: If no URL is set in production mode.
|
||||
"""
|
||||
# Check env vars in priority order
|
||||
url = os.environ.get("OPC_POSTGRES_URL") or os.environ.get("AGENTICA_POSTGRES_URL")
|
||||
# Check env vars in priority order (DATABASE_URL is what wizard generates)
|
||||
url = (
|
||||
os.environ.get("DATABASE_URL")
|
||||
or os.environ.get("OPC_POSTGRES_URL")
|
||||
or os.environ.get("AGENTICA_POSTGRES_URL")
|
||||
)
|
||||
|
||||
if url:
|
||||
return url
|
||||
|
||||
@@ -41,8 +41,9 @@ if global_env.exists():
|
||||
load_dotenv(global_env)
|
||||
load_dotenv()
|
||||
|
||||
# Add scripts to path for imports
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
|
||||
# Add project root to path for imports (opc/)
|
||||
project_dir = os.environ.get("CLAUDE_PROJECT_DIR", str(Path(__file__).parent.parent.parent))
|
||||
sys.path.insert(0, project_dir)
|
||||
|
||||
|
||||
def format_result_preview(content: str, max_length: int = 200) -> str:
|
||||
|
||||
Reference in New Issue
Block a user