Skip to content

fix: handle PermissionV2 events and keyboard avoidance on connection screens - #216

Open
meramsey wants to merge 2 commits into
dzianisv:mainfrom
meramsey:fix/permission-v2-and-keyboard
Open

meramsey wants to merge 2 commits into
dzianisv:mainfrom
meramsey:fix/permission-v2-and-keyboard

Conversation

@meramsey

@meramsey meramsey commented Oct 5, 2026

Copy link
Copy Markdown

Two issues found while testing against OpenCode 1.18.34:

1. Permission prompts never appeared for tool calls

The server emits permission.v2.asked events with {id, sessionID, action, resources}, but the SSE handler only matched the legacy permission.asked format. When a tool needed approval, the session would just sit there waiting — no prompt, no way to approve.

Added a normalization layer (src/lib/permissions.ts) that converts both protocol generations into a single internal model, and updated the event handler to process v2 asked/replied events. Pending permissions are also reconciled on SSE reconnect and app foreground so a missed event doesn't leave the session stuck.

2. Keyboard covered input fields on the connection add/edit screens

The chat screen already used KeyboardAvoidingView with behavior="padding", but the connection screens used a bare ScrollView. On Android 15+ edge-to-edge, adjustResize is a no-op so the keyboard stays on top of the content. Wrapped both connection screens in the same KeyboardAvoidingView pattern.

Includes

Cherry-picks PR #210 (IME insets fix) which was still open.

Testing

  • Full test suite: 338/338 pass
  • TypeScript: clean
  • Release APK built and verified on Pixel 9 Pro XL

xtiang7c0 and others added 2 commits October 5, 2026 08:02
…screens

Two issues found while testing against OpenCode 1.18.34:

1. Permission prompts never appeared for tool calls. The server emits
   permission.v2.asked events with {id, sessionID, action, resources},
   but the SSE handler only matched the legacy permission.asked format.
   Added a normalization layer (src/lib/permissions.ts) that converts
   both protocol generations into a single internal model, and updated
   the event handler to process v2 asked/replied events. Pending
   permissions are also reconciled on SSE reconnect and app foreground
   so a missed event doesn't leave the session stuck.

2. Keyboard covered input fields on the connection add/edit screens.
   The chat screen already used KeyboardAvoidingView with
   behavior="padding", but the connection screens used a bare ScrollView.
   On Android 15+ edge-to-edge, adjustResize is a no-op so the keyboard
   stays on top of the content. Wrapped both connection screens in the
   same KeyboardAvoidingView pattern.

Includes PR dzianisv#210 (IME insets) which was already open.

This branch has not been deployed

No deployments
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