Skip to content

feat: auto-overwrite stale agent binary and workspace clean command#364

Merged
skevetter merged 3 commits into
mainfrom
a4b8-stale-agent-v2
May 18, 2026
Merged

feat: auto-overwrite stale agent binary and workspace clean command#364
skevetter merged 3 commits into
mainfrom
a4b8-stale-agent-v2

Conversation

@skevetter
Copy link
Copy Markdown
Contributor

Summary

  • Option A: Auto-overwrite agent binary on version mismatch during Docker delivery. When DeliverPreStart detects a stale binary in the Docker named volume, it now force-overwrites instead of just warning. Log changed from WARN to INFO: "upgraded remote agent from vX.Y.Z → vA.B.C".
  • Option B: Add devsy workspace clean <workspace-id> subcommand that removes the agent binary from the Docker named volume, forcing fresh injection on next start.

Both changes are scoped to the Docker delivery path — non-Docker providers are unaffected.

skevetter added 2 commits May 18, 2026 17:49
When the named Docker volume already contains an agent binary with a
different version, force-overwrite it instead of leaving the stale
binary in place. Logs an INFO message with the old and new versions.
If versions match, skip re-delivery entirely as an optimization.
Adds a command to remove the agent binary from the Docker named volume
for a workspace, forcing a fresh injection on next start. Useful when
the binary becomes stale and the automatic version-mismatch detection
is not sufficient.
@netlify
Copy link
Copy Markdown

netlify Bot commented May 18, 2026

Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit ebf6a65
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6a0b9cafdca56900085bab49

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Warning

Rate limit exceeded

@skevetter has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 50 minutes and 56 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8d9f91ed-af0f-41bb-a595-597ca5a99d71

📥 Commits

Reviewing files that changed from the base of the PR and between 75069e3 and ebf6a65.

📒 Files selected for processing (5)
  • cmd/agent/workspace/clean.go
  • cmd/agent/workspace/clean_test.go
  • cmd/agent/workspace/workspace.go
  • pkg/agent/delivery/local_docker.go
  • pkg/agent/delivery/local_docker_test.go

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@skevetter skevetter changed the title feat: auto-overwrite stale agent binary + workspace clean command feat: auto-overwrite stale agent binary and workspace clean command May 18, 2026
@skevetter skevetter marked this pull request as ready for review May 18, 2026 23:48
@skevetter skevetter merged commit 76841a4 into main May 18, 2026
52 checks passed
@skevetter skevetter deleted the a4b8-stale-agent-v2 branch May 18, 2026 23:48
devsy-app Bot pushed a commit that referenced this pull request May 19, 2026
# [1.4.0-rc.1](v1.3.0...v1.4.0-rc.1) (2026-05-19)

### Bug Fixes

