Skip to content

fix(workspace): defer installs and make dependency cleanup visible - #398

Open
lastobelus wants to merge 8 commits into
lastcode/mainfrom
lastcode/lazy-worktree-dependencies
Open

lastobelus wants to merge 8 commits into
lastcode/mainfrom
lastcode/lazy-worktree-dependencies

Conversation

@lastobelus

@lastobelus lastobelus commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

New worktrees attempted an eager install before their environment setup, and cleanup reports omitted dependency removals. This keeps setup cheap, adds managed on-demand preparation before CI, and reports dependency outcomes and estimated reclaimed sizes. The setup and preparation launchers resolve helper paths inside Node and sequence CI without shell-specific expansion or chaining. Preparation reads the target checkout's exact pnpm version pin and lockfile, including on older branches.

Dependency cleanup now includes configured and previous worktree folders, including symlinked parent folders. Worktree symlinks are still refused, and shared ownership and active-work guards use the canonical location. Reports keep the existing three wire categories and describe dependencies through optional open resource detail and explicit reasons, so existing clients can read them. Aggregate recovery figures remain labeled as estimates even when individual report entries are capped. Provider protection refreshes when ownership changes, ignores stale persisted sessions, and retains live or unfinished runtimes even when attachment persistence failed. Thread inactivity rules and the existing safety checks remain in place.

Validation: focused cleanup/dependency regression tests, provider lifecycle tests, dependency-free bootstrap tests, scoped server/web/contracts type checks, and targeted lint passed. An isolated browser pass verified that a dependency-only rule enables Delete now, reports the removal, and preserves the worktree and tracked source.

The declared launchers were also exercised through zsh with paths containing spaces and preparation/CI failure propagation. The report fix passed 306 cleanup/settings tests, including historical report decoding and unknown resource details, targeted lint, and exact-head Quick CI. The isolated browser pass was repeated with the actual dependency-removal response. A PowerShell process was unavailable for local Windows execution.

Before: dependency-only cleanup disabled the manual button. After: it is available and the removal is reported.

Before After
Dependency-only cleanup unavailable Dependency removal reported

The aggregate estimate label after the review fixes:

Estimated cleanup recovery

Implemented with GPT-6.1-Sol through the Codex harness.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T09:52:15.539715Z e8c77c3 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 89f7ac2df3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/server/src/storageCleanup.ts
Comment thread apps/web/src/components/settings/StorageSettings.tsx Outdated
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f1578c5569

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread t3.json Outdated
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 338b9b383e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/prepare-dependencies.ts Outdated
@lastobelus
lastobelus force-pushed the lastcode/lazy-worktree-dependencies branch from 338b9b3 to 68c29f1 Compare October 12, 2026 06:04
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 68c29f1fac

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/lastcode/release.md Outdated
@lastobelus
lastobelus force-pushed the lastcode/main branch 2 times, most recently from 2e3cdfe to 4001050 Compare October 12, 2026 08:33
@lastobelus
lastobelus force-pushed the lastcode/lazy-worktree-dependencies branch from 68c29f1 to e8c77c3 Compare October 12, 2026 09:46
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e8c77c3b5c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/contracts/src/settings.ts Outdated

export const StorageCleanupReportEntry = Schema.Struct({
kind: Schema.Literals(["worktree", "browser-artifacts", "logs"]),
kind: Schema.Literals(["worktree", "dependencies", "browser-artifacts", "logs"]),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep cleanup report kinds forward-compatible

When an older web, desktop, or mobile client connects to an updated remote server and dependency cleanup emits this new "dependencies" value, that client's strict three-literal schema rejects the entire server.getStorageCleanupReport subscription or cleanup-run response. The existing storageCleanupRun capability does not distinguish this response version, so version-skewed clients can report cleanup as failed even though it ran; preserve an older wire representation or add versioned capability/response handling before emitting the new literal.

AGENTS.md reference: AGENTS.md:L73-L75

Useful? React with 👍 / 👎.

Keep worktree creation dependency-free, and run locked installation through a managed Action before dependency-backed work.

Carry-Group: build-ci

Carry-Observation: Setup links environment files; preparation intentionally does not attest to the integrity of every existing package file.
Include dependency outcomes and size estimates, cover configured managed folders, and refresh live provider ownership without losing unfinished shutdown protection.

Carry-Group: incubator

Carry-Observation: The cleanup report, provider ownership guard, and removal eligibility are one Maintenance behavior; keep their validation together.
Use the repository test runner and the Action reporting convention so dependency preparation is covered by the standard CI suites.

Carry-Group: build-ci
Canonicalize dependency ownership and active-work guards while rejecting worktree symlinks and changed locations. Keep aggregate recovery labeled as an estimate even when report entries are truncated.

Carry-Group: incubator
Resolve the primary helper inside Node while preserving the target checkout and child exit status. Sequence dependency preparation and CI without shell-specific command chaining.

Carry-Group: build-ci
Read and validate the target manifest’s exact pnpm version before its frozen-lockfile install. Older checkout pins no longer inherit the primary checkout’s version requirement.

Carry-Group: build-ci
Describe the target manifest’s pnpm version requirement when preparing older worktrees.

Carry-Group: build-ci
…ents

Report dependencies as worktree content with optional open-ended resource detail and explicit reasons. Older report readers keep the existing categories, while current clients show dependency labels and estimates.

Carry-Group: incubator
@lastobelus
lastobelus force-pushed the lastcode/lazy-worktree-dependencies branch from e8c77c3 to a3610ac Compare October 12, 2026 12:40
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