Add Phase 6: write tools, shell, and edit tools with reasoning-only fix
Implement 6 new agent tools — write_file, make_dir, delete_file, str_replace, patch_apply, run_command — bringing the agent from read-only observer to active code modifier. All write/shell operations are gated through the existing permissions service. Also fix a bug where qwen3.5 thinking mode produces reasoning tokens but no content after tool results, causing the agent to silently exit. The loop now detects reasoning-only responses, retries twice, then injects a nudge message to break the model out of its thinking loop. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -147,6 +147,11 @@ class StreamHandler:
|
||||
"""Token usage reported by the API, if available."""
|
||||
return self._usage
|
||||
|
||||
@property
|
||||
def had_reasoning_only(self) -> bool:
|
||||
"""True if the model produced reasoning tokens but no content or tool calls."""
|
||||
return bool(self._accumulated_reasoning) and not self._accumulated_content and not self._tool_calls
|
||||
|
||||
def reset(self) -> None:
|
||||
"""Clear all accumulators for the next turn."""
|
||||
self._accumulated_content = ""
|
||||
|
||||
Reference in New Issue
Block a user