From 6731ef44ea33c0ed8f3b20629f2cca7046f576c1 Mon Sep 17 00:00:00 2001 From: cabana8471 Date: Sun, 25 Jan 2026 12:07:36 +0100 Subject: [PATCH 1/2] 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 --- server/routers/features.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/routers/features.py b/server/routers/features.py index a830001..e5ad919 100644 --- a/server/routers/features.py +++ b/server/routers/features.py @@ -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() From d6ba075ac4b53195a0d68f5a554fa3b7526354e8 Mon Sep 17 00:00:00 2001 From: cabana8471 Date: Sun, 25 Jan 2026 12:36:54 +0100 Subject: [PATCH 2/2] style: align priority calculation pattern with rest of file Address CodeRabbit feedback - use consistent conditional pattern: `(max_priority.priority + 1) if max_priority else 1` This matches the pattern used in create_feature and create_features_bulk. Co-Authored-By: Claude Opus 4.5 --- server/routers/features.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/routers/features.py b/server/routers/features.py index e5ad919..c4c9c27 100644 --- a/server/routers/features.py +++ b/server/routers/features.py @@ -553,7 +553,7 @@ async def skip_feature(project_name: str, feature_id: int): # 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) + 1 + feature.priority = (max_priority.priority + 1) if max_priority else 1 session.commit()