Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions codeframe/cli/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from pathlib import Path
from typing import Optional

import click
import typer
from dotenv import load_dotenv
from rich.console import Console
Expand Down Expand Up @@ -2007,6 +2008,7 @@ def work_start(
"blocker",
"--stall-action",
help="Recovery action on stall: 'blocker' (default), 'retry', or 'fail'",
click_type=click.Choice(["blocker", "retry", "fail"], case_sensitive=False),
),
) -> None:
"""Start working on a task.
Expand Down Expand Up @@ -2884,6 +2886,7 @@ def batch_run(
"blocker",
"--stall-action",
help="Recovery action on stall: 'blocker' (default), 'retry', or 'fail'",
click_type=click.Choice(["blocker", "retry", "fail"], case_sensitive=False),
),
) -> None:
"""Execute multiple tasks in batch.
Expand Down
3 changes: 1 addition & 2 deletions codeframe/core/react_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,7 @@ def run(self, task_id: str) -> AgentStatus:
finally:
self._stall_monitor.stop()
except StallDetectedError:
self._stall_monitor.stop()
raise # Let runtime handle retry
raise # Monitor stopped by finally above; let runtime handle retry
except Exception:
logger.exception("ReactAgent.run() failed for task %s", task_id)
self._emit(EventType.AGENT_FAILED, {
Expand Down
2 changes: 2 additions & 0 deletions codeframe/core/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,8 @@ def execute_agent(
fix_coordinator: Optional coordinator for global fixes (for parallel execution)
event_publisher: Optional EventPublisher for SSE streaming (real-time events)
engine: Agent engine to use ("react" for ReactAgent (default), "plan" for legacy Agent)
stall_timeout_s: Seconds without tool activity before stall detection (0 = disabled)
stall_action: Recovery action on stall ("blocker", "retry", or "fail")
Comment on lines +617 to +618

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Clarify that these stall controls are React-only.

execute_agent() only consumes stall_timeout_s and stall_action in the engine == "react" path, so this docstring currently implies support that the legacy plan engine doesn't have.

📝 Suggested wording
-        stall_timeout_s: Seconds without tool activity before stall detection (0 = disabled)
-        stall_action: Recovery action on stall ("blocker", "retry", or "fail")
+        stall_timeout_s: React engine only. Seconds without tool activity before stall detection (0 = disabled)
+        stall_action: React engine only. Recovery action on stall ("blocker", "retry", or "fail")
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@codeframe/core/runtime.py` around lines 617 - 618, Update the docstring to
state that stall_timeout_s and stall_action apply only to the React engine;
specifically mention that execute_agent() consumes stall_timeout_s and
stall_action only when engine == "react" (they are not used by the legacy plan
engine). Reference the parameters stall_timeout_s and stall_action and the
function execute_agent so readers know where the restriction applies.


Returns:
Final AgentState after execution
Expand Down
Loading