nimcode 0.4.2__tar.gz → 0.4.3__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.
- {nimcode-0.4.2 → nimcode-0.4.3}/PKG-INFO +1 -1
- nimcode-0.4.3/src/nimcode/__version__.py +1 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode/agent.py +11 -4
- {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode.egg-info/PKG-INFO +1 -1
- {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_agent.py +2 -2
- {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_version.py +3 -3
- nimcode-0.4.2/src/nimcode/__version__.py +0 -1
- {nimcode-0.4.2 → nimcode-0.4.3}/README.md +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/setup.cfg +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/setup.py +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode/__init__.py +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode/cli.py +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode/config.py +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode/lenient_parser.py +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode/mcp_client.py +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode/memory.py +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode/model_registry.py +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode/nim_client.py +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode/permissions.py +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode/plugin_manager.py +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode/rag.py +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode/repl.py +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode/repo_map.py +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode/tools.py +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode/updater.py +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode/watcher.py +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode.egg-info/SOURCES.txt +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode.egg-info/dependency_links.txt +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode.egg-info/entry_points.txt +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode.egg-info/requires.txt +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/src/nimcode.egg-info/top_level.txt +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_cli.py +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_config.py +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_lenient_parser.py +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_mcp_client.py +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_memory.py +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_model_registry.py +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_nim_client.py +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_permissions.py +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_plan_injection.py +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_plugin_manager.py +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_repl.py +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_repl_extra.py +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_repl_fixes.py +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_repl_trust.py +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_repo_map.py +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_tools.py +0 -0
- {nimcode-0.4.2 → nimcode-0.4.3}/tests/test_updater.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.4.3"
|
|
@@ -327,7 +327,7 @@ class Agent:
|
|
|
327
327
|
return "Subagent reached max turns before completing."
|
|
328
328
|
|
|
329
329
|
async def _distill_memory(self) -> list:
|
|
330
|
-
system_msg = self.messages[0]
|
|
330
|
+
system_msg = dict(self.messages[0])
|
|
331
331
|
recent_msgs = self.messages[-4:] if len(self.messages) > 4 else self.messages[1:]
|
|
332
332
|
old_msgs = self.messages[1:-4] if len(self.messages) > 4 else []
|
|
333
333
|
|
|
@@ -335,16 +335,23 @@ class Agent:
|
|
|
335
335
|
return self.messages
|
|
336
336
|
|
|
337
337
|
summary_prompt = "You are a summarization AI. Please summarize the following conversation concisely. Focus on the final state, any completed goals, and any context needed for the next steps:\n\n"
|
|
338
|
+
|
|
339
|
+
existing_summary_marker = "\n\n[PREVIOUS MEMORY SUMMARY]\n"
|
|
340
|
+
if existing_summary_marker in system_msg["content"]:
|
|
341
|
+
parts = system_msg["content"].split(existing_summary_marker, 1)
|
|
342
|
+
system_msg["content"] = parts[0]
|
|
343
|
+
summary_prompt += f"Previous summary to include:\n{parts[1]}\n\n"
|
|
344
|
+
|
|
338
345
|
for m in old_msgs:
|
|
339
346
|
summary_prompt += f"{m['role'].upper()}: {str(m['content'])[:500]}...\n"
|
|
340
347
|
|
|
341
348
|
try:
|
|
342
349
|
summary = await self.client.chat_one_shot(summary_prompt)
|
|
343
|
-
system_msg["content"] += f"
|
|
350
|
+
system_msg["content"] += f"{existing_summary_marker}{summary}"
|
|
351
|
+
return [system_msg] + recent_msgs
|
|
344
352
|
except Exception as e:
|
|
345
353
|
logger.error(f"Distillation failed: {e}")
|
|
346
|
-
|
|
347
|
-
return [system_msg] + recent_msgs
|
|
354
|
+
return self.messages
|
|
348
355
|
|
|
349
356
|
async def run(self, initial_prompt: str = None) -> None:
|
|
350
357
|
"""Main execution loop for NimCode agent."""
|
|
@@ -99,8 +99,8 @@ async def test_distill_memory(agent):
|
|
|
99
99
|
agent.client.chat_one_shot = AsyncMock(return_value="Summarized history")
|
|
100
100
|
|
|
101
101
|
new_msgs = await agent._distill_memory()
|
|
102
|
-
assert "[PREVIOUS MEMORY SUMMARY]" in
|
|
103
|
-
assert "Summarized history" in
|
|
102
|
+
assert "[PREVIOUS MEMORY SUMMARY]" in new_msgs[0]["content"]
|
|
103
|
+
assert "Summarized history" in new_msgs[0]["content"]
|
|
104
104
|
assert len(new_msgs) == 5
|
|
105
105
|
|
|
106
106
|
@pytest.mark.asyncio
|
|
@@ -11,10 +11,10 @@ def test_version_format():
|
|
|
11
11
|
assert part.isdigit(), f"Version part '{part}' is not a digit"
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
def
|
|
15
|
-
"""Current version should be 0.4.
|
|
14
|
+
def test_version_is_0_4_3():
|
|
15
|
+
"""Current version should be 0.4.3."""
|
|
16
16
|
from nimcode.__version__ import __version__
|
|
17
|
-
assert __version__ == "0.4.
|
|
17
|
+
assert __version__ == "0.4.3"
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
def test_updater_uses_version():
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.4.2"
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|