Commit 8cbca3c
committed
fix(gooddata-eval): scope simulated-user pushback to the original request
generate_simulated_response() only saw the assistant's last message and the
ground-truth MAQL, and was instructed to force every clause of that MAQL to
be satisfied "even if the assistant's question doesn't explicitly ask about
it" -- so it would inject filters/constraints the user's original request
never mentioned, even when the assistant's proposal already matched it.
- Thread the original question through (metric_skill.py's
_execute_single_metric_run already has it in scope; conversation.py's
TurnDefinition.message carries the same for multi-turn conversations) and
rewrite the prompt to agree when the original request is already
satisfied, only adding a clause when it's a reasonable reading of that
request -- not an unconditional replay of expected_outputs[0].
- Add an explicit branch for the dominant real case: the assistant asking a
clarifying question with no proposal yet. Without it, the simulated user
could trivially agree ("nothing proposed yet" == "satisfied") and stall
the conversation, burning iterations without ever supplying the agent a
usable answer.
- Replace fuzzy "is this filter a reasonable reading of the request"
judgment with a deterministic _no_filter_hint(): when the ground-truth
MAQL has no WHERE clause, the prompt explicitly tells the simulated user
no filter is needed, closing the exact loophole that caused the bug.
Matches WHERE as a standalone keyword outside {type/id} identifiers and
quoted literals (reusing the existing _PROTECTED_RE / same rule as
_casefold_outside_protected), so a substring like
{metric/somewhere_sales} isn't mistaken for a real clause.
- conversation.py's metric branch (forwards to
metric_skill.generate_simulated_response) had 0% test coverage behind a
bare `except Exception: pass` -- a future signature mismatch would
silently fall through to the generic fallback prompt. Log the exception
and add a direct unit test for the branch.
- Restore the max_tokens >= 300 assertion, and reduce the new tests'
reliance on exact prompt-prose assertions in favor of checking the
interpolated data and the independently-testable _no_filter_hint() output.
Verified locally: ran the full agent_metric_skill (8 cases) and
agent_conversations (10 cases) suites against ecommerce_demo on
tavern-frank-test -- 18/18 passing with this fix.
QA-290941 parent 0e0f3dd commit 8cbca3c
4 files changed
Lines changed: 161 additions & 18 deletions
File tree
- packages/gooddata-eval
- src/gooddata_eval/core/agentic
- tests
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
208 | | - | |
209 | | - | |
210 | | - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| |||
Lines changed: 36 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
| |||
99 | 102 | | |
100 | 103 | | |
101 | 104 | | |
102 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
103 | 125 | | |
104 | 126 | | |
105 | 127 | | |
| |||
119 | 141 | | |
120 | 142 | | |
121 | 143 | | |
| 144 | + | |
122 | 145 | | |
123 | 146 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
128 | 157 | | |
129 | 158 | | |
130 | 159 | | |
| |||
281 | 310 | | |
282 | 311 | | |
283 | 312 | | |
284 | | - | |
| 313 | + | |
285 | 314 | | |
286 | 315 | | |
287 | 316 | | |
| |||
Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
107 | 108 | | |
108 | 109 | | |
109 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
110 | 135 | | |
111 | 136 | | |
112 | 137 | | |
| |||
Lines changed: 97 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
94 | 127 | | |
95 | 128 | | |
96 | 129 | | |
| |||
111 | 144 | | |
112 | 145 | | |
113 | 146 | | |
114 | | - | |
| 147 | + | |
115 | 148 | | |
116 | 149 | | |
117 | 150 | | |
118 | 151 | | |
119 | 152 | | |
120 | 153 | | |
121 | | - | |
122 | | - | |
123 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
124 | 157 | | |
125 | 158 | | |
126 | 159 | | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
127 | 214 | | |
128 | 215 | | |
129 | 216 | | |
| |||
228 | 315 | | |
229 | 316 | | |
230 | 317 | | |
231 | | - | |
| 318 | + | |
232 | 319 | | |
233 | 320 | | |
234 | 321 | | |
| |||
408 | 495 | | |
409 | 496 | | |
410 | 497 | | |
411 | | - | |
| 498 | + | |
412 | 499 | | |
413 | 500 | | |
414 | 501 | | |
415 | 502 | | |
416 | 503 | | |
417 | 504 | | |
418 | 505 | | |
419 | | - | |
| 506 | + | |
420 | 507 | | |
421 | 508 | | |
422 | 509 | | |
| |||
448 | 535 | | |
449 | 536 | | |
450 | 537 | | |
451 | | - | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
452 | 541 | | |
453 | 542 | | |
454 | 543 | | |
| |||
0 commit comments