nanocode-cli 0.3.32__tar.gz → 0.3.34__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.
- {nanocode_cli-0.3.32/nanocode_cli.egg-info → nanocode_cli-0.3.34}/PKG-INFO +1 -1
- {nanocode_cli-0.3.32 → nanocode_cli-0.3.34}/nanocode.py +16 -7
- {nanocode_cli-0.3.32 → nanocode_cli-0.3.34/nanocode_cli.egg-info}/PKG-INFO +1 -1
- {nanocode_cli-0.3.32 → nanocode_cli-0.3.34}/pyproject.toml +1 -1
- {nanocode_cli-0.3.32 → nanocode_cli-0.3.34}/LICENSE +0 -0
- {nanocode_cli-0.3.32 → nanocode_cli-0.3.34}/MANIFEST.in +0 -0
- {nanocode_cli-0.3.32 → nanocode_cli-0.3.34}/README.md +0 -0
- {nanocode_cli-0.3.32 → nanocode_cli-0.3.34}/nanocode_cli.egg-info/SOURCES.txt +0 -0
- {nanocode_cli-0.3.32 → nanocode_cli-0.3.34}/nanocode_cli.egg-info/dependency_links.txt +0 -0
- {nanocode_cli-0.3.32 → nanocode_cli-0.3.34}/nanocode_cli.egg-info/entry_points.txt +0 -0
- {nanocode_cli-0.3.32 → nanocode_cli-0.3.34}/nanocode_cli.egg-info/requires.txt +0 -0
- {nanocode_cli-0.3.32 → nanocode_cli-0.3.34}/nanocode_cli.egg-info/top_level.txt +0 -0
- {nanocode_cli-0.3.32 → nanocode_cli-0.3.34}/setup.cfg +0 -0
|
@@ -51,7 +51,7 @@ from prompt_toolkit.output.defaults import create_output
|
|
|
51
51
|
from prompt_toolkit.patch_stdout import patch_stdout
|
|
52
52
|
from prompt_toolkit.styles import Style
|
|
53
53
|
|
|
54
|
-
__version__ = "0.3.
|
|
54
|
+
__version__ = "0.3.34"
|
|
55
55
|
HTTP_USER_AGENT = "nanocode/" + __version__
|
|
56
56
|
|
|
57
57
|
|
|
@@ -1169,6 +1169,17 @@ class ToolResultContext:
|
|
|
1169
1169
|
self.recent = [compact(block) for block in self.recent]
|
|
1170
1170
|
self.latest = [compact(block) for block in self.latest]
|
|
1171
1171
|
|
|
1172
|
+
def act_blocks(self) -> list[str]:
|
|
1173
|
+
# Pending observe blocks are unresolved raw results. Keep them visible to
|
|
1174
|
+
# ACT until observe explicitly keeps/forgets them; otherwise an older
|
|
1175
|
+
# pending result can degrade to a compact recent summary before observe
|
|
1176
|
+
# gets a chance to select it.
|
|
1177
|
+
latest_keys = set(self.blocks_by_key(self.latest))
|
|
1178
|
+
pending = [block for block in self.pending_observe if self.result_key(block) not in latest_keys]
|
|
1179
|
+
raw_keys = set(self.blocks_by_key(pending)) | latest_keys
|
|
1180
|
+
recent = [block for block in self.recent if self.result_key(block) not in raw_keys]
|
|
1181
|
+
return recent + pending + self.latest
|
|
1182
|
+
|
|
1172
1183
|
def visible_counter(self, mode: AgentMode) -> int:
|
|
1173
1184
|
if mode == AgentMode.OBSERVE and self.pending_observe:
|
|
1174
1185
|
return self.max_counter(self.pending_observe)
|
|
@@ -4897,8 +4908,8 @@ class Agent:
|
|
|
4897
4908
|
RECENT_TOOL_CALL_CHARS: ClassVar[int] = 72_000
|
|
4898
4909
|
KEPT_TOOL_RESULT_CHARS: ClassVar[int] = 96_000
|
|
4899
4910
|
RECENT_TOOL_CALL_SUMMARIES: ClassVar[int] = 40
|
|
4900
|
-
|
|
4901
|
-
|
|
4911
|
+
# Trigger observe after this many unresolved raw tool result blocks accumulate.
|
|
4912
|
+
OBSERVE_AFTER_PENDING_RESULT_COUNT: ClassVar[int] = 8
|
|
4902
4913
|
PLAN_MODE_GIT_READONLY: ClassVar[frozenset[str]] = GIT_READONLY_COMMANDS
|
|
4903
4914
|
|
|
4904
4915
|
def __init__(self, session: Session):
|
|
@@ -5037,7 +5048,7 @@ class Agent:
|
|
|
5037
5048
|
def _format_recent_tool_call_context(self) -> str:
|
|
5038
5049
|
if self.mode == AgentMode.OBSERVE and self.tool_context.pending_observe:
|
|
5039
5050
|
return "\n\n".join(self.tool_context.pending_observe)
|
|
5040
|
-
return "\n\n".join(self.tool_context.
|
|
5051
|
+
return "\n\n".join(self.tool_context.act_blocks())
|
|
5041
5052
|
|
|
5042
5053
|
def _prune_tool_result_store(self) -> None:
|
|
5043
5054
|
keep = self._protected_tool_result_keys()
|
|
@@ -5203,9 +5214,7 @@ class Agent:
|
|
|
5203
5214
|
return False
|
|
5204
5215
|
if any(self._tool_failure_needs_observe(execution) for execution in self.tool_runner.latest_executions):
|
|
5205
5216
|
return True
|
|
5206
|
-
|
|
5207
|
-
return True
|
|
5208
|
-
return self.runtime.consecutive_tool_turns >= self.PENDING_OBSERVE_TOOL_TURNS
|
|
5217
|
+
return len(pending) >= self.OBSERVE_AFTER_PENDING_RESULT_COUNT
|
|
5209
5218
|
|
|
5210
5219
|
def _tool_failure_needs_observe(self, execution: ToolCallExecution) -> bool:
|
|
5211
5220
|
if execution.outcome == "success":
|
|
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
|