opencode icon indicating copy to clipboard operation
opencode copied to clipboard

implement the includeCoAuthoredBy option

Open CodinCat opened this issue 5 months ago • 1 comments

let me know if you want to merge this. I'll resolve the conflicts and feel free to just close this PR if you don't want this to be added.


fix #919

Add the include_co_authored_by option. The behavior is copied from Claude Code.

When it's true (default) the prompt remains unchanged. I copied the original prompt and verified it with a temporary test:

test("bash.txt", () => {
  const bashTxtPath = join(process.cwd(), "packages/opencode/src/tool/bash-backup.txt")
  const currentContent = readFileSync(bashTxtPath, "utf-8")
  expect(replaceCoAuthoredMessage()).toBe(currentContent)
})

And this is how the three places look when it's false. This should be the same as Claude Code:

1 commit 1

2 commit 2

3 commit 3


actual usage:

true: true

false: false

CodinCat avatar Jul 28 '25 09:07 CodinCat

Can confirm this works nicely, thanks!

An alternative implementation which leverages no custom templating system and instead opts in for using mustache: https://github.com/sst/opencode/pull/1430

samholmes avatar Aug 13 '25 18:08 samholmes