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.

test(backend): the team-session fake GitHub App has a commit identity (#1949)

0xken1530d27d4789e9
diff --git a/backend/src/lib/teamSession.test.ts b/backend/src/lib/teamSession.test.ts
index 9fa6e67cc..637a01c99 100644
--- a/backend/src/lib/teamSession.test.ts
+++ b/backend/src/lib/teamSession.test.ts
@@ -115,8 +115,10 @@ beforeEach(async () => {
app.setErrorHandler(errorHandler)
registerAuthMiddleware(app, authenticate as never)
// A GitHub App that hands out a fixed token: the route's own checks are the store's (githubAssignment). Its config is
- // what the routes sign GitHub approval states with (github/approvals.ts `stateSecret`).
- const github = { app: { config: { appId: '424242', privateKey: appKey, slug: null } },
+ // 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' })) },
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.