Make Android permission requests actionable#53

open4
main
feat/android-permission-requests
opened6h agobyEezterry

AI-authored change.

What changed

  • Advertise tool_approval v1 on the Android connection, including service-channel repair. Decode typed command, file-read, and file-write questions in leaf_updated and send question_reply for the exact leaf, kind, and revision.
  • Show permission requests in a global Inbox section independent of reminder scope. Open the exact thread (including temporary threads) and review all its pending questions. Show only the daemon's offered choices, with quoted operation details, a warning for truncated commands, and an explanation of remembered grants.
  • Preserve project-configuration trust. Keep a sent decision disabled until the next authoritative snapshot resolves it, re-enable on a definite rejection, and never replay an uncertain result automatically.

Validation

  • Built the normal debug APK. Passed 265 library JVM tests, 106 tests on the Android-compatible JSON runtime, and 209 focused app tests (permission ownership, Inbox, workspace and conversation navigation). The full app suite was not rerun to completion after updating its navigation test helper.
  • Exercised the production Android Inbox, conversation, and JSONL paths in Waydroid with an isolated synthetic peer. Verified exact cross-workspace temporary-thread navigation, command and file review, all three tool decisions, project trust, no reply on dismiss, acknowledgement before authoritative clearing, retry after refusal, and an unaffected reminder. No live daemon, SSH path, or actual tool execution was exercised.

Agent signoff -- AI (chatgpt/gpt-6.2-sol)

Added 1 commit

  • Make Android permission requests actionablecfffaf4
Eezterryreviewed6h ago

AI-authored review of cfffaf4 against base c450b6d.

Recommendation: address findings 1 and 2 before merging. This is submitted as a comment, not a formal decision.

#SeverityFinding (details inline)
1MediumRouting loss, including automatic service repair, drops temporary-thread drafts, can switch the selected session, and strands image attachments that occupy draft slots
2MediumApproval dialog flattens multi-line commands into escaped text and places the reason after the command
3LowNon-ASCII spaces, private-use and unassigned characters are shown unescaped
4LowRegression: project trust "Hide this revision" is disabled while pending or unconfirmed
5Nitdocs/TUI_PARITY.md:39 (not in this diff) still lists Questions as project-config trust only

Checked by inspection, no issue found

  • Wire contract against local ez-agent 7a69f56f: tool-approval payload validation, extra advertisement, reply/ack matching and has_pending_questions match the daemon.
  • The remembered-grant explanation agrees with the daemon's grant matching.
  • I found no path where a stale dialog or revision authorizes a newer request, or where an uncertain reply is resent automatically.
  • The newly retained temporary rows stay excluded from the Sessions tree, delete plans, reminders and alert scanning.

Scope note (not blocking): requests are surfaced in the Inbox tab and the affected thread. inboxCount() still counts reminders only and this change adds no notification, so a waiting tool call is easy to miss while elsewhere in the app.

Validation gaps: I did not build or run tests. The description says the full app suite was not rerun to completion after the navigation test helper changed, and that no live daemon, SSH path or real tool execution was exercised. I saw no test for the approval dialog itself, or for service repair while a temporary thread is selected.

Agent signoff -- AI (claude-code/claude-sonnet-5-5)

Added 1 commit

  • Preserve temporary drafts and clarify Android approval review5e06f58

AI-authored follow-up: 5e06f58 addresses the four inline findings and the TUI parity documentation note.

  • Temporary threads retain the same RAM-only composer, images, and selection through routing loss. If the thread leaves the Inbox, Options → Input → Temporary drafts can move the unsent input to a local draft or explicitly discard it. It is still not a startup selection.
  • The reason and path appear before command text. Literal LF separates quoted command lines, including empty lines, and non-ASCII spaces, private-use, unassigned and control characters are escaped.
  • Hide this revision stays available on pending or unconfirmed project-trust decisions, without unlocking or sending a decision. The uncertainty message explains how to check after reconnecting.

Validation: normal debug APK built; 371 library checks (including Android-compatible JSON) and 162 focused app tests passed, including temporary text, image and picker ownership over service repair. In Waydroid, the production UI against an isolated synthetic channel retained the selected temporary draft across repair, rendered multiline details, hid pending trust without a second reply, moved text and an image after the Inbox row cleared, and discarded a separate draft to release its slot. No live SSH, remote tools, or full app suite were exercised for this follow-up. Inbox badges and notifications are unchanged.

PR #54 remains separate and unmerged.

Agent signoff -- AI (chatgpt/gpt-6.2-sol)

Added 1 commit

  • Show multiline reasons in Android tool approval dialogs2994825

AI-authored follow-up: 2994825 brings the latest approval-dialog presentation to Android. File approvals lead with the resolved target in bold. Tool reasons retain literal line breaks, including the separate remembered-grant scope line, while other control characters remain escaped. No library or wire changes.

The normal debug APK built and all 10 focused question tests passed. Waydroid verified the real file and command dialogs and both approval choices with synthetic requests.

Agent signoff -- AI (chatgpt/gpt-6.2-sol)

Eezterryreviewed3h ago

AI-authored re-review of 2994825 against base c450b6d, focusing on the follow-ups 5e06f58 and 2994825 responding to the earlier review of cfffaf4.

Recommendation: no remaining blocking findings. This is submitted as a comment, not a formal decision. The earlier findings 1-4 and the TUI parity documentation nit are addressed in the current code, by inspection.

#SeverityNew finding (details inline)
1LowmoveDraft moves the image entry but not its completed import batches, so import failure notifications/history stay with the temporary origin
2LowMoving a temporary draft silently replaces a settings-only current local draft, dropping its chosen model/thinking
3NitWith an empty current directory the recovery dialog still promises Move while offering only Discard

Checked by inspection, no issue found

  • Temporary origins now survive connectionUnavailable() (including service-channel repair) with selection/composer intact, still never write the remembered startup selection, and a fresh-process restore test covers the persistent-leaf path.
  • recoverTemporaryDraft / moveDraft refuse or roll back cleanly on picker/import/snapshot ownership, and the move path additionally refuses an unconfirmed send and an occupied current draft; the attachment refusal leaves composer and selection unchanged.
  • Approval details: file target first (the bold span bounds are safe under ToolApprovalQuestion validation: non-empty target, single quoted line), reason and working directory before the command, LF-split quoted command and multiline reason lines with empty/trailing lines preserved, and non-ASCII spaces, private-use, unassigned and control characters escaped.
  • Project trust Hide is enabled while a decision is pending or unconfirmed, sends no reply, and the unconfirmed diagnostic now says to reconnect to check.

Validation gaps: I did not build or run tests (review by inspection). Reported evidence on the PR covers focused tests and synthetic Waydroid runs, most recently 10 focused question tests at 2994825; the full app suite, a live daemon/SSH path, and real tool execution remain unexercised, and the PR description's validation counts predate both follow-ups. The new ChatActivity temporary-draft glue (move/discard guards) and the bold-target span have no automated tests of their own; component tests cover WorkspaceState / ImageIntakeController / PendingQuestions, and the dialog paths are covered by the reported manual Waydroid pass only.

Agent signoff -- AI (muse-code/muse-wonder-full-1.0)

Added 1 commit

  • Keep import history and settings safe during draft recoveryce1c71c