Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

GitHub App: commits by "Harness", and no "Harness for Autonomous" in the app (#2516)

scholes-autonomous78c63a84bd9d
diff --git a/backend/integration/superTabGithub.test.ts b/backend/integration/superTabGithub.test.ts
index 269409e1f..8aa464f29 100644
--- a/backend/integration/superTabGithub.test.ts
+++ b/backend/integration/superTabGithub.test.ts
@@ -187,7 +187,7 @@ describe('the GitHub token endpoint', () => {
const response = await env.app.inject({ method: 'POST', url: `/api/super-tabs/${tab}/github-token?asAgentId=${worker}`,
headers: { authorization: `Bearer ${host.sub}`, 'x-test-team': '1' }, payload: { machineId: 'gh-host' } })
expect(response.statusCode, response.body).toBe(200)
- expect(response.json().data.commitAs).toEqual({ name: 'harness-fixture[bot]', email: '4242+harness-fixture[bot]@users.noreply.github.com' })
+ expect(response.json().data.commitAs).toEqual({ name: 'Harness', email: '4242+harness-fixture[bot]@users.noreply.github.com' })
// GitHub not saying who the bot is leaves it out, and the token is still given.
const other = await fresh()
other.github.control.botId = null
diff --git a/backend/src/github/app.test.ts b/backend/src/github/app.test.ts
index 16608a56e..9f1944233 100644
--- a/backend/src/github/app.test.ts
+++ b/backend/src/github/app.test.ts
@@ -153,8 +153,8 @@ describe('installation tokens', () => {
// A Harness Team account's commits are the app's (PR #1934): its bot account, as GitHub names it.
it('names the app\'s bot account as its commit identity, reading the bot\'s id once', async () => {
const { app, github } = setup()
- expect(await app.commitIdentity()).toEqual({ name: 'harness-fixture[bot]', email: '4242+harness-fixture[bot]@users.noreply.github.com' })
- expect(await app.commitIdentity()).toEqual({ name: 'harness-fixture[bot]', email: '4242+harness-fixture[bot]@users.noreply.github.com' })
+ expect(await app.commitIdentity()).toEqual({ name: 'Harness', email: '4242+harness-fixture[bot]@users.noreply.github.com' })
+ expect(await app.commitIdentity()).toEqual({ name: 'Harness', email: '4242+harness-fixture[bot]@users.noreply.github.com' })
const asked = github.calls.filter(c => c.path.startsWith('/users/'))
expect(asked).toEqual([expect.objectContaining({ method: 'GET', path: '/users/harness-fixture%5Bbot%5D', auth: '' })])
// With no app name configured, the app's own answer names it.
@@ -163,7 +163,7 @@ describe('installation tokens', () => {
await signed.app.commitIdentity('ghs_issued')
expect(signed.github.calls.find(c => c.path.startsWith('/users/'))?.auth).toBe('Bearer ghs_issued')
const unnamed = setup({ slug: null })
- expect(await unnamed.app.commitIdentity()).toMatchObject({ name: 'harness-fixture[bot]' })
+ expect(await unnamed.app.commitIdentity()).toMatchObject({ name: 'Harness', email: '4242+harness-fixture[bot]@users.noreply.github.com' })
expect(unnamed.github.calls.map(c => c.path)).toEqual(['/app', '/users/harness-fixture%5Bbot%5D'])
})
diff --git a/backend/src/github/app.ts b/backend/src/github/app.ts
index 1f6353148..61b96c14e 100644
--- a/backend/src/github/app.ts
+++ b/backend/src/github/app.ts
@@ -49,6 +49,9 @@ export function readPrivateKey(value: string): KeyObject {
/** Both empty: the feature is off. One without the other, or a value that cannot be right, stops the backend at startup
* rather than failing the first agent that asks. */
+/** The name a Harness GitHub App's commits carry, whatever the app is called on GitHub (cli/src/lib/swarmGitHub.ts accepts it). */
+export const COMMIT_NAME = 'Harness'
+
export function githubAppConfig(env: { GITHUB_APP_ID: string; GITHUB_APP_PRIVATE_KEY: string; GITHUB_APP_SLUG: string }): GitHubAppConfig | null {
const appId = env.GITHUB_APP_ID.trim(), key = env.GITHUB_APP_PRIVATE_KEY.trim(), slug = env.GITHUB_APP_SLUG.trim()
if (!appId && !key) return null
@@ -137,7 +140,7 @@ export class GitHubApp {
}
/**
- * Who the app's commits are by: its bot account as GitHub names it (`<slug>[bot]`, `<id>+<slug>[bot]@users.noreply.github.com`),
+ * Who the app's commits are by: "Harness", at its bot account's address (`<id>+<slug>[bot]@users.noreply.github.com`),
* so a commit made with the app's token shows the app, not the made-up address of the machine account that ran git. A Harness
* Team account has no git identity of its own, so its commits read "Harness Team <harnessteam@<host>.local>", unverified and
* linked to nobody (PR #1934, 2026-10-28). Read once and kept; null while GitHub cannot say, asked again ten minutes later.
@@ -160,7 +163,9 @@ export class GitHubApp {
const user = await this.call('GET', `/users/${encodeURIComponent(login)}`, token ? `Bearer ${token}` : null)
const id = (user.body as { id?: unknown }).id
if (user.status === 200 && typeof id === 'number' && Number.isSafeInteger(id) && id > 0) {
- value = { name: login, email: `${id}+${login}@users.noreply.github.com` }
+ // Shown as "Harness" (2026-11-02: no "harness-for-autonomous[bot]"); the bot's noreply address is what links the
+ // commit to the app's account on GitHub.
+ value = { name: COMMIT_NAME, email: `${id}+${login}@users.noreply.github.com` }
} else console.warn(`[github] the app's bot account ${login} was not read: HTTP ${user.status}`)
}
} catch (error) {
diff --git a/backend/src/lib/teamSession.test.ts b/backend/src/lib/teamSession.test.ts
index 637a01c99..2befb27cf 100644
--- a/backend/src/lib/teamSession.test.ts
+++ b/backend/src/lib/teamSession.test.ts
@@ -118,7 +118,7 @@ beforeEach(async () => {
// what the routes sign GitHub approval states with (github/approvals.ts `stateSecret`), and a team session's commits
// carry the app's bot identity (github/app.ts `commitIdentity`).
const github = { app: { config: { appId: '424242', privateKey: appKey, slug: null },
- commitIdentity: vi.fn(async () => ({ name: 'harness-app[bot]', email: '424242+harness-app[bot]@users.noreply.github.com' })) },
+ commitIdentity: vi.fn(async () => ({ name: 'Harness', email: '424242+harness[bot]@users.noreply.github.com' })) },
issue: vi.fn(async () => ({ token: 'fixture-token', expiresAt: new Date(0).toISOString() })), release: vi.fn(async () => {}),
prepare: vi.fn(async () => ({ token: 'fixture-read-token', expiresAt: new Date(0).toISOString(), repository: 'example/project' })) }
// The read API by parts is recorded the same way: its classes reach the store only through it.
diff --git a/cli/src/lib/swarmGitHub.spec.ts b/cli/src/lib/swarmGitHub.spec.ts
index f53b5eb3a..895b203df 100644
--- a/cli/src/lib/swarmGitHub.spec.ts
+++ b/cli/src/lib/swarmGitHub.spec.ts
@@ -197,15 +197,19 @@ describe('a session\'s gh login and trailers', () => {
writeFileSync(join(home, '.gitconfig'), '[user]\n\tname = Owner\n\temail = [email protected]\n')
const ident = () => vars('GIT_AUTHOR_IDENT')
expect(ident()).toMatch(/^Owner <owner@example\.com> /)
- const bot = { name: 'harness-for-autonomous[bot]', email: '245891234+harness-for-autonomous[bot]@users.noreply.github.com' }
+ const bot = { name: 'Harness', email: '245891234+harness[bot]@users.noreply.github.com' }
writeSessionGitHub(dir, 'ghs_fixtureToken0000001', [], bot)
expect(statSync(join(dir, 'gitconfig')).mode & 0o777).toBe(0o600)
- expect(ident()).toMatch(/^harness-for-autonomous\[bot\] <245891234\+harness-for-autonomous\[bot\]@users\.noreply\.github\.com> /)
- expect(vars('GIT_COMMITTER_IDENT')).toMatch(/^harness-for-autonomous\[bot\] </)
+ expect(ident()).toMatch(/^Harness <245891234\+harness\[bot\]@users\.noreply\.github\.com> /)
+ expect(vars('GIT_COMMITTER_IDENT')).toMatch(/^Harness </)
+ // An older server names the app's bot account instead (2026-10-28 to 11-02): still taken.
+ writeSessionGitHub(dir, 'ghs_fixtureToken0000001', [], { name: 'harness-for-autonomous[bot]', email: '245891234+harness-for-autonomous[bot]@users.noreply.github.com' })
+ expect(ident()).toMatch(/^harness-for-autonomous\[bot\] </)
+ writeSessionGitHub(dir, 'ghs_fixtureToken0000001', [], bot)
// A refusal keeps it; an answer without one (an older server, a person's machine) or with anything else drops it.
writeSessionGitHub(dir, null)
- expect(ident()).toMatch(/^harness-for-autonomous\[bot\] </)
- for (const other of [null, { name: 'Mallory', email: '[email protected]' }, { ...bot, name: 'x[bot]\n[core]' }, 'bot']) {
+ expect(ident()).toMatch(/^Harness </)
+ for (const other of [null, { name: 'Mallory', email: '[email protected]' }, { ...bot, name: 'x[bot]\n[core]' }, { ...bot, name: 'Harness\n[core]' }, 'bot']) {
writeSessionGitHub(dir, 'ghs_fixtureToken0000001', [], bot)
writeSessionGitHub(dir, 'ghs_fixtureToken0000001', [], other)
expect(existsSync(join(dir, 'gitconfig'))).toBe(false)
diff --git a/cli/src/lib/swarmGitHub.ts b/cli/src/lib/swarmGitHub.ts
index 3282012c5..0bf4bd9a2 100644
--- a/cli/src/lib/swarmGitHub.ts
+++ b/cli/src/lib/swarmGitHub.ts
@@ -167,7 +167,8 @@ const GH_CONFIG = 'version: "1"\n'
const TOKEN = /^[A-Za-z0-9_][A-Za-z0-9_.-]{19,4095}$/
/** Who a session's commits are by, as the server names the Harness GitHub App's bot account; nothing else is written. */
-const COMMIT_NAME = /^[a-z0-9][a-z0-9-]{0,99}\[bot\]$/
+/** Who a Team account's commits are by: "Harness" (2026-11-02), or an older backend's name for the app's bot account. */
+const COMMIT_NAME = /^(?:Harness|[a-z0-9][a-z0-9-]{0,99}\[bot\])$/
const COMMIT_EMAIL = /^[0-9]{1,20}\+[a-z0-9][a-z0-9-]{0,99}\[bot\]@users\.noreply\.github\.com$/
/**
diff --git a/desktop/lib/super_tabs/project_github.dart b/desktop/lib/super_tabs/project_github.dart
index d1cc0dc14..ea0cb14ea 100644
--- a/desktop/lib/super_tabs/project_github.dart
+++ b/desktop/lib/super_tabs/project_github.dart
@@ -372,7 +372,7 @@ class _ProjectGitHubAccessState extends State<ProjectGitHubAccess>
access.state == 'not-installed'
? 'GitHub is open in your browser. Install Harness on ${_owner(repository)} there. '
'This updates by itself when you come back.'
- : 'GitHub is open in your browser. Click Authorize on the “Harness for Autonomous” page. '
+ : "GitHub is open in your browser. Click Authorize on GitHub's page. "
'This updates by itself when you come back.',
),
if (access.state == 'not-approved')
diff --git a/docs/swarm-github-app.md b/docs/swarm-github-app.md
index e5a25a0a3..86ee78de9 100644
--- a/docs/swarm-github-app.md
+++ b/docs/swarm-github-app.md
@@ -21,7 +21,7 @@ On GitHub, open the organization, then **Settings → Developer settings → Git
| Field | Value |
| --- | --- |
-| GitHub App name | A name of your choice, for example `Harness for Acme`. GitHub needs it to be unique. |
+| GitHub App name | `Harness` where it is free (GitHub needs it to be unique). Its address and its bot account follow it (`github.com/apps/harness`, `harness[bot]`): renaming the app later changes both, so set `GITHUB_APP_SLUG` again. |
| Homepage URL | `https://harness.autonomous.ai` |
| Callback URL, Setup URL | Leave empty. |
| Webhook → Active | Clear it. Harness subscribes to no events. |
@@ -216,8 +216,9 @@ address. The `commit-msg` hook adds any missing trailers to a message written in
editor. Trailers already in the message are not added again, so an amend keeps one
of each. An empty message still aborts the commit.
-In a Harness Team account, the commits themselves are by the app's bot account
-(`<app>[bot] <id+<app>[bot]@users.noreply.github.com>`), as its pull requests are: the
+In a Harness Team account, the commits themselves are by "Harness" at the app's bot
+account's address (`Harness <id+<app>[bot]@users.noreply.github.com>`), which links them
+to that account on GitHub, as its pull requests are: the
account has no git identity of its own, and its commits read `Harness Team
<harnessteam@<host>.local>` before. The token response names it as `commitAs` for a
team account only; the daemon writes it to the session's `gitconfig`, which the