Commit 5fb9efb
web-retriever: ask before persisting extracted data to a file (#792)
Previously web-retriever's core workflow had an unconditional step 7:
always write extracted data to a file. Benchmarking against qa-kitten
(same model, same tasks, only the agent differs) showed this firing
even on tasks with no requested output format, silently dropping a
JSON file the user never asked for.
New behavior:
- If the user explicitly requested a file (any format), always create
it -- this takes precedence over everything else.
- If the task/user already specified an inline output format (a single
answer, a specific field, yes/no), answer inline -- skip file logic.
- If the result is small enough to read comfortably in chat, answer
inline.
- Otherwise (genuinely open-ended, large/structured extraction with no
explicit file request), ask via ask_user_question whether to save to
a file before writing anything.
ask_user_question hard-errors instead of prompting when interactive
tools are unavailable (sub-agent invocation via invoke_agent,
autonomous-loop mode, non-interactive/CI) -- web-retriever's primary
advertised invocation path is exactly that sub-agent case, so the
prompt explicitly tells the model not to retry on that error and to
fall back to inline output instead.
Re-verified against the exact repro case: same task/model that
previously produced an unrequested file now answers inline with
file_tool_calls=0.
Jira: PUP-637
Co-authored-by: TJ Webb <thomas.webb@walmart.com>1 parent 173c904 commit 5fb9efb
1 file changed
Lines changed: 29 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
195 | 220 | | |
196 | 221 | | |
197 | 222 | | |
| |||
0 commit comments