Commit b7b1e6b
committed
Simplify: move duplicate observation deduplication to events_to_messages
Instead of adding a new transform() method to ViewPropertyBase and a
new ToolResultUniquenessProperty class, handle the deduplication of
consecutive observations with the same tool_call_id directly in the
events_to_messages() function.
This is simpler because:
- events_to_messages already handles a similar case (batching ActionEvents
with the same llm_response_id)
- No new abstraction needed in the view property system
- The deduplication happens at message conversion time, which is where
the constraint matters (Anthropic API message format)
The fix still handles the original bug: when a runtime restart creates
an AgentErrorEvent for an "unmatched" action, but the tool then
completes and creates an ObservationEvent with the same tool_call_id,
only the ObservationEvent is kept (it has the actual result).
Co-authored-by: openhands <openhands@all-hands.dev>1 parent d66d74d commit b7b1e6b
File tree
7 files changed
+315
-799
lines changed- openhands-sdk/openhands/sdk
- context/view
- properties
- event
- tests/sdk
- context/view/properties
- event
7 files changed
+315
-799
lines changedLines changed: 0 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | 9 | | |
13 | 10 | | |
14 | 11 | | |
15 | 12 | | |
16 | 13 | | |
17 | 14 | | |
18 | | - | |
19 | 15 | | |
20 | 16 | | |
21 | 17 | | |
| |||
24 | 20 | | |
25 | 21 | | |
26 | 22 | | |
27 | | - | |
28 | 23 | | |
29 | 24 | | |
Lines changed: 0 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | 46 | | |
68 | 47 | | |
69 | 48 | | |
| |||
Lines changed: 0 additions & 234 deletions
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | 106 | | |
110 | 107 | | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | 108 | | |
124 | 109 | | |
125 | 110 | | |
126 | | - | |
| 111 | + | |
127 | 112 | | |
128 | 113 | | |
129 | 114 | | |
| |||
0 commit comments