Skip to content

🤖 feat: configurable Coder workspace action on archive (keep/stop/delete)#3052

Open
ibetitsmike wants to merge 6 commits intomainfrom
mike/archive-chat-spa0
Open

🤖 feat: configurable Coder workspace action on archive (keep/stop/delete)#3052
ibetitsmike wants to merge 6 commits intomainfrom
mike/archive-chat-spa0

Conversation

@ibetitsmike
Copy link
Contributor

Summary

Replaces the boolean stopCoderWorkspaceOnArchive setting with a "keep" | "stop" | "delete" enum, giving users control over what happens to dedicated Coder workspaces when archiving a chat.

Closes #3042

Background

Previously, archiving a chat could only stop or leave running the associated Coder workspace. Users want the option to delete the workspace entirely on archive, freeing up resources automatically.

Implementation

  • Shared type (src/common/config/coderArchiveBehavior.ts): new CoderWorkspaceArchiveBehavior union type, values array, and default constant.
  • Config layer: new coderWorkspaceArchiveBehavior field on disk schema + in-memory config. Normalization resolves new enum → legacy boolean fallback → "stop" default. Save writes a legacy boolean shim for downgrade safety ("keep"false, "stop"/"delete" → omit).
  • Lifecycle hooks: renamed createStopCoderOnArchiveHookcreateCoderArchiveHook with behavior dispatch: keep no-ops, stop preserves existing behavior, delete calls coderService.deleteWorkspace(). Unarchive only auto-starts for stop; keep and delete no-op (deleted workspace is safely handled via existing not_found guard).
  • ORPC: schemas and router updated to coderWorkspaceArchiveBehavior enum.
  • Settings UI: replaced Switch with Select dropdown ("Keep running" / "Stop workspace" / "Delete workspace") using existing SelectPrimitive pattern.

Risks

  • The delete path is more destructive than stop. Mitigated by clear label copy ("Delete workspace") and description noting permanence.
  • Downgrade safety relies on the legacy boolean shim; older builds reading a config saved by this version will see stop or keep behavior correctly.

Generated with mux • Model: anthropic:claude-opus-4-6 • Thinking: xhigh • Cost: $8.68

@ibetitsmike
Copy link
Contributor Author

@codex review

Copy link

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

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: c98bb8601b

ℹ️ 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".

@ibetitsmike
Copy link
Contributor Author

@codex review

Fixed the P1: simplified resolveCoderWorkspaceArchiveBehaviorForSave() so the explicit enum field is authoritative when present. Legacy boolean fallback now only applies for old configs that lack the enum field entirely. Added regression test.

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Another round soon, please!

ℹ️ 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".

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.

Add setting for MUX: choose what to do with coder workspace after "Archive chat"

1 participant