mirror of
https://github.com/leonvanzyl/autocoder.git
synced 2026-02-02 07:23:35 +00:00
fix: prevent PendingRollbackError and add MCP tool support for sessions
- Add explicit session.rollback() in exception handlers for database context managers in features.py, schedules.py, and database.py get_db() to prevent SQLAlchemy PendingRollbackError on failed transactions - Add EXPAND_FEATURE_TOOLS to expand session security settings allow list so the expand skill can use the MCP tools it references - Update assistant session prompt to direct the LLM to call MCP tools directly for feature creation instead of suggesting CLI commands Cherry-picked fixes from PR #92 (closed) with cleaner implementation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -84,6 +84,9 @@ def _get_db_session(project_name: str) -> Generator[Tuple[Session, Path], None,
|
||||
db = SessionLocal()
|
||||
try:
|
||||
yield db, project_path
|
||||
except Exception:
|
||||
db.rollback()
|
||||
raise
|
||||
finally:
|
||||
db.close()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user