akseljoonas HF Staff commited on
Commit
f765eb4
·
1 Parent(s): b2846f6

Revert "fix: show errorText for failed tools, bump eval max_iterations to 300"

Browse files

This reverts commit b2846f673c874945d2b55aaaf53287a2f8bd0b2f.

eval/hf_agent_connector.py CHANGED
@@ -30,7 +30,7 @@ class AgentResponseGenerator:
30
  returns the assistant's final message.
31
  """
32
 
33
- def __init__(self, config_path: str | Path, max_iterations: int = 300) -> None:
34
  self.config_path = _resolve_project_path(config_path)
35
  self.config: Config = load_config(str(self.config_path))
36
  self.max_iterations = max_iterations
 
30
  returns the assistant's final message.
31
  """
32
 
33
+ def __init__(self, config_path: str | Path, max_iterations: int = 10) -> None:
34
  self.config_path = _resolve_project_path(config_path)
35
  self.config: Config = load_config(str(self.config_path))
36
  self.max_iterations = max_iterations
frontend/src/components/Chat/ToolCallGroup.tsx CHANGED
@@ -371,14 +371,13 @@ export default function ToolCallGroup({ tools, approveTools }: ToolCallGroupProp
371
  const displayName = toolDisplayMap[tool.toolCallId] || tool.toolName;
372
 
373
  if (tool.toolName === 'hf_jobs' && args?.script) {
374
- const jobOutput = tool.output ?? (tool.state === 'output-error' ? (tool as Record<string, unknown>).errorText : undefined);
375
- const hasOutput = (tool.state === 'output-available' || tool.state === 'output-error') && jobOutput;
376
  const scriptContent = getEditedScript(tool.toolCallId) || String(args.script);
377
  setPanel(
378
  {
379
  title: displayName,
380
  script: { content: scriptContent, language: 'python' },
381
- ...(hasOutput ? { output: { content: String(jobOutput), language: 'markdown' } } : {}),
382
  parameters: { tool_call_id: tool.toolCallId },
383
  },
384
  hasOutput ? 'output' : 'script',
@@ -390,10 +389,9 @@ export default function ToolCallGroup({ tools, approveTools }: ToolCallGroupProp
390
 
391
  const inputSection = args ? { content: JSON.stringify(args, null, 2), language: 'json' } : undefined;
392
 
393
- const outputText = tool.output ?? (tool.state === 'output-error' ? (tool as Record<string, unknown>).errorText : undefined);
394
- if ((tool.state === 'output-available' || tool.state === 'output-error') && outputText) {
395
  let language = 'text';
396
- const content = String(outputText);
397
  if (content.trim().startsWith('{') || content.trim().startsWith('[')) language = 'json';
398
  else if (content.includes('```')) language = 'markdown';
399
 
 
371
  const displayName = toolDisplayMap[tool.toolCallId] || tool.toolName;
372
 
373
  if (tool.toolName === 'hf_jobs' && args?.script) {
374
+ const hasOutput = (tool.state === 'output-available' || tool.state === 'output-error') && tool.output;
 
375
  const scriptContent = getEditedScript(tool.toolCallId) || String(args.script);
376
  setPanel(
377
  {
378
  title: displayName,
379
  script: { content: scriptContent, language: 'python' },
380
+ ...(hasOutput ? { output: { content: String(tool.output), language: 'markdown' } } : {}),
381
  parameters: { tool_call_id: tool.toolCallId },
382
  },
383
  hasOutput ? 'output' : 'script',
 
389
 
390
  const inputSection = args ? { content: JSON.stringify(args, null, 2), language: 'json' } : undefined;
391
 
392
+ if ((tool.state === 'output-available' || tool.state === 'output-error') && tool.output) {
 
393
  let language = 'text';
394
+ const content = String(tool.output);
395
  if (content.trim().startsWith('{') || content.trim().startsWith('[')) language = 'json';
396
  else if (content.includes('```')) language = 'markdown';
397