Skip to content

Commit 0bb3e05

Browse files
Enhance Claude agent progress reporting with detailed tool input form… (#480)
Enhance Claude agent progress reporting with detailed tool input formatting - Remove the --bare flag from the Claude Code agent configuration in apps/editor/src/features/search-files/search-modes/perform-agent-search-mode/agents/claude.ts. - [Pasted text] W przypadku claude code chcemy naprawic wysweitlanie progesu notifikacji - [Pasted text] Nie chcemy widziec notyfikacji w tekstem jeddnoslownym bash dla claude code └── apps └── editor └── src └── features └── search-files └── search-modes └── perform-agent-search-mode ├── agents │ ├── antigravity.ts │ ├── claude.ts │ ├── codex.ts │ ├── cursor.ts │ ├── grok.ts │ ├── muse.ts │ └── opencode.ts ├── index.ts ├── perform-agent-search-mode.ts ├── types.ts └── utils.ts
1 parent 6da0572 commit 0bb3e05

1 file changed

Lines changed: 51 additions & 6 deletions

File tree

  • apps/editor/src/features/search-files/search-modes/perform-agent-search-mode/agents

‎apps/editor/src/features/search-files/search-modes/perform-agent-search-mode/agents/claude.ts‎

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,77 @@
11
import { CodingAgent } from '../types'
22
import { build_agent_prompt, check_command_exists } from '../utils'
33

4+
const report_tool_progress = (
5+
tool_name: string,
6+
input: any,
7+
report_progress: (msg: string) => void
8+
) => {
9+
const formatted_name = tool_name.toLowerCase()
10+
let msg: string | undefined
11+
12+
if (
13+
formatted_name.includes('bash') ||
14+
formatted_name.includes('command') ||
15+
formatted_name.includes('run')
16+
) {
17+
msg = input?.command || input?.cmd || input?.CommandLine
18+
} else if (
19+
formatted_name.includes('read') ||
20+
formatted_name.includes('write') ||
21+
formatted_name.includes('edit') ||
22+
formatted_name.includes('list')
23+
) {
24+
msg = input?.file_path || input?.path
25+
} else if (
26+
formatted_name.includes('grep') ||
27+
formatted_name.includes('search') ||
28+
formatted_name.includes('find')
29+
) {
30+
msg = input?.pattern || input?.query
31+
} else {
32+
msg = input?.file_path || input?.path || tool_name
33+
}
34+
35+
if (msg) {
36+
report_progress(msg)
37+
}
38+
}
39+
440
export const claude_agent: CodingAgent = {
541
id: 'claude',
642
label: 'Claude Code',
743
cmd: 'claude',
844
is_installed: () => check_command_exists('claude'),
945
get_documentation_url: () => 'https://code.claude.com/docs/en/headless',
1046
get_args: (query: string) => [
11-
'--bare',
1247
'-p',
1348
build_agent_prompt(query),
1449
'--output-format',
1550
'stream-json',
1651
'--verbose',
52+
'--include-partial-messages',
1753
'--permission-mode',
18-
'auto',
19-
'--include-partial-messages'
54+
'auto'
2055
],
2156
parse_stream_line: (parsed, report_progress) => {
2257
if (parsed.type == 'stream_event' && parsed.event) {
2358
if (
2459
parsed.event.type == 'content_block_start' &&
2560
parsed.event.content_block?.type == 'tool_use'
2661
) {
27-
const tool_name = parsed.event.content_block.name
28-
if (tool_name) {
29-
report_progress(tool_name)
62+
const tool = parsed.event.content_block
63+
if (tool.name) {
64+
report_tool_progress(tool.name, tool.input, report_progress)
65+
}
66+
}
67+
} else if (parsed.type == 'assistant' && parsed.message?.content) {
68+
const content = Array.isArray(parsed.message.content)
69+
? parsed.message.content
70+
: []
71+
72+
for (const block of content) {
73+
if (block?.type == 'tool_use' && block.name) {
74+
report_tool_progress(block.name, block.input, report_progress)
3075
}
3176
}
3277
} else if (parsed.type == 'result' && parsed.result) {

0 commit comments

Comments
 (0)