@saeed42/worktree-worker 1.7.1 → 1.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/main.js +17 -4
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -1115,15 +1115,18 @@ var WorktreeService = class {
1115
1115
  await gitService.addWorktreeWithNewBranch(worktreePath, branchName, baseRef, baseRepoDir);
1116
1116
  });
1117
1117
  }
1118
- await gitService.exec(["config", "--local", "user.name", "origin-agent[bot]"], worktreePath).catch(() => {
1118
+ const authorName = options.gitAuthorName || "origin-agent[bot]";
1119
+ const authorEmail = options.gitAuthorEmail || "origin-agent[bot]@users.noreply.github.com";
1120
+ await gitService.exec(["config", "--local", "user.name", authorName], worktreePath).catch(() => {
1119
1121
  });
1120
1122
  await gitService.exec([
1121
1123
  "config",
1122
1124
  "--local",
1123
1125
  "user.email",
1124
- "origin-agent[bot]@users.noreply.github.com"
1126
+ authorEmail
1125
1127
  ], worktreePath).catch(() => {
1126
1128
  });
1129
+ log.debug("Configured git user", { name: authorName, email: authorEmail });
1127
1130
  await gitService.exec(["config", "--local", "safe.directory", worktreePath], worktreePath).catch(() => {
1128
1131
  });
1129
1132
  const headSha = await gitService.getHeadShaSafe(worktreePath);
@@ -1361,8 +1364,11 @@ var resetWorktreeSchema = z2.object({
1361
1364
  force: z2.boolean().default(false),
1362
1365
  githubToken: z2.string().optional(),
1363
1366
  // Required for private repos
1364
- repoUrl: z2.string().url().optional()
1367
+ repoUrl: z2.string().url().optional(),
1365
1368
  // Required if repo not yet initialized
1369
+ // Git author for commits in this worktree
1370
+ gitAuthorName: z2.string().optional(),
1371
+ gitAuthorEmail: z2.string().email().optional()
1366
1372
  });
1367
1373
  var commitSchema = z2.object({
1368
1374
  message: z2.string().min(1),
@@ -1402,7 +1408,9 @@ worktree.post("/trials/:trialId/worktree/reset", async (c) => {
1402
1408
  trialBranch: input.trialBranch,
1403
1409
  force: input.force,
1404
1410
  githubToken: input.githubToken,
1405
- repoUrl: input.repoUrl
1411
+ repoUrl: input.repoUrl,
1412
+ gitAuthorName: input.gitAuthorName,
1413
+ gitAuthorEmail: input.gitAuthorEmail
1406
1414
  });
1407
1415
  return c.json({ success: true, data: result });
1408
1416
  } catch (err) {
@@ -1887,6 +1895,11 @@ git.post("/push", async (c) => {
1887
1895
  );
1888
1896
  }
1889
1897
  log.info("Git push successful", { branch });
1898
+ log.debug("Fetching to update tracking refs");
1899
+ const fetchResult = await gitService.exec(["fetch", "origin"], cwd);
1900
+ if (fetchResult.code !== 0) {
1901
+ log.warn("Post-push fetch failed (non-fatal)", { stderr: fetchResult.stderr });
1902
+ }
1890
1903
  return c.json({
1891
1904
  success: true,
1892
1905
  data: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saeed42/worktree-worker",
3
- "version": "1.7.1",
3
+ "version": "1.7.2",
4
4
  "description": "Git worktree management service for AI agent trials",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",