Skip to content

fix(hub): preserve permission mode on resume#282

Draft
webwww123 wants to merge 1 commit intotiann:mainfrom
webwww123:fix/session-resume-permission-mode
Draft

fix(hub): preserve permission mode on resume#282
webwww123 wants to merge 1 commit intotiann:mainfrom
webwww123:fix/session-resume-permission-mode

Conversation

@webwww123
Copy link

Summary

Preserve the previous permission mode when resuming an archived session.

What changed

  • persist the last known permission mode in session metadata
  • restore that mode when rebuilding session state from the store
  • automatically reapply the saved permission mode during session resume
  • preserve the saved mode when old/new sessions are merged after resume
  • add hub tests covering persistence and resume-time reapplication

Why

Without this, sessions resumed from archive fall back to default, even if the user was previously using a more permissive mode like YOLO. That forces users to stop the agent, switch modes again, and wastes tokens.

Closes #281

Validation

docker run --rm -v "/root/sandbox/hapi-pr:/workspace:ro" oven/bun:1 sh -lc "cp -a /workspace /tmp/hapi-pr && cd /tmp/hapi-pr && bun install && cd hub && bun test src/sync/permissionModePersistence.test.ts && cd /tmp/hapi-pr && bun run typecheck"

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.

Preserve previous permission mode when resuming an archived session

1 participant