feat: Improve dashboard performance and Claude terminal context
- Add trial limiting (300 max) and reduce polling to 15s for large studies - Make dashboard layout wider with col-span adjustments - Claude terminal now runs from Atomizer root for CLAUDE.md/skills access - Add study context display in terminal on connect - Add KaTeX math rendering styles for study reports - Add surrogate tuner module for hyperparameter optimization - Fix backend proxy to port 8001 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -73,7 +73,8 @@ async def list_studies():
|
||||
# Protocol 10: Read from Optuna SQLite database
|
||||
if study_db.exists():
|
||||
try:
|
||||
conn = sqlite3.connect(str(study_db))
|
||||
# Use timeout to avoid blocking on locked databases
|
||||
conn = sqlite3.connect(str(study_db), timeout=2.0)
|
||||
cursor = conn.cursor()
|
||||
|
||||
# Get trial count and status
|
||||
@@ -130,6 +131,29 @@ async def list_studies():
|
||||
config.get('trials', {}).get('n_trials', 50)
|
||||
)
|
||||
|
||||
# Get creation date from directory or config modification time
|
||||
created_at = None
|
||||
try:
|
||||
# First try to get from database (most accurate)
|
||||
if study_db.exists():
|
||||
created_at = datetime.fromtimestamp(study_db.stat().st_mtime).isoformat()
|
||||
elif config_file.exists():
|
||||
created_at = datetime.fromtimestamp(config_file.stat().st_mtime).isoformat()
|
||||
else:
|
||||
created_at = datetime.fromtimestamp(study_dir.stat().st_ctime).isoformat()
|
||||
except:
|
||||
created_at = None
|
||||
|
||||
# Get last modified time
|
||||
last_modified = None
|
||||
try:
|
||||
if study_db.exists():
|
||||
last_modified = datetime.fromtimestamp(study_db.stat().st_mtime).isoformat()
|
||||
elif history_file.exists():
|
||||
last_modified = datetime.fromtimestamp(history_file.stat().st_mtime).isoformat()
|
||||
except:
|
||||
last_modified = None
|
||||
|
||||
studies.append({
|
||||
"id": study_dir.name,
|
||||
"name": study_dir.name.replace("_", " ").title(),
|
||||
@@ -140,7 +164,9 @@ async def list_studies():
|
||||
},
|
||||
"best_value": best_value,
|
||||
"target": config.get('target', {}).get('value'),
|
||||
"path": str(study_dir)
|
||||
"path": str(study_dir),
|
||||
"created_at": created_at,
|
||||
"last_modified": last_modified
|
||||
})
|
||||
|
||||
return {"studies": studies}
|
||||
|
||||
Reference in New Issue
Block a user