patchpal 0.22.6__tar.gz → 0.22.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. {patchpal-0.22.6/patchpal.egg-info → patchpal-0.22.8}/PKG-INFO +13 -1
  2. {patchpal-0.22.6 → patchpal-0.22.8}/README.md +12 -0
  3. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal/__init__.py +1 -1
  4. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal/cli/autopilot.py +6 -0
  5. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal/cli/interactive.py +10 -0
  6. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal/tools/code_analysis.py +6 -2
  7. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal/tools/repo_map.py +3 -1
  8. {patchpal-0.22.6 → patchpal-0.22.8/patchpal.egg-info}/PKG-INFO +13 -1
  9. {patchpal-0.22.6 → patchpal-0.22.8}/LICENSE +0 -0
  10. {patchpal-0.22.6 → patchpal-0.22.8}/MANIFEST.in +0 -0
  11. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal/agent/__init__.py +0 -0
  12. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal/agent/function_calling.py +0 -0
  13. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal/agent/react.py +0 -0
  14. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal/cli/__init__.py +0 -0
  15. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal/cli/mcp.py +0 -0
  16. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal/cli/sandbox.py +0 -0
  17. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal/cli/streaming.py +0 -0
  18. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal/config.py +0 -0
  19. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal/context.py +0 -0
  20. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal/permissions.py +0 -0
  21. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal/prompts/react_prompt.md +0 -0
  22. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal/prompts/system_prompt.md +0 -0
  23. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal/skills.py +0 -0
  24. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal/tools/__init__.py +0 -0
  25. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal/tools/audit.py +0 -0
  26. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal/tools/common.py +0 -0
  27. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal/tools/definitions.py +0 -0
  28. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal/tools/file_reading.py +0 -0
  29. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal/tools/file_writing.py +0 -0
  30. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal/tools/find_tool.py +0 -0
  31. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal/tools/grep_tool.py +0 -0
  32. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal/tools/image_handler.py +0 -0
  33. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal/tools/mcp.py +0 -0
  34. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal/tools/shell_tools.py +0 -0
  35. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal/tools/todo_tools.py +0 -0
  36. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal/tools/tool_schema.py +0 -0
  37. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal/tools/user_interaction.py +0 -0
  38. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal/tools/web_tools.py +0 -0
  39. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal.egg-info/SOURCES.txt +0 -0
  40. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal.egg-info/dependency_links.txt +0 -0
  41. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal.egg-info/entry_points.txt +0 -0
  42. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal.egg-info/requires.txt +0 -0
  43. {patchpal-0.22.6 → patchpal-0.22.8}/patchpal.egg-info/top_level.txt +0 -0
  44. {patchpal-0.22.6 → patchpal-0.22.8}/pyproject.toml +0 -0
  45. {patchpal-0.22.6 → patchpal-0.22.8}/setup.cfg +0 -0
  46. {patchpal-0.22.6 → patchpal-0.22.8}/tests/test_agent.py +0 -0
  47. {patchpal-0.22.6 → patchpal-0.22.8}/tests/test_cli.py +0 -0
  48. {patchpal-0.22.6 → patchpal-0.22.8}/tests/test_config_dynamic.py +0 -0
  49. {patchpal-0.22.6 → patchpal-0.22.8}/tests/test_context.py +0 -0
  50. {patchpal-0.22.6 → patchpal-0.22.8}/tests/test_custom_tools.py +0 -0
  51. {patchpal-0.22.6 → patchpal-0.22.8}/tests/test_enabled_tools.py +0 -0
  52. {patchpal-0.22.6 → patchpal-0.22.8}/tests/test_find_tool.py +0 -0
  53. {patchpal-0.22.6 → patchpal-0.22.8}/tests/test_guardrails.py +0 -0
  54. {patchpal-0.22.6 → patchpal-0.22.8}/tests/test_image_blocking.py +0 -0
  55. {patchpal-0.22.6 → patchpal-0.22.8}/tests/test_maximum_security.py +0 -0
  56. {patchpal-0.22.6 → patchpal-0.22.8}/tests/test_mcp_config.py +0 -0
  57. {patchpal-0.22.6 → patchpal-0.22.8}/tests/test_memory.py +0 -0
  58. {patchpal-0.22.6 → patchpal-0.22.8}/tests/test_operational_safety.py +0 -0
  59. {patchpal-0.22.6 → patchpal-0.22.8}/tests/test_optional_tools.py +0 -0
  60. {patchpal-0.22.6 → patchpal-0.22.8}/tests/test_permissions.py +0 -0
  61. {patchpal-0.22.6 → patchpal-0.22.8}/tests/test_react.py +0 -0
  62. {patchpal-0.22.6 → patchpal-0.22.8}/tests/test_reasoning_content.py +0 -0
  63. {patchpal-0.22.6 → patchpal-0.22.8}/tests/test_repo_map.py +0 -0
  64. {patchpal-0.22.6 → patchpal-0.22.8}/tests/test_simplified_prompt.py +0 -0
  65. {patchpal-0.22.6 → patchpal-0.22.8}/tests/test_skills.py +0 -0
  66. {patchpal-0.22.6 → patchpal-0.22.8}/tests/test_streaming.py +0 -0
  67. {patchpal-0.22.6 → patchpal-0.22.8}/tests/test_tools.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: patchpal
