Skip to content
This repository was archived by the owner on Mar 15, 2026. It is now read-only.

Chore: Refactoring#6

Merged
manuelkiessling merged 4 commits intomainfrom
chore/refactoring
Feb 26, 2026
Merged

Chore: Refactoring#6
manuelkiessling merged 4 commits intomainfrom
chore/refactoring

Conversation

@manuelkiessling
Copy link
Member

@manuelkiessling manuelkiessling commented Feb 26, 2026

Note

Medium Risk
Touches workflow run-claim lifecycles and workspace acquisition/removal paths; mistakes could cause stuck/duplicated runs or unintended workspace cleanup behavior. Mostly refactoring with added interfaces/tests, but it affects operationally sensitive agent execution and filesystem/container handling.

Overview
Refactors workflow run concurrency and phase start logic by introducing executeWithRunClaim() (wraps start/run/release) and PhaseRunStarter (wraps claim creation + label application), then wiring Planning/Implementation executors/starters to use these helpers.

Modularizes LLM CLI integration by extracting interfaces for workspace runtime preparation and Cursor CLI config writing, moving Cursor/Claude runtime-copy logic into dedicated preparator services, and updating AgentStreamParser to delegate per-line handling to a new NdjsonStreamLineParser/DTO.

Decouples workspace management via interfaces (WorkspaceAcquisitionInterface, ProjectContainerManagerInterface, WorkspaceMetadataManagerInterface, WorkspaceRemovalInterface) and routes workspace deletion through a new WorkspaceRemover, with WorkspaceManagementFacade/cleanup/lookup/sweep services updated accordingly and tests adjusted/added.

Written by Cursor Bugbot for commit bc32fa7. This will update automatically on new commits. Configure here.

@manuelkiessling manuelkiessling self-assigned this Feb 26, 2026
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Free Tier Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

}

return 1;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated file-copy and atomic-swap logic across preparators

Medium Severity

CursorWorkspaceRuntimePreparator and ClaudeCodeWorkspaceRuntimePreparator contain identical copies of copyPathRecursive (~63 lines), mirrorDirectoryContents (~30 lines), and the atomic-swap pattern inside prepare (~40 lines). This refactoring introduced two new classes that share roughly 130 lines of duplicated logic. A shared base class or utility could hold the common file-mirroring and atomic-swap behavior, reducing maintenance burden and the risk of inconsistent bug fixes across the two implementations.

Additional Locations (2)

Fix in Cursor Fix in Web

'version' => 1,
'editor' => ['vimMode' => false],
'permissions' => [
'allow' => [
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Public method writeCliConfigTo is now dead code

Low Severity

The public method writeCliConfigTo on CursorCliBinaryManager is now unused. Previously it was called by ensureCliConfig and indirectly by prepareWorkspaceRuntime. Both callers were changed in this refactoring: ensureCliConfig now calls $this->configWriter->writeTo(...) directly, and prepareWorkspaceRuntime delegates to the runtimePreparator which also calls the config writer directly. A grep confirms zero callers remain for writeCliConfigTo.

Fix in Cursor Fix in Web

@manuelkiessling manuelkiessling merged commit d55485f into main Feb 26, 2026
7 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant