-
Notifications
You must be signed in to change notification settings - Fork 0
Fix stub/real-file collision in per-agent Docker builds #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -32,12 +32,31 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| _CREATE_TABLE = text( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| f""" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CREATE TABLE IF NOT EXISTS {TABLE_NAME} ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| future_id TEXT PRIMARY KEY, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| session_id TEXT, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| workflow TEXT, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| agent TEXT, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| execution_time REAL, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cpu_resource REAL, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| gpu_resource REAL, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| created_at TEXT, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| updated_at TEXT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+35
to
+49
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
# Map the target file and nearby symbols first.
ast-grep outline ventis/controller/utils/sqlalchemy.py --view expanded || true
# Show the file with line numbers.
cat -n ventis/controller/utils/sqlalchemy.py
# Find where runtime_information is written/read.
rg -n "created_at|updated_at|send_data|runtime_information|_engine|CREATE TABLE" ventis/controller -SRepository: CanyonCodeCoreAI/canyoncodecore Length of output: 6625 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Read only the relevant sections if the file is long.
sed -n '1,220p' ventis/controller/utils/sqlalchemy.pyRepository: CanyonCodeCoreAI/canyoncodecore Length of output: 3658 🏁 Script executed: #!/bin/bash
set -euo pipefail
# If tests or examples reference persistence, inspect them too.
rg -n "runtime_information|created_at|updated_at|session_id|future_id" -S .Repository: CanyonCodeCoreAI/canyoncodecore Length of output: 7769 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Check for line counts before reading more if needed.
wc -l ventis/controller/utils/sqlalchemy.pyRepository: CanyonCodeCoreAI/canyoncodecore Length of output: 211 🏁 Script executed: #!/bin/bash
set -euo pipefail
cat -n tests/test_runtime_sqlalchemy.pyRepository: CanyonCodeCoreAI/canyoncodecore Length of output: 5069 🏁 Script executed: #!/bin/bash
set -euo pipefail
python3 - <<'PY'
import sqlite3
for decl in ["TEXT", "REAL", "NUMERIC", "INTEGER"]:
conn = sqlite3.connect(":memory:")
conn.execute(f"CREATE TABLE t (v {decl})")
conn.execute("INSERT INTO t(v) VALUES (?)", (1.5,))
value, typ = conn.execute("SELECT v, typeof(v) FROM t").fetchone()
print(decl, repr(value), typ)
PYRepository: CanyonCodeCoreAI/canyoncodecore Length of output: 233 🏁 Script executed: #!/bin/bash
set -euo pipefail
sed -n '1,220p' tests/test_runtime_sqlalchemy.pyRepository: CanyonCodeCoreAI/canyoncodecore Length of output: 4166 🏁 Script executed: #!/bin/bash
set -euo pipefail
sed -n '1,180p' tests/test_runtime_sqlalchemy.pyRepository: CanyonCodeCoreAI/canyoncodecore Length of output: 4166 Keep the timestamp columns numeric. Proposed schema fix- created_at TEXT,
- updated_at TEXT
+ created_at REAL,
+ updated_at REAL📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| def _get_engine(database_url): | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| global _engine | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if _engine is None: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| _engine = create_engine( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| os.environ.get("VENTIS_DATABASE_URL", str(database_url)) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with _engine.begin() as conn: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| conn.execute(_CREATE_TABLE) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
52
to
+59
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win Publish the engine only after table initialization succeeds.
Proposed initialization fix def _get_engine(database_url):
global _engine
if _engine is None:
- _engine = create_engine(
- os.environ.get("VENTIS_DATABASE_URL", str(database_url))
- )
- with _engine.begin() as conn:
- conn.execute(_CREATE_TABLE)
+ with _engine_lock:
+ if _engine is None:
+ engine = create_engine(
+ os.environ.get("VENTIS_DATABASE_URL", str(database_url))
+ )
+ with engine.begin() as conn:
+ conn.execute(_CREATE_TABLE)
+ _engine = engine
return _engine🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return _engine | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: CanyonCodeCoreAI/canyoncodecore
Length of output: 2516
🏁 Script executed:
Repository: CanyonCodeCoreAI/canyoncodecore
Length of output: 4685
Handle
os.cpu_count()returningNone.os.cpu_count() * 100raisesTypeErroron hosts where the CPU count is unavailable, soensure_instances()crashes before provisioning starts. Use a fallback likeos.cpu_count() or 1and add a regression test for theNonecase.🤖 Prompt for AI Agents
🚀 Performance & Scalability | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
Repository: CanyonCodeCoreAI/canyoncodecore
Length of output: 10485
🏁 Script executed:
Repository: CanyonCodeCoreAI/canyoncodecore
Length of output: 10485
🏁 Script executed:
Repository: CanyonCodeCoreAI/canyoncodecore
Length of output: 9948
🏁 Script executed:
Repository: CanyonCodeCoreAI/canyoncodecore
Length of output: 252
🏁 Script executed:
Repository: CanyonCodeCoreAI/canyoncodecore
Length of output: 241
🏁 Script executed:
Repository: CanyonCodeCoreAI/canyoncodecore
Length of output: 13069
Add a hard cap for provisioning concurrency. This pool can still grow to
100 * CPU count, which means thousands of simultaneous Docker/AWS calls on large hosts. Keep the limit separately configurable and fall back safely when CPU count is unavailable.🤖 Prompt for AI Agents