3
- Version: 0.22.6
3
+ Version: 0.22.8
4
4
  Summary: An agentic coding and automation assistant, supporting both local and cloud LLMs
5
5
  Author: PatchPal Contributors
6
6
  License-Expression: Apache-2.0
@@ -177,6 +177,18 @@ While originally designed for software development, PatchPal is also a general-p
177
177
  2. PatchPal includes a [unique guardrails system](https://amaiya.github.io/patchpal/safety/) that is better suited to privacy-conscious use cases involving sensitive data.
178
178
  3. We needed an agent harness that seamlessly works with [both local and cloud models](https://amaiya.github.io/patchpal/models/overview/#supported-models), including AWS GovCloud Bedrock models.
179
179
 
180
+ > On Windows Subsystem for Linux (WSL), why is it stalling intermittently at "Thinking..."?
181
+
182
+ This is a [known issue](https://github.com/microsoft/WSL/issues/6264#issuecomment-762154193) with WSL2.
183
+
184
+ Try examining and then lowering the `mtu`:
185
+
186
+ ```bash
187
+ $ cat /sys/class/net/eth1/mtu
188
+ 1427
189
+
190
+ $ sudo ip link set eth1 mtu 1400
191
+ ```
180
192
 
181
193
  ## Documentation
182
194
 
@@ -129,6 +129,18 @@ While originally designed for software development, PatchPal is also a general-p
129
129
  2. PatchPal includes a [unique guardrails system](https://amaiya.github.io/patchpal/safety/) that is better suited to privacy-conscious use cases involving sensitive data.
130
130
  3. We needed an agent harness that seamlessly works with [both local and cloud models](https://amaiya.github.io/patchpal/models/overview/#supported-models), including AWS GovCloud Bedrock models.
131
131
 
132
+ > On Windows Subsystem for Linux (WSL), why is it stalling intermittently at "Thinking..."?
133
+
134
+ This is a [known issue](https://github.com/microsoft/WSL/issues/6264#issuecomment-762154193) with WSL2.
135
+
136
+ Try examining and then lowering the `mtu`:
137
+
138
+ ```bash
139
+ $ cat /sys/class/net/eth1/mtu
140
+ 1427
141
+
142
+ $ sudo ip link set eth1 mtu 1400
143
+ ```
132
144
 
133
145
  ## Documentation
134
146
 
@@ -1,6 +1,6 @@
1
1
  """PatchPal - An open-source Claude Code clone implemented purely in Python."""
2
2
 
3
- __version__ = "0.22.6"
3
+ __version__ = "0.22.8"
4
4
 
5
5
  from patchpal.agent import create_agent, create_react_agent
6
6
  from patchpal.cli.autopilot import autopilot_loop
@@ -125,6 +125,12 @@ def autopilot_loop(
125
125
  # The agent's conversation history accumulates, so it can see all previous work
126
126
  response = agent.run(prompt, max_iterations=100)
127
127
 
128
+ # Reset operation counter after each conversation turn
129
+ # This allows long autopilot sessions without hitting the global limit
130
+ from patchpal.tools.common import reset_operation_counter
131
+
132
+ reset_operation_counter()
133
+
128
134
  # Log agent response to audit log
129
135
  try:
130
136
  from patchpal.tools.audit import log_agent_response
@@ -15,6 +15,7 @@ from rich.markdown import Markdown
15
15
  from patchpal.agent import create_agent, create_react_agent
16
16
  from patchpal.config import config
17
17
  from patchpal.tools import audit_logger, set_require_permission_for_all
18
+ from patchpal.tools.common import reset_operation_counter
18
19
 
19
20
 
20
21
  def _sanitize_for_logging(text: str) -> str:
@@ -925,6 +926,7 @@ Supported models: Any LiteLLM-supported model
925
926
  # Clear conversation history
926
927
  agent.messages = []
927
928
  agent._last_compaction_message_count = 0
929
+ agent.last_prompt_tokens = None # Reset stale token count from before clear
928
930
 
929
931
  print("\n\033[1;32m✓ Context cleared successfully!\033[0m")
930
932
  print(" Starting fresh with empty conversation history.")
@@ -1566,6 +1568,10 @@ Supported models: Any LiteLLM-supported model
1566
1568
 
1567
1569
  result = agent.run(prompt, max_iterations=max_iterations)
1568
1570
 
1571
+ # Reset operation counter after each conversation turn
1572
+ # This allows long sessions without hitting the global limit
1573
+ reset_operation_counter()
1574
+
1569
1575
  print("\n" + "=" * 80)
1570
1576
  print("\033[1;32mAgent:\033[0m")
1571
1577
  print("=" * 80)
@@ -1594,6 +1600,10 @@ Supported models: Any LiteLLM-supported model
1594
1600
 
1595
1601
  result = agent.run(user_input, max_iterations=max_iterations)
1596
1602
 
1603
+ # Reset operation counter after each conversation turn
1604
+ # This allows long sessions without hitting the global limit
1605
+ reset_operation_counter()
1606
+
1597
1607
  # Log agent response to audit log with hash-chaining
1598
1608
  try:
1599
1609
  from patchpal.tools.audit import log_agent_response
@@ -76,7 +76,7 @@ CLASS_NODE_TYPES = {
76
76
  }
77
77
 
78
78
 
79
- def code_structure(path: str, max_symbols: int = 50) -> str:
79
+ def code_structure(path: str, max_symbols: int = 50, _internal_call: bool = False) -> str:
80
80
  """
81
81
  Analyze code structure using tree-sitter AST parsing.
82
82
 
@@ -92,6 +92,7 @@ def code_structure(path: str, max_symbols: int = 50) -> str:
92
92
  Args:
93
93
  path: File path to analyze (relative or absolute)
94
94
  max_symbols: Maximum number of symbols to show (default: 50)
95
+ _internal_call: Internal flag - don't count operation if called from get_repo_map
95
96
 
96
97
  Returns:
97
98
  Formatted code structure overview
@@ -107,7 +108,10 @@ def code_structure(path: str, max_symbols: int = 50) -> str:
107
108
 
108
109
  Use read_lines('patchpal/tools.py', start, end) to read specific sections.
109
110
  """
110
- _operation_limiter.check_limit(f"code_structure({path})")
111
+ # Only count operation if not an internal call from get_repo_map
112
+ # This prevents exceeding operation limits when scanning large repos
113
+ if not _internal_call:
114
+ _operation_limiter.check_limit(f"code_structure({path})")
111
115
 
112
116
  if not TREE_SITTER_AVAILABLE:
113
117
  return (
@@ -162,8 +162,10 @@ def get_repo_map(
162
162
 
163
163
  if structure is None:
164
164
  # Generate structure
165
+ # Pass _internal_call=True so code_structure doesn't count as an operation
166
+ # This prevents repo_map from using thousands of operations in large repos
165
167
  try:
166
- structure = code_structure(str(rel_path), max_symbols=20)
168
+ structure = code_structure(str(rel_path), max_symbols=20, _internal_call=True)
167
169
  if structure and not structure.startswith("❌"):
168
170
  # Extract just the essential parts (remove hints and verbose info)
169
171
  lines = structure.split("\n")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: patchpal
3
- Version: 0.22.6
3
+ Version: 0.22.8
4
4
  Summary: An agentic coding and automation assistant, supporting both local and cloud LLMs
5
5
  Author: PatchPal Contributors
6
6
  License-Expression: Apache-2.0
@@ -177,6 +177,18 @@ While originally designed for software development, PatchPal is also a general-p
177
177
  2. PatchPal includes a [unique guardrails system](https://amaiya.github.io/patchpal/safety/) that is better suited to privacy-conscious use cases involving sensitive data.
178
178
  3. We needed an agent harness that seamlessly works with [both local and cloud models](https://amaiya.github.io/patchpal/models/overview/#supported-models), including AWS GovCloud Bedrock models.
179
179
 
180
+ > On Windows Subsystem for Linux (WSL), why is it stalling intermittently at "Thinking..."?
181
+
182
+ This is a [known issue](https://github.com/microsoft/WSL/issues/6264#issuecomment-762154193) with WSL2.
183
+
184
+ Try examining and then lowering the `mtu`:
185
+
186
+ ```bash
187
+ $ cat /sys/class/net/eth1/mtu
188
+ 1427
189
+
190
+ $ sudo ip link set eth1 mtu 1400
191
+ ```
180
192
 
181
193
  ## Documentation
182
194
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes