From 3a085085e4ff03fb7174b157d26b7124f6156501 Mon Sep 17 00:00:00 2001 From: Auto Date: Tue, 30 Dec 2025 20:29:27 +0200 Subject: [PATCH] fix next feature filtering on in progress --- agent.py | 8 ++++++++ mcp_server/feature_mcp.py | 8 +++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/agent.py b/agent.py index f8e7077..c7d3b22 100644 --- a/agent.py +++ b/agent.py @@ -6,11 +6,19 @@ Core agent interaction functions for running autonomous coding sessions. """ import asyncio +import io +import sys from pathlib import Path from typing import Optional from claude_agent_sdk import ClaudeSDKClient +# Fix Windows console encoding for Unicode characters (emoji, etc.) +# Without this, print() crashes when Claude outputs emoji like ✅ +if sys.platform == "win32": + sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8', errors='replace') + sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8', errors='replace') + from client import create_client from progress import print_session_header, print_progress_summary, has_features from prompts import ( diff --git a/mcp_server/feature_mcp.py b/mcp_server/feature_mcp.py index 64eae93..8c5f3c8 100644 --- a/mcp_server/feature_mcp.py +++ b/mcp_server/feature_mcp.py @@ -145,26 +145,24 @@ def feature_get_stats() -> str: def feature_get_next() -> str: """Get the highest-priority pending feature to work on. - Returns the feature with the lowest priority number that has passes=false - and is not currently in-progress by another session. + Returns the feature with the lowest priority number that has passes=false. Use this at the start of each coding session to determine what to implement next. Returns: JSON with feature details (id, priority, category, name, description, steps, passes, in_progress) - or error message if all features are passing or in-progress. + or error message if all features are passing. """ session = get_session() try: feature = ( session.query(Feature) .filter(Feature.passes == False) - .filter(Feature.in_progress == False) .order_by(Feature.priority.asc(), Feature.id.asc()) .first() ) if feature is None: - return json.dumps({"error": "All features are passing or in-progress! No more work to do."}) + return json.dumps({"error": "All features are passing! No more work to do."}) return json.dumps(feature.to_dict(), indent=2) finally: