mirror of
https://github.com/leonvanzyl/autocoder.git
synced 2026-02-01 06:53:36 +00:00
fix: address code review feedback from coderabbitai
- Add language specifier to fenced code block in expand-project.md - Remove detailed exception strings from WebSocket responses (security) - Make WebSocket "start" message idempotent to avoid session reset - Fix race condition in bulk feature creation with row-level lock - Add validation for starting_priority (must be >= 1) - Fix _query_claude to handle multiple feature blocks and deduplicate - Add FileReader error handling in ExpandProjectChat - Fix disconnect() to clear pending reconnect timeout - Enable sandbox mode and validate CLI path in expand_chat_session - Clean up temporary settings file on session close Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -161,12 +161,22 @@ async def expand_project_websocket(websocket: WebSocket, project_name: str):
|
||||
continue
|
||||
|
||||
elif msg_type == "start":
|
||||
# Create and start a new expansion session
|
||||
session = await create_expand_session(project_name, project_dir)
|
||||
# Check if session already exists (idempotent start)
|
||||
existing_session = get_expand_session(project_name)
|
||||
if existing_session:
|
||||
session = existing_session
|
||||
await websocket.send_json({
|
||||
"type": "text",
|
||||
"content": "Resuming existing expansion session. What would you like to add?"
|
||||
})
|
||||
await websocket.send_json({"type": "response_done"})
|
||||
else:
|
||||
# Create and start a new expansion session
|
||||
session = await create_expand_session(project_name, project_dir)
|
||||
|
||||
# Stream the initial greeting
|
||||
async for chunk in session.start():
|
||||
await websocket.send_json(chunk)
|
||||
# Stream the initial greeting
|
||||
async for chunk in session.start():
|
||||
await websocket.send_json(chunk)
|
||||
|
||||
elif msg_type == "message":
|
||||
# User sent a message
|
||||
@@ -192,7 +202,7 @@ async def expand_project_websocket(websocket: WebSocket, project_name: str):
|
||||
logger.warning(f"Invalid attachment data: {e}")
|
||||
await websocket.send_json({
|
||||
"type": "error",
|
||||
"content": f"Invalid attachment: {str(e)}"
|
||||
"content": "Invalid attachment format"
|
||||
})
|
||||
continue
|
||||
|
||||
@@ -236,7 +246,7 @@ async def expand_project_websocket(websocket: WebSocket, project_name: str):
|
||||
try:
|
||||
await websocket.send_json({
|
||||
"type": "error",
|
||||
"content": f"Server error: {str(e)}"
|
||||
"content": "Internal server error"
|
||||
})
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user