agent-relay-orchestrator 0.85.0 → 0.86.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-relay-orchestrator",
3
- "version": "0.85.0",
3
+ "version": "0.86.0",
4
4
  "description": "Agent Relay orchestrator — manages agent lifecycle across hosts",
5
5
  "type": "module",
6
6
  "bin": {
@@ -16,7 +16,7 @@
16
16
  "test": "bun test"
17
17
  },
18
18
  "dependencies": {
19
- "agent-relay-sdk": "0.2.65"
19
+ "agent-relay-sdk": "0.2.66"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@types/bun": "latest",
@@ -438,8 +438,13 @@ function syncLocalBaseToUpstream(
438
438
  const upstreamSha = git(["rev-parse", "--verify", upstream], worktreePath).stdout;
439
439
  if (!upstreamSha) return { ok: false, error: `cannot resolve ${upstream} to sync ${base}` };
440
440
  const baseWorktree = worktreeForBranch(repoRoot, base);
441
- if (baseWorktree) {
442
- if (baseWorktree.dirty) return { ok: false, error: `base branch '${base}' has uncommitted changes in ${baseWorktree.path}; cannot sync to ${upstream}` };
441
+ // Sync IN the base worktree only when it's clean — that keeps its working tree consistent
442
+ // with the advanced ref (the pristine home-repo checkout). When the base worktree is dirty
443
+ // (#644: a human's WIP in the shared checkout) we must NOT refuse and stall the whole repo's
444
+ // lands: advance the ref directly with update-ref instead. This is immune to the checkout's
445
+ // state and never reads or writes the human's working tree — their uncommitted work is left
446
+ // exactly as-is (the ref moves underneath; their files on disk are untouched).
447
+ if (baseWorktree && !baseWorktree.dirty) {
443
448
  const ff = git(["merge", "--ff-only", upstream], baseWorktree.path);
444
449
  if (!ff.ok) return { ok: false, error: ff.stderr || `failed to fast-forward ${base} to ${upstream}` };
445
450
  return { ok: true };
@@ -503,13 +508,16 @@ function mergeRebaseFf(
503
508
  const behind = countBehind(worktreePath, base);
504
509
 
505
510
  // Advance base. `baseTip` is base's new tip after the land: it equals headSha on a
506
- // clean fast-forward, or the merge commit on a no-ff merge. If base is checked out
507
- // somewhere, operate in that worktree so its working tree stays consistent; otherwise
508
- // move/synthesize the ref directly. Refuse if the base worktree has uncommitted changes.
511
+ // clean fast-forward, or the merge commit on a no-ff merge. Operate IN the base worktree
512
+ // only when it exists AND is clean — that keeps its working tree consistent with the
513
+ // advanced ref (the pristine home-repo checkout). When the base worktree is dirty
514
+ // (#644: a human's WIP in the shared checkout) we must NOT refuse and stall every lane's
515
+ // land: fall through to ref-plumbing (update-ref / synthesized no-ff merge) below, which
516
+ // advances refs/heads/<base> without reading or touching that working tree. The human's
517
+ // uncommitted work is left exactly as-is — the ref moves underneath, their files untouched.
509
518
  let baseTip = headSha;
510
519
  const baseWorktree = worktreeForBranch(repoRoot, base);
511
- if (baseWorktree) {
512
- if (baseWorktree.dirty) return head({ status: "review_requested", error: `base branch '${base}' has uncommitted changes in ${baseWorktree.path}` });
520
+ if (baseWorktree && !baseWorktree.dirty) {
513
521
  if (behind === 0) {
514
522
  const ff = git(["merge", "--ff-only", branch], baseWorktree.path);
515
523
  if (!ff.ok) return head({ status: "review_requested", error: ff.stderr || "fast-forward into base failed" });