Skip to content

Commit 2bf8345

Browse files
authored
feat: show the summarized final difference between the final workspace and the base workspace (#1281)
1 parent c2defc1 commit 2bf8345

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

rdagent/log/ui/ds_trace.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,18 @@ def convert_defaultdict_to_dict(d):
7272

7373

7474
def load_data(log_path: Path):
75+
"""
76+
Load and normalize logged data for the UI.
77+
78+
Meaning of "no_tag":
79+
- We attempt to extract an evolution id (ei) from each message tag.
80+
- If no ei can be extracted (i.e., the entry is not tied to a specific evolving step),
81+
the item is stored under the "no_tag" key.
82+
- Typical "no_tag" entries include:
83+
* direct_exp_gen["no_tag"]: the base experiment/hypothesis for the loop
84+
* coding["no_tag"] / running["no_tag"]: the final workspace/result for that stage
85+
* llm_data[loop_id][function]["no_tag"]: common LLM logs without an ei
86+
"""
7587
data = defaultdict(lambda: defaultdict(dict))
7688
llm_data = defaultdict(lambda: defaultdict(lambda: defaultdict(list)))
7789
token_costs = defaultdict(list)
@@ -576,6 +588,18 @@ def main_win(loop_id, llm_data=None):
576588
last_sota_exp=last_sota_exp,
577589
)
578590
if "feedback" in loop_data:
591+
# Show final diff between the final workspace and the base workspace
592+
base_workspace = loop_data["direct_exp_gen"]["no_tag"].experiment_workspace
593+
final_workspace = None
594+
if "running" in loop_data and "no_tag" in loop_data["running"]:
595+
final_workspace = loop_data["running"]["no_tag"].experiment_workspace
596+
elif "coding" in loop_data and "no_tag" in loop_data["coding"]:
597+
final_workspace = loop_data["coding"]["no_tag"].experiment_workspace
598+
599+
if final_workspace is not None and base_workspace is not None:
600+
st.subheader("Final Diff")
601+
workspace_win(final_workspace, cmp_workspace=base_workspace, cmp_name="base workspace")
602+
579603
feedback_win(loop_data["feedback"], llm_data.get("feedback", None) if llm_data else None)
580604
if "record" in loop_data and "SOTA experiment" in loop_data["record"]:
581605
st.header("Record", divider="violet", anchor="record")

0 commit comments

Comments
 (0)