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:
@@ -187,9 +187,12 @@ export OPENAI_MODEL=gpt-4o
|
|||||||
| `CODEX_API_KEY` | Codex only | Codex/ChatGPT access token override |
|
| `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_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) |
|
| `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.
|
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
|
## Runtime Hardening
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
import { feature } from 'bun:bundle'
|
import { feature } from 'bun:bundle'
|
||||||
import { stat } from 'fs/promises'
|
import { stat } from 'fs/promises'
|
||||||
import { getClientType } from '../bootstrap/state.js'
|
import { getClientType } from '../bootstrap/state.js'
|
||||||
import {
|
import { getRemoteSessionUrl, isRemoteSessionLocal } from '../constants/product.js'
|
||||||
getRemoteSessionUrl,
|
import { isEnvTruthy } from './envUtils.js'
|
||||||
isRemoteSessionLocal,
|
|
||||||
PRODUCT_URL,
|
|
||||||
} from '../constants/product.js'
|
|
||||||
import { TERMINAL_OUTPUT_TAGS } from '../constants/xml.js'
|
import { TERMINAL_OUTPUT_TAGS } from '../constants/xml.js'
|
||||||
import type { AppState } from '../state/AppState.js'
|
import type { AppState } from '../state/AppState.js'
|
||||||
import { FILE_EDIT_TOOL_NAME } from '../tools/FileEditTool/constants.js'
|
import { FILE_EDIT_TOOL_NAME } from '../tools/FileEditTool/constants.js'
|
||||||
@@ -76,8 +73,13 @@ export function getAttributionTexts(): AttributionTexts {
|
|||||||
isInternalModelRepoCached() || isKnownPublicModel
|
isInternalModelRepoCached() || isKnownPublicModel
|
||||||
? getPublicModelName(model)
|
? getPublicModelName(model)
|
||||||
: 'Claude Opus 4.6'
|
: 'Claude Opus 4.6'
|
||||||
const defaultAttribution = `🤖 Generated with [Claude Code](${PRODUCT_URL})`
|
const defaultAttribution =
|
||||||
const defaultCommit = `Co-Authored-By: ${modelName} <noreply@anthropic.com>`
|
'🤖 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()
|
const settings = getInitialSettings()
|
||||||
|
|
||||||
@@ -325,7 +327,8 @@ export async function getEnhancedPRAttribution(
|
|||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultAttribution = `🤖 Generated with [Claude Code](${PRODUCT_URL})`
|
const defaultAttribution =
|
||||||
|
'🤖 Generated with [OpenClaude](https://github.com/Gitlawb/openclaude)'
|
||||||
|
|
||||||
// Get AppState first
|
// Get AppState first
|
||||||
const appState = getAppState()
|
const appState = getAppState()
|
||||||
@@ -371,7 +374,7 @@ export async function getEnhancedPRAttribution(
|
|||||||
memoryAccessCount > 0
|
memoryAccessCount > 0
|
||||||
? `, ${memoryAccessCount} ${memoryAccessCount === 1 ? 'memory' : 'memories'} recalled`
|
? `, ${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
|
// Append trailer lines for squash-merge survival. Only for allowlisted repos
|
||||||
// (INTERNAL_MODEL_REPOS) and only in builds with COMMIT_ATTRIBUTION enabled —
|
// (INTERNAL_MODEL_REPOS) and only in builds with COMMIT_ATTRIBUTION enabled —
|
||||||
|
|||||||
Reference in New Issue
Block a user