fix: use consistent priority increment when skipping features (#65)

The REST API skip endpoint was using max_priority + 1000, while the
MCP server used max_priority + 1. This caused priority inflation where
values could reach 10,000+ after multiple skips.

Changed to use + 1 for consistency with mcp_server/feature_mcp.py:345.

Fixes: leonvanzyl/autocoder#65

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
cabana8471
2026-01-25 12:07:36 +01:00
parent 486979c3d9
commit 6731ef44ea

View File

@@ -551,9 +551,9 @@ async def skip_feature(project_name: str, feature_id: int):
if not feature:
raise HTTPException(status_code=404, detail=f"Feature {feature_id} not found")
# Set priority to max + 1000 to push to end
# Set priority to max + 1 to push to end (consistent with MCP server)
max_priority = session.query(Feature).order_by(Feature.priority.desc()).first()
feature.priority = (max_priority.priority if max_priority else 0) + 1000
feature.priority = (max_priority.priority if max_priority else 0) + 1
session.commit()