-
Notifications
You must be signed in to change notification settings - Fork 194
Description
Infinite git loop when Android messages trigger "only prompt commands" error
Summary
Happy conversations become permanently unresponsive due to an infinite git rev-parse --is-inside-work-tree loop when certain Android messages trigger the error: "only prompt commands are supported in streaming mode"
Environment
- Happy Version: 0.12.0
- Claude Code Version: 2.0.76
- Node Version: v20.19.4 / v20.19.5
- Machines: Confirmed on 2 separate Ubuntu servers (nelnet, paul)
- Platform: Both machines running Happy daemon with remote sessions
Steps to Reproduce
- Start a Happy conversation on a remote machine with daemon
- Send messages from Android Happy app (with
bypassPermissionsmode) - Eventually, a message triggers error: "only prompt commands are supported in streaming mode"
- Git status checks begin running continuously
- Conversation becomes permanently unresponsive
Note: Not ALL Android messages trigger this - appears to be specific message types or conditions that aren't yet fully understood. Some conversations receive many Android messages successfully before hitting the bug.
Expected Behavior
- Error should be logged with details
- Conversation should either recover or show clear error to user
- Git repository detection should have timeout/retry limits
Actual Behavior
- Error occurs instantly (
duration_ms: 0,duration_api_ms: 0- no API call attempted) - Claude process exits:
[claudeRemote] Result received, exiting claudeRemote - Git status checks begin:
Shell command request: git rev-parse --is-inside-work-tree - Checks continue indefinitely (observed 200-1,880+ iterations)
- Conversation permanently stuck - no recovery possible
- Error logged as empty object:
[remote]: launch error {}
Evidence
Nelnet Session Logs
Session PID 1400265 - Triggered by message "Check current test status":
[13:35:17.694] [RESULT] Error during execution
"errors": [
"only prompt commands are supported in streaming mode"
]
[13:35:17.695] [claudeRemote] Result received, exiting claudeRemote
[13:35:17.741] [SOCKET] [UPDATE] Received update
[13:35:17.872] Shell command request: git rev-parse --is-inside-work-tree
[13:35:27.212] Shell command request: git rev-parse --is-inside-work-tree
[13:35:33.133] Shell command request: git rev-parse --is-inside-work-tree
... (continues indefinitely)
Message metadata:
{
"role": "user",
"content": {
"type": "text",
"text": "Check current test status"
},
"meta": {
"sentFrom": "android",
"permissionMode": "bypassPermissions"
}
}Affected Sessions
Nelnet:
- PID 747315: 218 git loop iterations
- PID 1400265: 41 git loop iterations
Paul:
- PID 727898: 1,880 git loop iterations
- PID 1342166: Git loop behavior confirmed
Impact
- Severity: High - Conversations permanently unusable once hit
- Frequency: Affects any conversation receiving Android messages
- Workaround: Kill stuck process (
kill <PID>) and restart conversation - Data Loss: Conversation state lost when killed
Root Cause Analysis
Two separate bugs compounding:
-
Primary: "only prompt commands are supported in streaming mode" error when processing certain Android messages
- Error occurs before any Claude API call
- Appears related to Android + bypass permissions mode combination
- Error details not logged (shows as empty object
{})
-
Secondary: Git repository detection loop doesn't terminate on error
- When
claude_remote_launcherfails or exits, git checks continue - No timeout or retry limit implemented
- Process cleanup doesn't kill background tasks
- When
Recommended Fixes
- Fix "only prompt commands" error - Identify why certain Android messages fail
- Terminate git loop on launcher failure - Stop all background tasks when process exits
- Add timeout for git checks - Maximum iterations/time limit
- Better error logging - Log actual error details instead of
{} - User notification - Show error in UI when conversation can't recover
- Process cleanup - Ensure child processes terminate properly
Additional Context
Full investigation details: /home/ben/happy-conversation-bug-report.md
Log locations:
- Nelnet:
~/.happy/logs/2025-12-27-05-59-39-pid-1400265.log - Paul:
~/.happy/logs/2025-12-22-07-59-51-pid-727898.log