feat(agent): add python repl skill - #3688
Conversation
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #3688 +/- ##
==========================================
+ Coverage 77.78% 77.80% +0.02%
==========================================
Files 1287 1290 +3
Lines 123467 123566 +99
Branches 10822 10827 +5
==========================================
+ Hits 96044 96146 +102
+ Misses 24281 24280 -1
+ Partials 3142 3140 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 6 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Greptile SummaryThis change adds an agent-callable Python analysis skill that opens the active robot-memory recording in a new process, captures its output, and registers the supporting recorder and memory blueprint. The no-output test was executed through the skill branch and is confirmed to fail because its expected message differs from the implementation's returned message. The new execution interface also accepts arbitrary Python under the service account and has no execution deadline, so it is not safe to expose to untrusted callers. T-Rex validation blockedEnd-to-end checks of unrestricted code execution and an infinite-loop payload could not reach Confidence Score: 1/5Do not merge until arbitrary code execution is isolated and bounded, and the failing no-output test is reconciled with the implementation. Three independent blocking issues remain: one exposes service-account capabilities to callers, one permits a submitted program to wait indefinitely, and one makes the new test fail. The message mismatch was directly exercised; the other two are explicit in the execution path but their runtime harnesses were stopped by missing packages. Files Needing Attention:
|
| return text[:limit] + f"\n... [truncated, {len(text)} chars total]" | ||
|
|
||
|
|
||
| run_python_skill = RunPythonSkill.blueprint |
There was a problem hiding this comment.
How did you end up creating this? :D We've removed this style a long time ago.
There was a problem hiding this comment.
woops, fixed. looks like a stale AGENTS.md instruction - I'm letting the fix to that hitch hike into this PR
| class RunPythonSkill(Module): | ||
| """Give an agent a fresh Python process for each tool call.""" | ||
|
|
||
| dedicated_worker: ClassVar[bool] = True |
There was a problem hiding this comment.
This does not need a dedicated worker. They are for compute intensive python work, but this runs Python in separate processes.
| namespace starts with ``store`` (the live memory store) and ``np`` (NumPy), | ||
| and normal Python imports are available. | ||
|
|
||
| Each call runs in a new Python process. Variables and imports do not carry |
There was a problem hiding this comment.
Each call runs in a new Python process.
But then this is not a REPL. L is for loop.
|
|
||
| from dimos.memory.store.sqlite import SqliteStore | ||
|
|
||
| store = SqliteStore(path=sys.argv[1], must_exist=True) |
There was a problem hiding this comment.
Why force the construction of a store? Shouldn't the agent create one if it wants to?
Same with numpy.
Contribution path
Problem
All that wonderful data was in memory2 but the agent couldn't access it.
Solution
A new skill is added to our MCP server:
python_repl(code: str) -> str:codeand then is shut downstdoutandstderrA new blueprint is also created:
unitree-go2-agentic-memory:unitree-go2blueprintGo2MemoryandPythonReplSkillblueprintsHow to Test
Turn on your Go2.
Then, either hook up your harness of choice to the DimOS MCP or do
uv run dimos humancliand say something like:demo-2026-08-25-13-47-27.mp4
AI assistance
I used
gpt-5.6-solto write the vast majority of the code diff.Checklist