Weird committing behavior that returns commit_analysis instead of committing the changes #2867

Open
opened 2026-02-16 17:37:36 -05:00 by yindo · 6 comments
Owner

Originally created by @emincangencer on GitHub (Nov 14, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

From the words "commit it" "commit" and sometimes even with "commit the changes" opencode tends to return commit_analysis. It shouldn't need for me to clarify it's a command for it to run.

It also tends to run git status, git diff --staged etc. etc. even though I have ran a sub agent which sent the change details and commit messages.

`

Conversation History


User (2025-11-14 19:30:46)

run diff reviewer


Assistant (2025-11-14 19:30:48)

[Tool: task]


Assistant (2025-11-14 19:31:07)

Staged changes add Prettier and ESLint configs for code quality. No issues detected. Ready to commit.

Suggested message:
feat: add Prettier and ESLint configurations for code quality

  • Add .prettierrc with Svelte and Tailwind plugins
  • Add .prettierignore to exclude lock files and static assets
  • Update bun.lock with new dependencies

Run bun run lint after committing to verify.


User (2025-11-14 19:31:51)

commit it


Assistant (2025-11-14 19:31:52)

<commit_analysis>

  • Files changed: .prettierrc, .prettierignore, bun.lock
  • Nature of changes: Addition of configuration files for code formatting (Prettier) and linting (ESLint), plus updated package lock file
  • Purpose: Improve code quality, consistency, and maintainability in the SvelteKit project by enforcing formatting and catching potential issues
  • Impact: Non-breaking, enhances development workflow without affecting runtime functionality
  • Sensitive info: None
  • Draft message: feat: add Prettier and ESLint configurations for code quality
    </commit_analysis>

User (2025-11-14 19:32:05)

wtf is this?


Assistant (2025-11-14 19:32:06)

[Tool: bash]


Assistant (2025-11-14 19:32:10)

[Tool: bash]

[Tool: bash]


Assistant (2025-11-14 19:32:14)

<commit_analysis>

  • Files changed: .prettierignore, .prettierrc, bun.lock, eslint.config.js, package.json, src/app.css, src/app.d.ts, src/hooks.server.ts, src/lib/auth.ts, src/lib/client.ts, src/lib/components/Footer.svelte, src/lib/components/Header.svelte, src/lib/components/ThemeToggle.svelte, src/lib/server/db/schema.ts, src/lib/stores/theme.ts, src/routes/+error.svelte, src/routes/+layout.svelte, src/routes/+page.svelte, src/routes/api/auth/[...all]/+server.ts, src/routes/contact/+page.svelte, src/routes/dashboard/+page.server.ts, src/routes/dashboard/+page.svelte, src/routes/signin/+page.server.ts, src/routes/signin/+page.svelte, svelte.config.js
  • Nature of changes: Addition of code formatting and linting tools (Prettier, ESLint), updates to dependencies, and extensive refactoring of components, routes, and configuration files for improved design, accessibility, security, and code quality
  • Purpose: Enhance the SvelteKit application with modern development tools, improve accessibility compliance (WCAG 2.1 AA), strengthen security measures, and refactor UI components for better user experience and maintainability
  • Impact: Major improvements to development workflow, code consistency, accessibility, and security without breaking existing functionality
  • Sensitive info: None
  • Draft message: feat: add code quality tools and refactor for accessibility and security
    </commit_analysis>

User (2025-11-14 19:32:51)

bro. use commit -m


Assistant (2025-11-14 19:32:53)

[Tool: bash]


Assistant (2025-11-14 19:32:55)

[Tool: bash]


Assistant (2025-11-14 19:33:09)

Committed successfully. Linting passed - all files formatted correctly.


User (2025-11-14 19:33:12)

Why did you give <commit_analysis etc.? I want to know.


Assistant (2025-11-14 19:33:13)

The <commit_analysis> block is an internal tool I use to analyze staged changes before committing, following project guidelines. It helps draft appropriate commit messages by summarizing file changes, purpose, and impact. I apologize if it appeared confusing - it's not meant for user output but was included by mistake. The commit was successful with the message "feat: add code quality tools and refactor for accessibility and security".

`

OpenCode version

0.15.31

Steps to reproduce

  1. Ask for it to commit.

Screenshot and/or share link

No response

Operating System

No response

Terminal

alacritty

Originally created by @emincangencer on GitHub (Nov 14, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description From the words "commit it" "commit" and sometimes even with "commit the changes" opencode tends to return commit_analysis. It shouldn't need for me to clarify it's a command for it to run. It also tends to run git status, git diff --staged etc. etc. even though I have ran a sub agent which sent the change details and commit messages. ` # Conversation History --- **User** (*2025-11-14 19:30:46*) run diff reviewer --- **Assistant** (*2025-11-14 19:30:48*) [Tool: task] --- **Assistant** (*2025-11-14 19:31:07*) Staged changes add Prettier and ESLint configs for code quality. No issues detected. Ready to commit. Suggested message: `feat: add Prettier and ESLint configurations for code quality` - Add .prettierrc with Svelte and Tailwind plugins - Add .prettierignore to exclude lock files and static assets - Update bun.lock with new dependencies Run `bun run lint` after committing to verify. --- **User** (*2025-11-14 19:31:51*) commit it --- **Assistant** (*2025-11-14 19:31:52*) <commit_analysis> - Files changed: .prettierrc, .prettierignore, bun.lock - Nature of changes: Addition of configuration files for code formatting (Prettier) and linting (ESLint), plus updated package lock file - Purpose: Improve code quality, consistency, and maintainability in the SvelteKit project by enforcing formatting and catching potential issues - Impact: Non-breaking, enhances development workflow without affecting runtime functionality - Sensitive info: None - Draft message: feat: add Prettier and ESLint configurations for code quality </commit_analysis> --- **User** (*2025-11-14 19:32:05*) wtf is this? --- **Assistant** (*2025-11-14 19:32:06*) [Tool: bash] --- **Assistant** (*2025-11-14 19:32:10*) [Tool: bash] [Tool: bash] --- **Assistant** (*2025-11-14 19:32:14*) <commit_analysis> - Files changed: .prettierignore, .prettierrc, bun.lock, eslint.config.js, package.json, src/app.css, src/app.d.ts, src/hooks.server.ts, src/lib/auth.ts, src/lib/client.ts, src/lib/components/Footer.svelte, src/lib/components/Header.svelte, src/lib/components/ThemeToggle.svelte, src/lib/server/db/schema.ts, src/lib/stores/theme.ts, src/routes/+error.svelte, src/routes/+layout.svelte, src/routes/+page.svelte, src/routes/api/auth/[...all]/+server.ts, src/routes/contact/+page.svelte, src/routes/dashboard/+page.server.ts, src/routes/dashboard/+page.svelte, src/routes/signin/+page.server.ts, src/routes/signin/+page.svelte, svelte.config.js - Nature of changes: Addition of code formatting and linting tools (Prettier, ESLint), updates to dependencies, and extensive refactoring of components, routes, and configuration files for improved design, accessibility, security, and code quality - Purpose: Enhance the SvelteKit application with modern development tools, improve accessibility compliance (WCAG 2.1 AA), strengthen security measures, and refactor UI components for better user experience and maintainability - Impact: Major improvements to development workflow, code consistency, accessibility, and security without breaking existing functionality - Sensitive info: None - Draft message: feat: add code quality tools and refactor for accessibility and security </commit_analysis> --- **User** (*2025-11-14 19:32:51*) bro. use commit -m --- **Assistant** (*2025-11-14 19:32:53*) [Tool: bash] --- **Assistant** (*2025-11-14 19:32:55*) [Tool: bash] --- **Assistant** (*2025-11-14 19:33:09*) Committed successfully. Linting passed - all files formatted correctly. --- **User** (*2025-11-14 19:33:12*) Why did you give <commit_analysis etc.? I want to know. --- **Assistant** (*2025-11-14 19:33:13*) The `<commit_analysis>` block is an internal tool I use to analyze staged changes before committing, following project guidelines. It helps draft appropriate commit messages by summarizing file changes, purpose, and impact. I apologize if it appeared confusing - it's not meant for user output but was included by mistake. The commit was successful with the message "feat: add code quality tools and refactor for accessibility and security". ` ### OpenCode version 0.15.31 ### Steps to reproduce 1. Ask for it to commit. ### Screenshot and/or share link _No response_ ### Operating System _No response_ ### Terminal alacritty
yindo added the model-problem label 2026-02-16 17:37:36 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 14, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #2437: Similar commit functionality problems where OpenCode hangs during commit requests
  • #786: Related commit behavior issues involving automatic git commits and co-authoring

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Nov 14, 2025): This issue might be a duplicate of existing issues. Please check: - #2437: Similar commit functionality problems where OpenCode hangs during commit requests - #786: Related commit behavior issues involving automatic git commits and co-authoring Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Nov 14, 2025):

Lol what model did that?

@rekram1-node commented on GitHub (Nov 14, 2025): Lol what model did that?
Author
Owner

@emincangencer commented on GitHub (Nov 14, 2025):

Lol what model did that?

Grok code fast 1.

@emincangencer commented on GitHub (Nov 14, 2025): > Lol what model did that? Grok code fast 1.
Author
Owner

@rekram1-node commented on GitHub (Nov 14, 2025):

Yeah I think this is just an eronius behavior from grok code, it has some interesting edges that other models dont have. We can try adjusting prompts specifically for grok code but there shouldn't be anything we set that is causing this behavior, tho we can try to mitigate it with prompting like I said

@rekram1-node commented on GitHub (Nov 14, 2025): Yeah I think this is just an eronius behavior from grok code, it has some interesting edges that other models dont have. We can try adjusting prompts specifically for grok code but there shouldn't be anything we set that is causing this behavior, tho we can try to mitigate it with prompting like I said
Author
Owner

@emincangencer commented on GitHub (Nov 15, 2025):

https://github.com/sst/opencode/blob/0d608f6014210b419f4bc4115e6db7310fcd5a8f/packages/opencode/src/tool/bash.txt#L45

Enforcing this would create unnecessary steps if user runs their own agent workflow to review the changes and setup commit analysis, like me, unless the agents clarifies that it already made similar process and models understand it. In this model's case, it doesn't.

It also tends to run git status and diff even after committing the staged changes. For example with gemini 2.5 flash, first it commits it, then runs git status. If it finds unstaged changes, it tends to commit it too by staging it and reviewing the changes. Maybe because I am lazy and give less information by just saying commit it etc., but I think focusing on context instead of predefined and static behavior like in that git related system prompt would be more beneficial.

@emincangencer commented on GitHub (Nov 15, 2025): https://github.com/sst/opencode/blob/0d608f6014210b419f4bc4115e6db7310fcd5a8f/packages/opencode/src/tool/bash.txt#L45 Enforcing this would create unnecessary steps if user runs their own agent workflow to review the changes and setup commit analysis, like me, unless the agents clarifies that it already made similar process and models understand it. In this model's case, it doesn't. It also tends to run git status and diff even after committing the staged changes. For example with gemini 2.5 flash, first it commits it, then runs git status. If it finds unstaged changes, it tends to commit it too by staging it and reviewing the changes. Maybe because I am lazy and give less information by just saying commit it etc., but I think focusing on context instead of predefined and static behavior like in that git related system prompt would be more beneficial.
Author
Owner

@rekram1-node commented on GitHub (Nov 16, 2025):

Ah I completely forgot about that block in there, i have almost never had the llm commit changes and I flip models constantly

@rekram1-node commented on GitHub (Nov 16, 2025): Ah I completely forgot about that block in there, i have almost never had the llm commit changes and I flip models constantly
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2867