Merge pull request #75 from tunnckoCore/feat/disable-coauthor-and-openclaude-pr-branding

feat: support disabling commit co-author attribution
This commit is contained in:
Kevin Codex
2026-04-02 07:51:02 +08:00
committed by GitHub
2 changed files with 15 additions and 9 deletions

View File

@@ -187,9 +187,12 @@ export OPENAI_MODEL=gpt-4o
| `CODEX_API_KEY` | Codex only | Codex/ChatGPT access token override |
| `CODEX_AUTH_JSON_PATH` | Codex only | Path to a Codex CLI `auth.json` file |
| `CODEX_HOME` | Codex only | Alternative Codex home directory (`auth.json` will be read from here) |
| `OPENCLAUDE_DISABLE_CO_AUTHORED_BY` | No | Set to `1` to suppress the default `Co-Authored-By` trailer in generated git commit messages |
You can also use `ANTHROPIC_MODEL` to override the model name. `OPENAI_MODEL` takes priority.
OpenClaude PR bodies use OpenClaude branding by default. `OPENCLAUDE_DISABLE_CO_AUTHORED_BY` only affects the commit trailer, not PR attribution text.
---
## Runtime Hardening

View File

@@ -1,11 +1,8 @@
import { feature } from 'bun:bundle'
import { stat } from 'fs/promises'
import { getClientType } from '../bootstrap/state.js'
import {
getRemoteSessionUrl,
isRemoteSessionLocal,
PRODUCT_URL,
} from '../constants/product.js'
import { getRemoteSessionUrl, isRemoteSessionLocal } from '../constants/product.js'
import { isEnvTruthy } from './envUtils.js'
import { TERMINAL_OUTPUT_TAGS } from '../constants/xml.js'
import type { AppState } from '../state/AppState.js'
import { FILE_EDIT_TOOL_NAME } from '../tools/FileEditTool/constants.js'
@@ -76,8 +73,13 @@ export function getAttributionTexts(): AttributionTexts {
isInternalModelRepoCached() || isKnownPublicModel
? getPublicModelName(model)
: 'Claude Opus 4.6'
const defaultAttribution = `🤖 Generated with [Claude Code](${PRODUCT_URL})`
const defaultCommit = `Co-Authored-By: ${modelName} <noreply@anthropic.com>`
const defaultAttribution =
'🤖 Generated with [OpenClaude](https://github.com/Gitlawb/openclaude)'
const defaultCommit = isEnvTruthy(
process.env.OPENCLAUDE_DISABLE_CO_AUTHORED_BY,
)
? ''
: `Co-Authored-By: ${modelName} <noreply@anthropic.com>`
const settings = getInitialSettings()
@@ -325,7 +327,8 @@ export async function getEnhancedPRAttribution(
return ''
}
const defaultAttribution = `🤖 Generated with [Claude Code](${PRODUCT_URL})`
const defaultAttribution =
'🤖 Generated with [OpenClaude](https://github.com/Gitlawb/openclaude)'
// Get AppState first
const appState = getAppState()
@@ -371,7 +374,7 @@ export async function getEnhancedPRAttribution(
memoryAccessCount > 0
? `, ${memoryAccessCount} ${memoryAccessCount === 1 ? 'memory' : 'memories'} recalled`
: ''
const summary = `🤖 Generated with [Claude Code](${PRODUCT_URL}) (${claudePercent}% ${promptCount}-shotted by ${shortModelName}${memSuffix})`
const summary = `🤖 Generated with [OpenClaude](https://github.com/Gitlawb/openclaude) (${claudePercent}% ${promptCount}-shotted by ${shortModelName}${memSuffix})`
// Append trailer lines for squash-merge survival. Only for allowlisted repos
// (INTERNAL_MODEL_REPOS) and only in builds with COMMIT_ATTRIBUTION enabled —