Skip to content

Commit b5bb9a8

Browse files
committed
Refactor terminal CLI invocation by removing diff generation and updating no-terminal notification
- CLI > Edit. Closing terminal should not apply the response. do a cleanup of the temp folder instead. └── apps └── editor ├── package.json └── src ├── commands │ └── apply-from-terminal-command.ts ├── extension.ts ├── utils │ └── agentic-cli-invocation │ ├── invoke-agentic-cli.ts │ └── utils │ └── generate-diff-markdown.ts └── views └── prompt ├── backend │ ├── message-handlers │ │ ├── handle-apply-from.ts │ │ └── handle-invoke-agentic-cli.ts │ └── prompt-view-provider.ts └── frontend └── Main ├── Main.tsx └── MainView ├── MainView.tsx └── components └── Header └── Header.tsx
1 parent f70e143 commit b5bb9a8

3 files changed

Lines changed: 11 additions & 25 deletions

File tree

‎apps/editor/src/commands/apply-from-terminal-command.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ export const apply_from_terminal_command = (): vscode.Disposable => {
7070

7171
const active_terminal = vscode.window.activeTerminal
7272
if (!active_terminal) {
73-
vscode.window.showErrorMessage(
74-
t('command.apply-from-terminal-command.error.no-active-terminal')
73+
vscode.window.showInformationMessage(
74+
t('command.apply-from-terminal-command.info.no-active-terminal')
7575
)
7676
return
7777
}

‎apps/editor/src/i18n/translations/commands/apply-from-terminal-command.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const translations = {
1818
hu: 'A terminálból való alkalmazás letiltva van aktív válasz előnézet közben.',
1919
bg: 'Прилагането от терминала е деактивирано по време на активен преглед на отговор.'
2020
},
21-
'command.apply-from-terminal-command.error.no-active-terminal': {
21+
'command.apply-from-terminal-command.info.no-active-terminal': {
2222
en: 'No active terminal session.',
2323
pl: 'Brak aktywnej sesji terminala.',
2424
'zh-cn': '没有活动的终端会话。',

‎apps/editor/src/utils/agentic-cli-invocation/invoke-agentic-cli.ts‎

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -647,20 +647,15 @@ export const invoke_agentic_cli = async (params: {
647647
}
648648

649649
await terminal_closed
650-
let current_agent_output = ''
651-
if (params.generate_diff_for_temp_dir && temp_dir_path) {
650+
651+
if (temp_dir_path) {
652652
try {
653-
const diff_markdown = await generate_diff_markdown(
654-
temp_dir_path,
655-
file_mappings
656-
)
657-
current_agent_output = diff_markdown.trim()
658-
} catch (e) {
659-
Logger.error({
660-
function_name: 'invoke_agentic_cli',
661-
message: 'Failed to generate diff',
662-
data: e
653+
await fs.promises.rm(temp_dir_path, {
654+
recursive: true,
655+
force: true
663656
})
657+
} catch {
658+
// Ignore
664659
}
665660
}
666661

@@ -673,16 +668,7 @@ export const invoke_agentic_cli = async (params: {
673668
// Ignore
674669
}
675670

676-
return {
677-
agent_output: current_agent_output,
678-
selected_root: selected_root!,
679-
cli_configuration_details: selected_agent_info
680-
? {
681-
agent: selected_agent_info.label,
682-
flags: flags_string
683-
}
684-
: undefined
685-
}
671+
return undefined
686672
}
687673

688674
const initial_invocation_count = params.invocation_count || 1

0 commit comments

Comments
 (0)