opencode
opencode copied to clipboard
implement the includeCoAuthoredBy option
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
2
3
actual usage:
true:
false:
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