Skip to content

feat(agent): make multi-repository tasks resumable - #4003

Merged
trunk-io[bot] merged 4 commits into
mainfrom
posthog-code/fix-sibling-repo-resume-branch
Jul 31, 2026
Merged

feat(agent): make multi-repository tasks resumable#4003
trunk-io[bot] merged 4 commits into
mainfrom
posthog-code/fix-sibling-repo-resume-branch

Conversation

@tatoalo

@tatoalo tatoalo commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Problem

Cloud tasks may work across several repositories and branches, while the durable resume checkpoint previously represented only the primary repository.

Why: Multi-repository tasks should resume safely even when a workspace snapshot is unavailable or a feature branch has been deleted remotely.

Changes

  • Keep task branch metadata scoped to the primary repository.
  • Persist a versioned checkpoint manifest for every repository in the workspace.
  • Recreate missing sibling clones and restore their committed, staged, unstaged, and untracked state.
  • Keep the primary checkpoint fields compatible with older agents and report incomplete restores honestly.

Created with PostHog Code

Only persist signed-commit branch metadata when the commit targets the task repository. This prevents a branch created in a sibling clone from breaking subsequent task resumption.

Generated-By: PostHog Code
Task-Id: 3721ab47-bf20-4d0a-b474-8a622badccd2
@trunk-io

trunk-io Bot commented Jul 30, 2026

Copy link
Copy Markdown

😎 Merged successfully - details.

@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit fad940a.

Generated-By: PostHog Code
Task-Id: 3721ab47-bf20-4d0a-b474-8a622badccd2
@tatoalo tatoalo changed the title fix(agent): keep sibling PR branches out of task resume state feat(agent): make multi-repository tasks resumable Jul 30, 2026
Comment thread packages/agent/src/handoff-checkpoint.ts Fixed
Comment thread packages/agent/src/handoff-checkpoint.ts Fixed
Remove the multi-repository Git checkpoint implementation. Cloud-to-cloud resume restores the sandbox directory snapshot; Git handoff state remains unchanged.

Generated-By: PostHog Code
Task-Id: 3721ab47-bf20-4d0a-b474-8a622badccd2
@tatoalo tatoalo self-assigned this Jul 30, 2026
@tatoalo
tatoalo marked this pull request as ready for review July 30, 2026 16:55
@tatoalo
tatoalo requested a review from a team July 30, 2026 16:56
Comment thread packages/agent/src/adapters/signed-commit-shared.ts
@greptile-apps

greptile-apps Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor
Prompt To Fix All With AI
### Issue 1
packages/agent/src/adapters/signed-commit-shared.ts:187
**Primary branch reporting uses path identity**

When an explicit tool `cwd` such as `.` resolves to the primary checkout but the session cwd has a different equivalent representation, the strict string comparison suppresses `reportTaskRunBranch`, causing a later resume to use the wrong or missing branch.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "revert(agent): keep cloud resume snapsho..." | Re-trigger Greptile

Generated-By: PostHog Code
Task-Id: 3721ab47-bf20-4d0a-b474-8a622badccd2
@trunk-io
trunk-io Bot merged commit e6e95ea into main Jul 31, 2026
34 checks passed
@trunk-io
trunk-io Bot deleted the posthog-code/fix-sibling-repo-resume-branch branch July 31, 2026 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants