What happened
When code is extracted from an assistant response, Assistant_code is written with the full raw LLM content instead of the extracted code. That makes Assistant_code a duplicate of Raw_Assistant_Response.
Fix requirement: keep both steps — do not collapse to one.
Raw_Assistant_Response → full raw LLM content (unchanged purpose)
Assistant_code → extracted code only (when code was extracted)
Assistant_nl → raw content when there is no code (existing branch)
Validated on origin/main @ 2538f1c2.
How to reproduce
- Run a CugaLite turn where the model returns prose + a python fence.
- Inspect trajectory steps.
Example model output:
Sure, here is the code:
```python
print(await find_tools("orders"))
Code path:
```python
self._tracker.collect_step(Step(name="Raw_Assistant_Response", data=content))
if code:
self._tracker.collect_step(Step(name="Assistant_code", data=content)) # same content!
Expected for a code turn:
{"name": "Raw_Assistant_Response", "data": "Sure, here is the code:\n```python\nprint(await find_tools(\"orders\"))\n```"},
{"name": "Assistant_code", "data": "print(await find_tools(\"orders\"))"}
Actual: both steps have the same raw content string.
Non-goal: removing Raw_Assistant_Response or only logging extracted code.
Environment
- OS: n/a (code-path bug)
- CUGA:
origin/main @ 2538f1c2
- Component: CugaLite graph adapter / activity tracker
Logs, screenshots, or config
src/cuga/backend/cuga_graph/nodes/cuga_lite/adapter/graph_adapter.py — on_response_processed
Checklist
What happened
When code is extracted from an assistant response,
Assistant_codeis written with the full raw LLMcontentinstead of the extractedcode. That makesAssistant_codea duplicate ofRaw_Assistant_Response.Fix requirement: keep both steps — do not collapse to one.
Raw_Assistant_Response→ full raw LLMcontent(unchanged purpose)Assistant_code→ extractedcodeonly (when code was extracted)Assistant_nl→ rawcontentwhen there is no code (existing branch)Validated on
origin/main@2538f1c2.How to reproduce
Example model output:
Expected for a code turn:
{"name": "Raw_Assistant_Response", "data": "Sure, here is the code:\n```python\nprint(await find_tools(\"orders\"))\n```"}, {"name": "Assistant_code", "data": "print(await find_tools(\"orders\"))"}Actual: both steps have the same raw
contentstring.Non-goal: removing
Raw_Assistant_Responseor only logging extracted code.Environment
origin/main@2538f1c2Logs, screenshots, or config
src/cuga/backend/cuga_graph/nodes/cuga_lite/adapter/graph_adapter.py—on_response_processedChecklist