Skip to content

Fix Windows permission mode issue with newline characters in system p…#8

Open
fuzi1996 wants to merge 2 commits intospring-ai-community:mainfrom
fuzi1996:issues/7
Open

Fix Windows permission mode issue with newline characters in system p…#8
fuzi1996 wants to merge 2 commits intospring-ai-community:mainfrom
fuzi1996:issues/7

Conversation

@fuzi1996
Copy link
Copy Markdown

When systemPrompt or appendSystemPrompt contains newline characters on Windows, the PermissionMode was not being applied correctly. The issue was that command line arguments with newlines were not properly normalized for the Windows CLI.

Changes:

  • Add normalizeNewline() method to convert newlines to platform-appropriate line continuation characters (Windows uses ^, Unix uses )
  • Add platform detection static initialization for Windows
  • Apply normalization to both systemPrompt and appendSystemPrompt arguments
  • Add comprehensive integration tests for various newline scenarios

This resolves Issue #7 where PermissionMode defaulted to 'default' instead of the configured 'bypassPermissions' when systemPrompt contained newlines.

🤖 Generated with Claude Code

fuzi1996 and others added 2 commits January 29, 2026 21:12
…rompts

When systemPrompt or appendSystemPrompt contains newline characters on Windows,
the PermissionMode was not being applied correctly. The issue was that command
line arguments with newlines were not properly normalized for the Windows CLI.

Changes:
- Add normalizeNewline() method to convert newlines to platform-appropriate
  line continuation characters (Windows uses ^, Unix uses \)
- Add platform detection static initialization for Windows
- Apply normalization to both systemPrompt and appendSystemPrompt arguments
- Add comprehensive integration tests for various newline scenarios

This resolves Issue spring-ai-community#7 where PermissionMode defaulted to 'default' instead of
the configured 'bypassPermissions' when systemPrompt contained newlines.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Simplify normalizeWindowsCommand to directly replace newlines with spaces on Windows
- Add test case for systemPrompt with text blocks containing newlines
- Remove complex multi-line command processing logic in favor of simpler approach

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.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.

1 participant