diff --git a/src/components/GitStatusIndicator.tsx b/src/components/GitStatusIndicator.tsx index 515ca55d6..f6b3d3472 100644 --- a/src/components/GitStatusIndicator.tsx +++ b/src/components/GitStatusIndicator.tsx @@ -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" diff --git a/src/services/tools/bash.test.ts b/src/services/tools/bash.test.ts index e7d345b1e..8117e9933 100644 --- a/src/services/tools/bash.test.ts +++ b/src/services/tools/bash.test.ts @@ -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 diff --git a/src/services/tools/bash.ts b/src/services/tools/bash.ts index cb90960d0..9e2ea7bcf 100644 --- a/src/services/tools/bash.ts +++ b/src/services/tools/bash.ts @@ -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}`;