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: 3 additions & 2 deletions src/components/GitStatusIndicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,9 @@ if [ "$CURRENT_BRANCH" != "$PRIMARY_BRANCH" ] && git rev-parse --verify "origin/
REFS="$REFS origin/$CURRENT_BRANCH"
fi

# Store show-branch output to avoid running twice
SHOW_BRANCH=$(git show-branch --sha1-name $REFS)
# Store show-branch output (limit to 50 commits for display)
# --more=50 limits to 50 commits after the merge base
SHOW_BRANCH=$(git show-branch --sha1-name --more=50 $REFS)

# Output show-branch
echo "$SHOW_BRANCH"
Expand Down
10 changes: 5 additions & 5 deletions src/services/tools/bash.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,15 @@ describe("bash tool", () => {
if (!result.success) {
// Should contain truncation notice
expect(result.error).toContain("[OUTPUT TRUNCATED");
expect(result.error).toContain("Showing first 50 of");
expect(result.error).toContain("Showing first 80 of");
expect(result.error).toContain("lines:");

// Should contain first 50 lines
// Should contain first 80 lines
expect(result.error).toContain("line1");
expect(result.error).toContain("line50");
expect(result.error).toContain("line80");

// Should NOT contain line 51 or beyond
expect(result.error).not.toContain("line51");
// Should NOT contain line 81 or beyond
expect(result.error).not.toContain("line81");
expect(result.error).not.toContain("line100");

// Should NOT create temp file
Expand Down
4 changes: 2 additions & 2 deletions src/services/tools/bash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ export const createBashTool: ToolFactory = (config: ToolConfiguration) => {
const overflowPolicy = config.overflow_policy ?? "tmpfile";

if (overflowPolicy === "truncate") {
// Return truncated output with first 50 lines
const maxTruncateLines = 50;
// Return truncated output with first 80 lines
const maxTruncateLines = 80;
const truncatedLines = lines.slice(0, maxTruncateLines);
const truncatedOutput = truncatedLines.join("\n");
const errorMessage = `[OUTPUT TRUNCATED - ${overflowReason ?? "unknown reason"}]\n\nShowing first ${maxTruncateLines} of ${lines.length} lines:\n\n${truncatedOutput}`;
Expand Down