Skip to content

feat: persist approve_for_session decisions across session resume#1469

Closed
Br1an67 wants to merge 1 commit intoMoonshotAI:mainfrom
Br1an67:fix/persist-session-approvals
Closed

feat: persist approve_for_session decisions across session resume#1469
Br1an67 wants to merge 1 commit intoMoonshotAI:mainfrom
Br1an67:fix/persist-session-approvals

Conversation

@Br1an67
Copy link

@Br1an67 Br1an67 commented Mar 17, 2026

Problem

When resuming a session, actions previously approved via 'approve for session' are lost because ApprovalState.auto_approve_actions is only kept in memory (there's a TODO comment about this).

Fix

  • Add session_dir parameter to ApprovalState and Approval
  • Persist auto_approve_actions to approval_state.json in the session directory
  • Load saved state on initialization
  • Save state whenever an action is approved for session
  • Pass session.dir from Runtime.create()

Deleting the state file resets approvals, as expected.

Fixes #765


Open with Devin

When resuming a session, actions previously approved via
'approve for session' were lost because the approval state
was only kept in memory.

Persist auto_approve_actions to approval_state.json in the
session directory. Load them on session restore so users
don't need to re-approve the same actions repeatedly.

Fixes MoonshotAI#765
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@Br1an67
Copy link
Author

Br1an67 commented Mar 17, 2026

Closing this PR — approval state persistence was independently implemented on main via commit 600ff8f which uses the existing session state system with an on_change callback. This is more integrated than a separate JSON file.

@Br1an67 Br1an67 closed this Mar 17, 2026
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.

[feat]: Persist approve_for_session across session resume

1 participant