Skip to content

feat(coder/modules/claude-code): add enable_state_persistence variable#749

Merged
mafredri merged 4 commits intomainfrom
claude-code-50h6
Mar 3, 2026
Merged

feat(coder/modules/claude-code): add enable_state_persistence variable#749
mafredri merged 4 commits intomainfrom
claude-code-50h6

Conversation

@mafredri
Copy link
Member

@mafredri mafredri commented Feb 23, 2026

Expose the new enable_state_persistence variable from the agentapi sub-module so users can control conversation state persistence across workspace restarts.

The agentapi module (v2.2.0, from #736) added state persistence support. This PR threads the toggle through to the claude-code wrapper module. The state_file_path and pid_file_path variables remain internal to agentapi -- only the enable/disable toggle is surfaced.

Changes:

  • Add enable_state_persistence variable (bool, default true) to main.tf
  • Pass it through to the module "agentapi" block
  • Bump agentapi version from 2.0.0 to 2.2.0
  • Add plan-level tests for default-on and explicit-off
  • Add State Persistence section to README
  • Minor version bump to 4.8.0

Refs coder/internal#1258

Generated with Mux using Claude

…e variable

Add the enable_state_persistence variable (bool, default true) and pass
it through to the agentapi sub-module. Bump agentapi version to 2.2.0.

Add test runs for default and disabled state persistence.
Add State Persistence documentation section to README.

Refs coder/internal#1258
@mafredri mafredri changed the title feat(registry/coder/modules/claude-code): add enable_state_persistence variable feat(coder/modules/claude-code): add enable_state_persistence variable Feb 23, 2026
@DevelopmentCats
Copy link
Contributor

@mafredri

Does this play nicely with the existing claude-code session resumption logic?

Provided it does LGTM. I can give this some testing as well.

@mafredri
Copy link
Member Author

@DevelopmentCats it will once coder/agentapi#177 is released as well as #736.

And thanks for the offer to help testing! I've actually created a template to test this out on dev.coder.com (tasks-pause-resume-beta). It builds agentapi from the branch and uses this PR and #736 as close to verbatim as possible.

@35C4n0r
Copy link
Collaborator

35C4n0r commented Feb 24, 2026

Tested, works as expected :)
Quick question, @DevelopmentCats do we allow users to update the task prompt ?

@DevelopmentCats
Copy link
Contributor

Tested, works as expected :) Quick question, @DevelopmentCats do we allow users to update the task prompt ?

@35C4n0r Are you referring to being able to update the task prompt when the workspace is stopped and started again?

I believe that you altering this prompt will not trigger the prompt to send again if session resumption is enabled.

@mafredri
Copy link
Member Author

mafredri commented Mar 3, 2026

I merged the agentapi module changes and bumped it to v2.2.0. This is now ready for merge as well (and has been tested in the aforementioned Coder template on dogfood).

@mafredri mafredri requested a review from 35C4n0r March 3, 2026 13:59
@mafredri mafredri enabled auto-merge (squash) March 3, 2026 16:03
@mafredri mafredri merged commit 7b24554 into main Mar 3, 2026
4 checks passed
@mafredri mafredri deleted the claude-code-50h6 branch March 3, 2026 16:03
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.

3 participants