akseljoonas HF Staff commited on
Commit
de476e8
·
1 Parent(s): a8af09b

hf job output

Browse files
frontend/src/components/Chat/ToolCallGroup.tsx CHANGED
@@ -195,6 +195,14 @@ export default function ToolCallGroup({ tools }: ToolCallGroupProps) {
195
  content: String(log.args.script),
196
  language: 'python',
197
  });
 
 
 
 
 
 
 
 
198
  if (log.jobLogs) {
199
  setPanelTab({
200
  id: 'logs',
@@ -203,7 +211,8 @@ export default function ToolCallGroup({ tools }: ToolCallGroupProps) {
203
  language: 'text',
204
  });
205
  }
206
- setActivePanelTab('script');
 
207
  setRightPanelOpen(true);
208
  setLeftSidebarOpen(false);
209
  return;
@@ -307,53 +316,6 @@ export default function ToolCallGroup({ tools }: ToolCallGroupProps) {
307
  {log.tool}
308
  </Typography>
309
 
310
- {/* Quick action links for completed jobs */}
311
- {log.completed && log.tool === 'hf_jobs' && !!log.args?.script && (
312
- <Box sx={{ display: 'flex', gap: 0.5 }} onClick={(e) => e.stopPropagation()}>
313
- <Typography
314
- component="span"
315
- onClick={() => handleClick(log)}
316
- sx={{
317
- fontSize: '0.68rem',
318
- color: 'var(--muted-text)',
319
- cursor: 'pointer',
320
- px: 0.75,
321
- py: 0.25,
322
- borderRadius: 0.5,
323
- '&:hover': { color: 'var(--accent-yellow)', bgcolor: 'var(--hover-bg)' },
324
- }}
325
- >
326
- Script
327
- </Typography>
328
- {log.jobLogs && (
329
- <Typography
330
- component="span"
331
- onClick={() => {
332
- clearPanelTabs();
333
- if (log.args?.script) {
334
- setPanelTab({ id: 'script', title: 'Script', content: String(log.args.script), language: 'python' });
335
- }
336
- setPanelTab({ id: 'logs', title: 'Logs', content: log.jobLogs!, language: 'text' });
337
- setActivePanelTab('logs');
338
- setRightPanelOpen(true);
339
- setLeftSidebarOpen(false);
340
- }}
341
- sx={{
342
- fontSize: '0.68rem',
343
- color: 'var(--accent-yellow)',
344
- cursor: 'pointer',
345
- px: 0.75,
346
- py: 0.25,
347
- borderRadius: 0.5,
348
- '&:hover': { bgcolor: 'var(--hover-bg)' },
349
- }}
350
- >
351
- Logs
352
- </Typography>
353
- )}
354
- </Box>
355
- )}
356
-
357
  {label && (
358
  <Chip
359
  label={label}
 
195
  content: String(log.args.script),
196
  language: 'python',
197
  });
198
+ if (log.output) {
199
+ setPanelTab({
200
+ id: 'output',
201
+ title: 'Output',
202
+ content: log.output,
203
+ language: 'markdown',
204
+ });
205
+ }
206
  if (log.jobLogs) {
207
  setPanelTab({
208
  id: 'logs',
 
211
  language: 'text',
212
  });
213
  }
214
+ // Default to output if it exists (most useful), otherwise script
215
+ setActivePanelTab(log.output ? 'output' : 'script');
216
  setRightPanelOpen(true);
217
  setLeftSidebarOpen(false);
218
  return;
 
316
  {log.tool}
317
  </Typography>
318
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
319
  {label && (
320
  <Chip
321
  label={label}
frontend/src/hooks/useAgentWebSocket.ts CHANGED
@@ -285,6 +285,18 @@ export function useAgentWebSocket({
285
 
286
  updateTraceLog(toolCallId, toolName, updates);
287
  updateCurrentTurnTrace(sessionId);
 
 
 
 
 
 
 
 
 
 
 
 
288
  }
289
 
290
  // Don't create message bubbles for tool outputs - they only show in trace logs
 
285
 
286
  updateTraceLog(toolCallId, toolName, updates);
287
  updateCurrentTurnTrace(sessionId);
288
+
289
+ // Add output tab so the user can see results (especially errors)
290
+ setPanelTab({
291
+ id: 'output',
292
+ title: 'Output',
293
+ content: output,
294
+ language: 'markdown',
295
+ });
296
+ // Auto-switch to output tab on failure so errors are immediately visible
297
+ if (!success) {
298
+ setActivePanelTab('output');
299
+ }
300
  }
301
 
302
  // Don't create message bubbles for tool outputs - they only show in trace logs