Skip to content

Commit c829c67

Browse files
fix(timeline): strip workspace path prefix from bash command previews (#3661)
* fix(timeline): strip workspace path prefix from bash command previews * Update apps/web/src/components/cloud-agent-next/BashToolCard.tsx Co-authored-by: kilo-code-bot[bot] <240665456+kilo-code-bot[bot]@users.noreply.github.com> * style: apply oxfmt formatting to BashToolCard --------- Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com> Co-authored-by: Remon Oldenbeuving <remon@kilocode.ai> Co-authored-by: kilo-code-bot[bot] <240665456+kilo-code-bot[bot]@users.noreply.github.com>
1 parent edef8a3 commit c829c67

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

apps/web/src/components/cloud-agent-next/BashToolCard.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,18 @@ type BashInput = {
1313
timeout?: number;
1414
};
1515

16+
// Replace agent workspace paths like /workspace/<uuid>/<session>/sessions/<agent-id>
17+
// with "." so truncated command previews show the actual command content.
18+
const WORKSPACE_PATH_PATTERN = /\/workspace\/[^/\s]+\/[^/\s]+\/sessions\/[^/\s]+/g;
19+
20+
function normalizeCommandForDisplay(command: string): string {
21+
return command.replace(WORKSPACE_PATH_PATTERN, '.');
22+
}
23+
1624
function getCommandPreview(command: string): string {
1725
// Get first line or first 60 chars, whichever is shorter
18-
const firstLine = command.split('\n')[0] || command;
26+
const firstLine =
27+
normalizeCommandForDisplay(command).split('\n')[0] || normalizeCommandForDisplay(command);
1928
if (firstLine.length > 60) {
2029
return firstLine.slice(0, 57) + '...';
2130
}

0 commit comments

Comments
 (0)