* **ci:** add package-lock.json for semantic-release workflow ([bcd9208](bcd9208))
* **ci:** add signed commit config and create-release-pr workflow ([c89325a](c89325a))
* **ci:** advance prerelease manifest past stable release ([#372](#372)) ([33a9d44](33a9d44))
* **ci:** pass app token via token input for softprops/action-gh-release ([#361](#361)) ([77a9373](77a9373)), closes [softprops/action-#release](https://github.com/softprops/action-/issues/release)
* **ci:** re-add changelog and git plugins with signed commit support ([#375](#375)) ([ad6e3f9](ad6e3f9))
* **ci:** remove @semantic-release/git plugin that can't push to protected branch ([c3bf35c](c3bf35c))
* **ci:** remove @semantic-release/git plugin that cannot push to signature-protected branch ([e971f37](e971f37))
* **ci:** resolve semantic-release tag conflict and add changelog+git plugins ([d80ae42](d80ae42))
* update workspace_result.json paths on workspace rename ([#369](#369)) ([f06f4ba](f06f4ba))

### Features

* auto-overwrite stale agent binary and workspace clean command ([#364](#364)) ([76841a4](76841a4))
* **ci:** enable autoMergeRequest in release-please action ([#363](#363)) ([2f889bb](2f889bb))
* **ci:** migrate from release-please to semantic-release ([#374](#374)) ([9fcceef](9fcceef))
* **ci:** replace single release-please config with dual prerelease/stable setup ([#368](#368)) ([d985356](d985356))
skevetter added a commit that referenced this pull request May 19, 2026
* fix(ci): pass app token via token input for softprops/action-gh-release (#361)

softprops/action-gh-release@v3 reads the token from INPUT_TOKEN (set by
the 'token' action input) before falling back to GITHUB_TOKEN. Setting
env.GITHUB_TOKEN did not override INPUT_TOKEN so the action used the
default GITHUB_TOKEN instead of the app-token, causing the 403.

* feat(ci): enable autoMergeRequest in release-please action (#363)

Adds autoMergeRequest: true to the googleapis/release-please-action step
so that release-please PRs auto-merge after CI passes.

* chore(main): release 1.3.0-rc.19 (#362)

Co-authored-by: devsy-app[bot] <277138668+devsy-app[bot]@users.noreply.github.com>

* feat: auto-overwrite stale agent binary and workspace clean command (#364)

* feat: auto-overwrite agent binary on version mismatch in Docker delivery

When the named Docker volume already contains an agent binary with a
different version, force-overwrite it instead of leaving the stale
binary in place. Logs an INFO message with the old and new versions.
If versions match, skip re-delivery entirely as an optimization.

* feat: add `devsy workspace clean` subcommand

Adds a command to remove the agent binary from the Docker named volume
for a workspace, forcing a fresh injection on next start. Useful when
the binary becomes stale and the automatic version-mismatch detection
is not sufficient.

* fix: extract docker command string to constant (goconst lint)

* chore(ci): tidy workflow comments (#365)

* chore(main): release 1.3.0-rc.20 (#366)

Co-authored-by: devsy-app[bot] <277138668+devsy-app[bot]@users.noreply.github.com>

* feat(ci): replace single release-please config with dual prerelease/stable setup (#368)

Split the release-please configuration into two independent tracks:
- Prerelease track (push to main): creates RC releases with auto-merge
- Stable track (workflow_dispatch): creates stable releases on demand

This eliminates the promote-release.yml workaround that re-tagged RC commits
as stable releases. Instead, release-please natively manages both version
tracks with separate configs, manifests, labels, and changelog paths.

* chore(main): release 1.3.0-rc.21 (#370)

Co-authored-by: devsy-app[bot] <277138668+devsy-app[bot]@users.noreply.github.com>

* fix(ci): advance prerelease manifest past stable release (#372)

* fix: update workspace_result.json paths on workspace rename (#369)

* fix: update workspace_result.json paths on workspace rename

After renaming a workspace, the cached workspace_result.json still
referenced the old workspace name in ContainerWorkspaceFolder,
LocalWorkspaceFolder, and WorkspaceMount paths. This caused the
container's working directory to point to /workspaces/<old-name>
which doesn't exist, breaking exec and SSH into the workspace.

* fix: also update MergedConfig.WorkspaceMount on workspace rename

Closes a gap where MergedConfig.WorkspaceMount (a *string field) was
not being rewritten during rename, leaving a stale mount path in the
cached result.

* refactor: derive workspace parent dirs dynamically in path replacer

Instead of hardcoding `/workspaces` as the container workspace parent
directory, derive it from SubstitutionContext.ContainerWorkspaceFolder
by stripping the basename. Similarly derive the host parent from
LocalWorkspaceFolder. This makes the rename path replacer work
correctly for devcontainers that use a non-default workspaceFolder.

* test: add unit tests for workspace rename path replacement

* test: add e2e tests for workspace rename path updates

Integration tests verifying that updateWorkspaceResult correctly
rewrites ContainerWorkspaceFolder, LocalWorkspaceFolder, WorkspaceMount
in SubstitutionContext and MergedConfig after a workspace rename.

Covers: basic rename, non-default workspace dirs, nested paths,
same-name idempotent rename, nil MergedConfig/WorkspaceMount, missing
result file, and raw JSON roundtrip.

* fix(lint): wire up testContainerOldWS, testLocalOldWS, testContainerApp, testContainerOld constants

Linter introduced constants but left self-referential definitions and
bare literals in test bodies. Fix init cycles and use constants throughout.

* fix(lint): extract repeated /workspaces/ws-old literal to testContainerWSMount constant

* chore(main): release 1.4.0-rc.1 (#373)

Co-authored-by: devsy-app[bot] <277138668+devsy-app[bot]@users.noreply.github.com>

* feat(ci): migrate from release-please to semantic-release (#374)

Replace the dual release-please prerelease/stable configuration with a
single semantic-release setup for simplicity.

- Add .releaserc.json with commit-analyzer, release-notes-generator,
  changelog, github, and git plugins
- Add semantic-release.yml workflow (push to main → RC, push to
  release → stable, plus dry-run workflow_dispatch)
- Remove release-please workflows, configs, and manifests
- Add semantic-release devDependencies to package.json

* fix(ci): add package-lock.json for semantic-release workflow

The semantic-release workflow uses actions/setup-node with npm caching,
which requires a lock file to be present. Also switches from npm install
to npm ci for reproducible CI builds.

---------

Co-authored-by: Samuel K <skevetter@pm.me>
Co-authored-by: devsy-app[bot] <277138668+devsy-app[bot]@users.noreply.github.com>
skevetter added a commit that referenced this pull request May 19, 2026
* fix(ci): pass app token via token input for softprops/action-gh-release (#361)

softprops/action-gh-release@v3 reads the token from INPUT_TOKEN (set by
the 'token' action input) before falling back to GITHUB_TOKEN. Setting
env.GITHUB_TOKEN did not override INPUT_TOKEN so the action used the
default GITHUB_TOKEN instead of the app-token, causing the 403.

* feat(ci): enable autoMergeRequest in release-please action (#363)

Adds autoMergeRequest: true to the googleapis/release-please-action step
so that release-please PRs auto-merge after CI passes.

* chore(main): release 1.3.0-rc.19 (#362)

Co-authored-by: devsy-app[bot] <277138668+devsy-app[bot]@users.noreply.github.com>

* feat: auto-overwrite stale agent binary and workspace clean command (#364)

* feat: auto-overwrite agent binary on version mismatch in Docker delivery

When the named Docker volume already contains an agent binary with a
different version, force-overwrite it instead of leaving the stale
binary in place. Logs an INFO message with the old and new versions.
If versions match, skip re-delivery entirely as an optimization.

* feat: add `devsy workspace clean` subcommand

Adds a command to remove the agent binary from the Docker named volume
for a workspace, forcing a fresh injection on next start. Useful when
the binary becomes stale and the automatic version-mismatch detection
is not sufficient.

* fix: extract docker command string to constant (goconst lint)

* chore(ci): tidy workflow comments (#365)

* chore(main): release 1.3.0-rc.20 (#366)

Co-authored-by: devsy-app[bot] <277138668+devsy-app[bot]@users.noreply.github.com>

* feat(ci): replace single release-please config with dual prerelease/stable setup (#368)

Split the release-please configuration into two independent tracks:
- Prerelease track (push to main): creates RC releases with auto-merge
- Stable track (workflow_dispatch): creates stable releases on demand

This eliminates the promote-release.yml workaround that re-tagged RC commits
as stable releases. Instead, release-please natively manages both version
tracks with separate configs, manifests, labels, and changelog paths.

* chore(main): release 1.3.0-rc.21 (#370)

Co-authored-by: devsy-app[bot] <277138668+devsy-app[bot]@users.noreply.github.com>

* fix(ci): advance prerelease manifest past stable release (#372)

* fix: update workspace_result.json paths on workspace rename (#369)

* fix: update workspace_result.json paths on workspace rename

After renaming a workspace, the cached workspace_result.json still
referenced the old workspace name in ContainerWorkspaceFolder,
LocalWorkspaceFolder, and WorkspaceMount paths. This caused the
container's working directory to point to /workspaces/<old-name>
which doesn't exist, breaking exec and SSH into the workspace.

* fix: also update MergedConfig.WorkspaceMount on workspace rename

Closes a gap where MergedConfig.WorkspaceMount (a *string field) was
not being rewritten during rename, leaving a stale mount path in the
cached result.

* refactor: derive workspace parent dirs dynamically in path replacer

Instead of hardcoding `/workspaces` as the container workspace parent
directory, derive it from SubstitutionContext.ContainerWorkspaceFolder
by stripping the basename. Similarly derive the host parent from
LocalWorkspaceFolder. This makes the rename path replacer work
correctly for devcontainers that use a non-default workspaceFolder.

* test: add unit tests for workspace rename path replacement

* test: add e2e tests for workspace rename path updates

Integration tests verifying that updateWorkspaceResult correctly
rewrites ContainerWorkspaceFolder, LocalWorkspaceFolder, WorkspaceMount
in SubstitutionContext and MergedConfig after a workspace rename.

Covers: basic rename, non-default workspace dirs, nested paths,
same-name idempotent rename, nil MergedConfig/WorkspaceMount, missing
result file, and raw JSON roundtrip.

* fix(lint): wire up testContainerOldWS, testLocalOldWS, testContainerApp, testContainerOld constants

Linter introduced constants but left self-referential definitions and
bare literals in test bodies. Fix init cycles and use constants throughout.

* fix(lint): extract repeated /workspaces/ws-old literal to testContainerWSMount constant

* chore(main): release 1.4.0-rc.1 (#373)

Co-authored-by: devsy-app[bot] <277138668+devsy-app[bot]@users.noreply.github.com>

* feat(ci): migrate from release-please to semantic-release (#374)

Replace the dual release-please prerelease/stable configuration with a
single semantic-release setup for simplicity.

- Add .releaserc.json with commit-analyzer, release-notes-generator,
  changelog, github, and git plugins
- Add semantic-release.yml workflow (push to main → RC, push to
  release → stable, plus dry-run workflow_dispatch)
- Remove release-please workflows, configs, and manifests
- Add semantic-release devDependencies to package.json

* fix(ci): add package-lock.json for semantic-release workflow

The semantic-release workflow uses actions/setup-node with npm caching,
which requires a lock file to be present. Also switches from npm install
to npm ci for reproducible CI builds.

---------

Co-authored-by: devsy-app[bot] <277138668+devsy-app[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant