Skip to content

Conversation

@brycecutt-msft
Copy link
Contributor

@brycecutt-msft brycecutt-msft commented Nov 22, 2025

Summary

Addresses Windows-specific encoding and permission handling issues to improve cross-platform compatibility.

Changes

  • Add explicit UTF-8 encoding to all file operations (session.py, setup.py, key_manager.py, main.py, session_store.py, settings_manager.py, profiles/init.py)
  • Fix chmod() call in key_manager.py to skip on Windows where NTFS already restricts file permissions to the user
  • Add platform detection import for Windows-specific handling

Impact

  • Prevents encoding errors on Windows where default encoding may differ from UTF-8
  • Ensures configuration files, transcripts, and API key files work reliably across all platforms
  • Fixes file permission handling on Windows without breaking Unix/Linux behavior

- Add explicit UTF-8 encoding to all file operations to ensure consistent behavior across Windows and Unix systems
- Fix chmod() call in key_manager.py to skip on Windows where NTFS already restricts file permissions to the user
- Prevents encoding errors on Windows where default encoding may differ from UTF-8
- Ensures configuration files, transcripts, and API key files work reliably on all platforms
@brycecutt-msft
Copy link
Contributor Author

@microsoft-github-policy-service agree company=Microsoft

@bkrabach
Copy link
Collaborator

Closing this PR to resolve merge conflicts with #10 (atomic write refactor) which has been merged. The valuable UTF-8 encoding and Windows chmod fixes from this PR will be cherry-picked into a clean PR with credit to @brycecutt-msft. Thank you for the contribution!

@bkrabach bkrabach closed this Nov 27, 2025
bkrabach added a commit that referenced this pull request Nov 27, 2025
- Add explicit encoding="utf-8" to all file operations to ensure
  consistent behavior across Windows and Unix systems
- Fix chmod() call in key_manager.py to skip on Windows where NTFS
  already restricts file permissions to the user
- Prevents encoding errors on Windows where default encoding may
  differ from UTF-8
- Ensures configuration files, transcripts, and API key files work
  reliably on all platforms

Based on PR #9 by @brycecutt-msft - thank you for the contribution!

🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier)

Co-Authored-By: Bryce Cutt <brycecutt@microsoft.com>
Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
bkrabach added a commit that referenced this pull request Nov 27, 2025
- Add explicit encoding="utf-8" to all file operations to ensure
  consistent behavior across Windows and Unix systems
- Fix chmod() call in key_manager.py to skip on Windows where NTFS
  already restricts file permissions to the user
- Prevents encoding errors on Windows where default encoding may
  differ from UTF-8
- Ensures configuration files, transcripts, and API key files work
  reliably on all platforms

Based on PR #9 by @brycecutt-msft - thank you for the contribution!

🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier)

Co-authored-by: Bryce Cutt <brycecutt@microsoft.com>
Co-authored-by: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
@brycecutt-msft brycecutt-msft deleted the fix/utf8-encoding-and-windows-chmod branch November 27, 2025 18:15
robotdad added a commit to robotdad/amplifier-app-cli that referenced this pull request Jan 7, 2026
Completes the fix for bundle removal by calling the unregister() method
added in amplifier-foundation PR microsoft#9. Previously, 'amplifier bundle remove'
only removed bundles from the user registry but left them in the
foundation registry's in-memory state.

Changes:
- Call BundleRegistry.unregister() to remove from foundation registry
- Call registry.save() to persist the removal
- Provide detailed feedback about which registries were affected
- Handle errors gracefully with warning messages

Companion PR to: microsoft/amplifier-foundation#9

🤖 Generated with Amplifier

Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
bkrabach pushed a commit that referenced this pull request Jan 7, 2026
Completes the fix for bundle removal by calling the unregister() method
added in amplifier-foundation PR #9. Previously, 'amplifier bundle remove'
only removed bundles from the user registry but left them in the
foundation registry's in-memory state.

Changes:
- Call BundleRegistry.unregister() to remove from foundation registry
- Call registry.save() to persist the removal
- Provide detailed feedback about which registries were affected
- Handle errors gracefully with warning messages

Companion PR to: microsoft/amplifier-foundation#9

🤖 Generated with Amplifier

Co-authored-by: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
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.

2 participants