Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/prune-bash-output.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@kilocode/cli": minor
---

Support task-aware pruning of agent-invoked Bash output with experimental SWE-Pruner.
46 changes: 26 additions & 20 deletions packages/kilo-ui/src/components/message-part.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2217,6 +2217,7 @@ ToolRegistry.register({
name: "bash",
render(props) {
const i18n = useI18n()
const pruned = createMemo(() => swePruned(props.metadata))
const pending = () => busy(props.status)
const reveal = useToolReveal(pending, () => props.reveal !== false)
const subtitle = () => props.input.description ?? props.metadata.description
Expand All @@ -2242,28 +2243,33 @@ ToolRegistry.register({
const out = createMemo(() => processCarriageReturns(stripAnsi(rawOutput())))

return (
<BasicTool
{...props}
icon="console"
hasDetails
defaultOpen={props.defaultOpen ?? true}
onOpenChange={setOpen}
allowPendingToggle
trigger={
<div data-slot="basic-tool-tool-info-structured">
<div data-slot="basic-tool-tool-info-main">
<span data-slot="basic-tool-tool-title">
<TextShimmer text={i18n.t("ui.tool.shell")} active={pending()} />
</span>
<Show when={subtitle()}>{(text) => <ShellText text={text()} animate={reveal()} />}</Show>
<>
<BasicTool
{...props}
icon="console"
hasDetails
defaultOpen={props.defaultOpen ?? true}
onOpenChange={setOpen}
allowPendingToggle
trigger={
<div data-slot="basic-tool-tool-info-structured">
<div data-slot="basic-tool-tool-info-main">
<span data-slot="basic-tool-tool-title">
<TextShimmer text={i18n.t("ui.tool.shell")} active={pending()} />
</span>
<Show when={subtitle()}>{(text) => <ShellText text={text()} animate={reveal()} />}</Show>
</div>
</div>
</div>
}
>
<Show when={mounted()}>
<BashHighlightedOutput cmd={cmd()} output={out()} outputPath={props.metadata.outputPath} active={open()} />
}
>
<Show when={mounted()}>
<BashHighlightedOutput cmd={cmd()} output={out()} outputPath={props.metadata.outputPath} active={open()} />
</Show>
</BasicTool>
<Show when={pruned()}>
{(info) => <ToolLoadedFile text={i18n.t("ui.tool.swePruned", info())} animate={props.reveal} />}
</Show>
</BasicTool>
</>
)
},
})
Expand Down
5 changes: 5 additions & 0 deletions packages/kilo-vscode/tests/unit/kilo-ui-contract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,11 @@ describe("Bash tool static terminal preview (source)", () => {
it("bash tool passes outputPath from metadata to BashHighlightedOutput", () => {
expect(block).toContain("props.metadata.outputPath")
})

it("bash tool shows the SWE-Pruner kept-lines indicator", () => {
expect(block).toContain("swePruned(props.metadata)")
expect(block).toContain('i18n.t("ui.tool.swePruned"')
})
})

describe("Expanded tool motion and typography (source)", () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/kilo-vscode/webview-ui/src/i18n/ar.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/kilo-vscode/webview-ui/src/i18n/br.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/kilo-vscode/webview-ui/src/i18n/bs.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/kilo-vscode/webview-ui/src/i18n/da.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/kilo-vscode/webview-ui/src/i18n/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1483,7 +1483,7 @@ export const dict = {
"Zusätzliche Dateisystempfade, in die die Sandbox Schreibvorgänge erlaubt (z. B. /tmp, /var/log). Diese werden mit den Standard-Schreibpfaden zusammengeführt, wenn die Sandbox aktiv ist.",
"settings.experimental.swePruner.title": "SWE-Pruner",
"settings.experimental.swePruner.description":
"SWE-Pruner aktivieren: aufgabenbezogenes Kürzen großer Lese- und Suchausgaben, gesteuert durch eine Fokusfrage des Agenten",
"SWE-Pruner aktivieren: aufgabenbewusstes Kürzen großer Ausgaben der Lese-, Such- und Shell-Werkzeuge, gesteuert durch eine vom Agenten bereitgestellte Fokusfrage",
"settings.experimental.swePrunerModel.title": "SWE-Pruner-Modell",
"settings.experimental.swePrunerModel.description":
"Modell zum Kürzen von Tool-Ausgaben; standardmäßig das konfigurierte Small Model",
Expand Down
2 changes: 1 addition & 1 deletion packages/kilo-vscode/webview-ui/src/i18n/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1437,7 +1437,7 @@ export const dict = {
"Extra filesystem paths the sandbox allows writes to (e.g. /tmp, /var/log). These are merged with the default writable paths when the sandbox is active.",
"settings.experimental.swePruner.title": "SWE-Pruner",
"settings.experimental.swePruner.description":
"Enable SWE-Pruner: task-aware pruning of large read and search tool outputs, guided by a focus question from the agent",
"Enable SWE-Pruner: task-aware pruning of large read, search, and shell tool outputs, guided by a focus question from the agent",
"settings.experimental.swePrunerModel.title": "SWE-Pruner Model",
"settings.experimental.swePrunerModel.description":
"Model used to skim tool outputs; defaults to the configured small model",
Expand Down
2 changes: 1 addition & 1 deletion packages/kilo-vscode/webview-ui/src/i18n/es.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/kilo-vscode/webview-ui/src/i18n/fr.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/kilo-vscode/webview-ui/src/i18n/it.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/kilo-vscode/webview-ui/src/i18n/ja.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/kilo-vscode/webview-ui/src/i18n/ko.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/kilo-vscode/webview-ui/src/i18n/nl.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/kilo-vscode/webview-ui/src/i18n/no.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/kilo-vscode/webview-ui/src/i18n/pl.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/kilo-vscode/webview-ui/src/i18n/ru.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/kilo-vscode/webview-ui/src/i18n/th.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/kilo-vscode/webview-ui/src/i18n/tr.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading