Skip to content

fix(arena): recover late git and failed cleanups - #328

Open
vikas-bottomless wants to merge 2 commits into
mainfrom
fix/late-git-cleanup-retry
Open

vikas-bottomless wants to merge 2 commits into
mainfrom
fix/late-git-cleanup-retry

Conversation

@vikas-bottomless

Copy link
Copy Markdown
Contributor

What and why

Two causes of failed battle starts. A folder opened before it had Git kept being treated as non-Git, so battles failed with WorktreeNotGitError, 11 times in a row for one user. The engine now checks for Git again and reloads the folder. Also, if cleanup of an older battle's folder failed again, the new battle was discarded. That cleanup now runs in the background and keeps retrying.

Testing

  • [automated] bun test test/arena/v2-instance-context.test.ts (opencode, Bun 1.4.4): 2 passed; the new test fails without the fix
  • [automated] bun test test/arena/stop-recovery.integration.test.ts: 16 passed, 2 failed; main fails the same 2. The new test fails without the fix. This PR adds a LocationServiceMap mock to the test file: since feat(plugins): switch project and personal instruction files #291, all of its tests fail on main without one
  • [automated] bun run typecheck in core and opencode, npm run typecheck, npm run lint, npm run format:check: pass
  • Not tested: a battle in the app; Windows and Linux

Checklist

  • "What and why" is at most 500 characters
  • npm run typecheck, npm run lint and npm run format pass
  • Screenshots or video attached for UI changes
  • I agree to the contribution licensing policy and have authority to license my contribution.

@vikas-bottomless
vikas-bottomless requested a review from a team as a code owner December 3, 2026 14:04

This branch has not been deployed

No deployments
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.

1 participant