Skip to content

Keep Settings handy with quiet notifications and WebUI replies - #201

Merged
Paladin173 merged 4 commits into
mainfrom
notification-replies-settings
Nov 14, 2026
Merged

Paladin173 merged 4 commits into
mainfrom
notification-replies-settings

Conversation

@Paladin173

@Paladin173 Paladin173 commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

What changed

  • Keep a silent, minimized Hermes is open notification with an expandable Settings action while the app is open, including in the background. The existing option is now named Ongoing Hermes notification. Browser alerts also gain Settings.
  • Reply directly to idle-session Hermes WebUI browser notifications without opening the app or replacing a composer draft. Actions are single-use, expire after 30 minutes, and are revoked when changing servers or closing the app. Rejected and uncertain delivery are explicit; there is no automatic resend.
  • Keep About and Updates together at the bottom of Settings: installed version, channel-specific update action, and a latest-GitHub-release-notes link that works in every build. GitHub checks retain release summaries even when no newer APK exists; F-Droid/debug still have no updater.

No new permission, dependency, idle foreground service, or secret-bearing JavaScript bridge. Official Webapp direct reply is deliberately excluded, as requested after investigation; its Settings notification still works. Existing WebUI SSE/approval behavior and Play/GitHub update providers are unchanged. Cookie-backed replies do not reuse WebView-only Basic-auth or client-certificate challenges. Android/user dismissal and process survival remain outside the ongoing notification's guarantee.

Approved for release preparation: the user approved 1.3.3 / v1.3.3 for the GitHub APK and Google Play production. Authenticated live notification/reply acceptance is verified. Independent review found no significant issues, and full CI passed on exact head 6de7c7b15403822c97523409451771a3bbe34cc6, including both unfiltered API 35/36 suites and the final gate. Publication still depends on the reviewed release PR and successful orchestration. Remaining QA boundaries are tracked in #202.

Related #202.

Testing

  • NotificationReplyInstrumentationTest: 8 API 36 tests exercise actual notification RemoteInput PendingIntents and the production receiver against loopback HTTP: scoped cookies, encoded mount/session routing, original profile/message, replay rejection, selected-server changes including switch-away/back, expiry, redirect rejection, unconfirmed admission/gateway failures, and a delayed reply result arriving after a newer non-reply alert.
  • HermesNotificationPresenterTest: 6 API 36 tests include real MainActivity foreground/background/finish lifecycle and the Settings PendingIntent, a minimum-importance generic notification, and trusted-tap regressions.
  • SettingsScreenTest: 13 API 36 tests include About-before-Updates ordering, release-note/check/download callbacks, and existing Settings behavior.
  • HermesWebUiCompatibilityTest: 6 targeted notification-facade tests on API 36 execute the injected script, including positive WebUI/idle-session gating, exclusion of the official Webapp, permissions, service-worker delivery, and reinjection.
  • GitHubReleaseUpdateCheckerTest: 5 JVM cases include retaining current/older release notes without offering a download. The complete debug JVM suite passed 316 tests.
  • Mutation check: deliberately removed Settings actions, reversed About/Updates order, misrouted the download callback, bypassed WebUI/busy and reply expiry/replay/server guards, claimed rejected/unadmitted sends as successful, and discarded current-release notes. All 11 new Android tests and the matching JVM release-note test failed. Production sources were restored; all targeted Android tests and the complete JVM suite then passed.
  • Base comparison: NOT APPLICABLE to the new opt-in reply/notification contracts and requested layout/metadata feature; no prior contract existed. The mutation checks establish that the focused tests detect the removed behavior rather than passing vacuously.
  • Independent review: review of 603c2d6 found two issues: a delayed reply result could overwrite a newer non-reply notification, and gateway errors could incorrectly claim definite rejection after upstream admission. Both new regression tests were RED on 603c2d6, then GREEN on b8c4f5e. Every replacement now invalidates its old reply action, result/replacement posting is serialized, and HTTP server/gateway errors or request timeouts report uncertain delivery. Final targeted API 36 run: 33 tests passed, alongside all 316 JVM tests, lint, and debug build. Independent follow-up review of exact commit b8c4f5e6b8d447587ef9d28f83f51528cf8201b3 found no significant remaining issues in the reviewed changes.
  • Manual/device checks: authenticated API 36 live WebUI testing now includes a real turn-completion notification, its actual Android inline-reply editor and Send control, and authenticated server readback showing exactly one matching user reply and one matching assistant response in the intended session/profile, with no tool messages. A second real turn used an actual Android touch on Send; Hermes remained backgrounded throughout, and a new completion alert exposed Settings and Reply. Only a labeled disposable QA conversation was used; no password was entered or stored.
  • Not covered: prolonged Android suspension, OEM dismissal/task removal/process death, live Play updates/APK download/install, or the GitHub page rendering beyond Chrome's first-run screen. Browser handoff and the exact outbound notes URI are verified, but no browser terms were accepted. Live hardware-Back/gesture attempts did not finish the scripted QA history, so they are not claimed as a manual app-exit pass; actual ActivityScenario finish/lifecycle coverage passes. Basic-auth/mTLS native replies and official Webapp direct replies are intentionally unsupported.

Resumed validation

  • 3bdac45 fixes two reproduced harness startup assumptions: a running process no longer substitutes for opening the activity, and DevTools transport/page startup gets a bounded readiness wait instead of a fixed delay. Launch failures are explicit.
  • Three additional runtime tests cover delayed transport/page readiness, opening the activity with an existing process, and the ten-second deadline. The first two were RED before the fix. Deliberately changing the deadline to 100 seconds failed the 15-second outer bound; restoring it made all 9 QA harness tests GREEN. All 121 tooling tests passed.
  • The initial resumed connection reached the configured server's manual sign-in preflight, rather than failing with raw fetch failed. The user subsequently signed in; authenticated live results are recorded below. No password was entered or stored by the agent.
  • Full local API 36 runs exposed Android's notification service shedding the exact reply fixture IDs at more than seven updates per second. The reply fixture now follows the existing session-monitor fixture's rate-window pacing, uses unique tags/per-response latches, and drains broadcasts before restoring state.
  • Two local unfiltered API 36 runs failed: first 3 failures, then 2 before the final gateway-loop pacing correction. The final focused run passed all 8 reply tests but still failed the unchanged textInput_usesAndroidEditorWithoutWindowFocus case (30-second editor-readiness timeout). The local discrepancy has not been diagnosed; no test was disabled or narrowed.
  • Prior full CI is GREEN: run 43601046613, head 3bdac451864fe4d1f89e116a87ddb7a6f727a0c1, completed successfully. Both unfiltered API 35/36 instrumentation jobs, unit tests, tooling, lint, build, JavaScript/docs checks, and the final CI gate passed. This includes the unfocused-editor regression that still times out on the local emulator. The final notes-link fix has its own full CI run linked above.
  • JVM tests remained up-to-date/passing; lint and the debug build passed. Pylance's optional Python syntax check timed out; the Python file executed successfully in the tooling suite.
  • Independent review of exact follow-up commit 3bdac451864fe4d1f89e116a87ddb7a6f727a0c1 found no significant issues. No APK/AAB has been published.
  • Independent read-only review of the complete feature branch at exact final commit 6de7c7b15403822c97523409451771a3bbe34cc6 found no significant issues.
  • Final CI GREEN: run 43624207703 completed successfully on exact final head 6de7c7b15403822c97523409451771a3bbe34cc6. All 12 jobs passed, including actual unfiltered API 35/36 instrumentation steps, unit tests, Android lint, debug/F-Droid/Play compile gates, tooling/docs/JavaScript checks and the final CI gate. No job was failed, skipped or narrowed.
  • Live-discovered regression fixed: the new notes button opened an empty URI in Play/F-Droid/debug because only the GitHub variant defined its public page URL. WelcomeFirstRunInstrumentationTest.configuredSettingsCanOpenReleaseNotesWithoutAnUpdateProvider drives real MainActivity, verifies debug still has no updater, and captures the actual browser intent. It was RED on 3bdac45 (expected https, got null) and GREEN on 6de7c7b. The public page URL now comes from shared default configuration, retaining fork overrides and unchanged channel-specific API/provider fields. Generated debug/GitHub/Play/F-Droid BuildConfig readback confirms all four page URLs are populated and provider channels remain none/github/play/none.
  • On final code, 4 targeted API 36 tests passed: the new real notes-intent test, actual ongoing-notification foreground/background/Settings/finish lifecycle, About/Updates callbacks, and available-download callback. 316 JVM tests, Android lint, debug/app-test builds, FOSS dependency verification, 121 tooling tests, and Markdown checks passed.
  • Live ongoing notification readback showed channel hermes_open, importance 1, and ONGOING_EVENT|ONLY_ALERT_ONCE|SILENT. It was available foreground/background; expanding the Android group and individual notification exposed Settings, which opened native Settings. Disabling removed it, and reenabling restored it. The original debug option was restored afterward.
  • Cold launch can still briefly expose an inspector about:blank and produce a premature origin-mismatch preflight. The final full live run used --no-launch after directly verifying the real document was loaded. This remaining harness-readiness limitation and the manual-exit/OEM checks stay explicit in Follow up notification and live WebView QA after v1.3.3 #202.

Commands and results:

.\gradlew.bat testDebugUnitTest lintDebug assembleDebug --no-daemon
# PASS: complete JVM suite, Android lint, debug APK.

.\gradlew.bat testDebugUnitTest connectedDebugAndroidTest "-Pandroid.testInstrumentationRunnerArguments.class=com.hermeswebui.android.notification.NotificationReplyInstrumentationTest,com.hermeswebui.android.notification.HermesNotificationPresenterTest,com.hermeswebui.android.ui.settings.SettingsScreenTest,com.hermeswebui.android.webui.HermesWebUiCompatibilityTest#notificationFacadeOffersReplyOnlyForAnIdleWebUiSessionNotTheOfficialWebapp" --no-daemon
# PASS after restoring mutations: 316 JVM tests and 26 API 36 tests.

.\gradlew.bat connectedDebugAndroidTest "-Pandroid.testInstrumentationRunnerArguments.class=com.hermeswebui.android.webui.HermesWebUiCompatibilityTest#notificationFacade_grantedConstructorPostsOnlyWhitelistedFieldsAndFiresOnshow,com.hermeswebui.android.webui.HermesWebUiCompatibilityTest#notificationFacade_deniedPermissionThrowsAndNeverReachesAndroid,com.hermeswebui.android.webui.HermesWebUiCompatibilityTest#notificationFacade_failedDeliveryRaisesOnerrorInsteadOfShow,com.hermeswebui.android.webui.HermesWebUiCompatibilityTest#notificationFacade_reinjectionUpdatesPermissionWithoutReinstalling,com.hermeswebui.android.webui.HermesWebUiCompatibilityTest#notificationFacade_serviceWorkerShowNotificationRoutesThroughTheBridge" --no-daemon
# PASS: 5 existing API 36 notification-facade regressions.

.\gradlew.bat connectedDebugAndroidTest "-Pandroid.testInstrumentationRunnerArguments.class=com.hermeswebui.android.notification.NotificationReplyInstrumentationTest#gatewayFailuresAndTimeoutsDoNotClaimTheReplyWasRejected,com.hermeswebui.android.notification.NotificationReplyInstrumentationTest#aDelayedReplyResultCannotReplaceANewerNonReplyNotification" --no-daemon
# RED on the initial feature commit: both independent-review regressions failed as expected.

.\gradlew.bat testDebugUnitTest lintDebug assembleDebug connectedDebugAndroidTest "-Pandroid.testInstrumentationRunnerArguments.class=com.hermeswebui.android.notification.NotificationReplyInstrumentationTest,com.hermeswebui.android.notification.HermesNotificationPresenterTest,com.hermeswebui.android.ui.settings.SettingsScreenTest,com.hermeswebui.android.webui.HermesWebUiCompatibilityTest#notificationFacadeOffersReplyOnlyForAnIdleWebUiSessionNotTheOfficialWebapp,com.hermeswebui.android.webui.HermesWebUiCompatibilityTest#notificationFacade_grantedConstructorPostsOnlyWhitelistedFieldsAndFiresOnshow,com.hermeswebui.android.webui.HermesWebUiCompatibilityTest#notificationFacade_deniedPermissionThrowsAndNeverReachesAndroid,com.hermeswebui.android.webui.HermesWebUiCompatibilityTest#notificationFacade_failedDeliveryRaisesOnerrorInsteadOfShow,com.hermeswebui.android.webui.HermesWebUiCompatibilityTest#notificationFacade_reinjectionUpdatesPermissionWithoutReinstalling,com.hermeswebui.android.webui.HermesWebUiCompatibilityTest#notificationFacade_serviceWorkerShowNotificationRoutesThroughTheBridge" --no-daemon
# GREEN on b8c4f5e: 33 API 36 cases, 316 JVM tests, lint and debug build.

python -m unittest tools.tests.test_qa_harness
# PASS on 3bdac45: 9 tests, including the restored deadline.
.\gradlew.bat connectedDebugAndroidTest --no-daemon
# FAIL in two local full API 36 runs: 218 cases; 3 then 2 failures before final loop pacing.
.\gradlew.bat connectedDebugAndroidTest "-Pandroid.testInstrumentationRunnerArguments.class=com.hermeswebui.android.notification.NotificationReplyInstrumentationTest,com.hermeswebui.android.webui.HermesWebUiCompatibilityTest#textInput_usesAndroidEditorWithoutWindowFocus" --no-daemon
# Final focused result: all 8 reply tests PASS; the unchanged unfocused-editor test FAILS.

python -m unittest discover -s tools/tests -p "test_*.py"
# PASS on 3bdac45: 121 tests.
python tools/check_markdown.py
# PASS: 0 problems (23 files on the final documentation check).
python tools/extract_webui_scripts.py
Get-ChildItem build/webui-scripts/*.js | ForEach-Object { node --check $_.FullName }
npx --no-install eslint --no-config-lookup -c eslint.runtime-guard.config.mjs "build/webui-scripts/**/*.js"
# PASS: extraction, syntax and runtime-error lint.

.\gradlew.bat lintDebug assembleDebug installDebug --no-daemon
# PASS: compiled, linted and installed on API 36 before attempting the live harness.
node tools/qa/run-live-qa.mjs --serial emulator-5554 --only s02
# ORIGINAL ATTEMPT BLOCKED: "fetch failed"; superseded by authenticated runs below.

.\gradlew.bat testDebugUnitTest lintDebug assembleDebug assembleDebugAndroidTest generateGithubBuildConfig generatePlayBuildConfig generateReleaseBuildConfig verifyFossDependencies --no-daemon
# PASS on final code: 316 JVM tests, lint, builds, generated channel configs and FOSS dependencies.

& $adb -s emulator-5554 shell am instrument -w -e class 'com.hermeswebui.android.ui.onboarding.WelcomeFirstRunInstrumentationTest#configuredSettingsCanOpenReleaseNotesWithoutAnUpdateProvider' com.hermeswebui.android.debug.test/androidx.test.runner.AndroidJUnitRunner
# RED against installed 3bdac45: 1 test, expected https but was null.
& $adb -s emulator-5554 shell am instrument -w -e class 'com.hermeswebui.android.ui.onboarding.WelcomeFirstRunInstrumentationTest#configuredSettingsCanOpenReleaseNotesWithoutAnUpdateProvider,com.hermeswebui.android.notification.HermesNotificationPresenterTest#activityKeepsSettingsNotificationInBackgroundAndRemovesItOnClose,com.hermeswebui.android.ui.settings.SettingsScreenTest#updatesAreBelowAboutAndKeepCheckAndReleaseNotesActions,com.hermeswebui.android.ui.settings.SettingsScreenTest#updatesNearAboutStillOfferTheAvailableDownload' com.hermeswebui.android.debug.test/androidx.test.runner.AndroidJUnitRunner
# GREEN against final APK: OK (4 tests). $adb selects the SDK adb executable.

node tools\qa\run-live-qa.mjs --serial emulator-5554 --no-launch
# Final authenticated run: 27 PASS, 2 s04 FAIL; identical s04 failures on production base.
# A cold-launch invocation first reported origin mismatch before the real document loaded.

python -m unittest discover -s tools\tests -p "test_*.py"
python tools\check_markdown.py
# PASS on final code: 121 tooling tests; 25 Markdown files, zero problems.

An initial unquoted PowerShell Gradle-property invocation failed argument parsing; quoting it corrected the command. Test development also exposed a nullable test PendingIntent and Android notification/lifecycle readiness assumptions; those were corrected before the final green runs. These are not hidden passing checks.

  • .\gradlew.bat testDebugUnitTest --no-daemon
  • .\gradlew.bat lintDebug --no-daemon
  • .\gradlew.bat assembleDebug --no-daemon
  • python -m unittest discover -s tools/tests -p "test_*.py" and python tools/check_markdown.py
  • connectedDebugAndroidTest on an emulator, or note why it was skipped (CI runs API 35 and 36 for Android changes)
    • Targeted API 36 reply tests passed locally; full unfiltered API 35/36 suites passed in CI on 3bdac45. Local full runs and the local unfocused-editor failure are documented above.

QA checklist

  • Behavior changes have the cheapest test that would have caught the regression; the new test was seen to fail with the fix reverted.
  • Injected WebUI JavaScript or a WebUI shim change was also checked with tools/qa against a real server, and the redacted report.md summary is pasted below (or marked not applicable).
    • Checked, not claimed universally green: two s04 failures reproduce identically on the unchanged production base. Actual live notification/reply behavior is separately verified.
  • Security rules hold: no SSL error bypass, no dashboard-config writes, non-allowlisted HTTP/HTTPS stays externalized, no new JavaScript bridge for secrets.
  • No server URL, hostname, credential, keystore, or local machine path is in the diff.
    • Only synthetic loopback/test fixtures are included.
  • README.md, ROADMAP.md, ARCHITECTURE.md, and AGENTS.md are updated where behavior, setup, architecture, or workflow changed.
  • Labels applied from the release-note set (enhancement, user-facing, bug, documentation, skip-changelog).

Live QA summary (if applicable)

Final authenticated report: 2026-11-14, API 36, debug app 1.3.2, Chrome/WebView 156.0.8078.47. Production version metadata is deliberately unchanged.

Scenario Check Result Detail
s01 viewport and visible layout PASS 4/4 checks
s02 injected native Settings entry PASS 5/5 checks
s03 live markup contract PASS 12/12 checks
s04 approval control hit testing FAIL collapse-button corner points hit approval-header
s04 clarify control hit testing FAIL qa5 corner point hits SVG
s04 restore original cards PASS restored=true
s05 generic collapse repair and exclusions PASS 5/5 checks

The same two s04 failures were measured on the emulator after installing a debug APK built from unchanged production base 330a03e; the reviewed feature APK was then restored without clearing app data. No hit-test assertion or production prompt CSS was weakened. This is baseline evidence, not a fully green live report or a completed diagnosis of the old hit-test failures.

Native live acceptance additionally verified the minimized Settings shortcut and actual exactly-once conversation reply with server-persisted agent response. Physical/OEM acceptance and the noted harness/history limitations remain tracked under enhancement #202. No APK/AAB, tag or release has been published.

🤖 Generated with GitHub Copilot

Keep About and Updates together and retain current-release notes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Paladin173 Paladin173 added the enhancement New feature or request label Nov 14, 2026
@Paladin173 Paladin173 self-assigned this Nov 14, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Paladin173 and others added 2 commits November 14, 2026 07:38
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Paladin173
Paladin173 marked this pull request as ready for review November 14, 2026 20:59
@Paladin173
Paladin173 merged commit 76fbfd2 into main Nov 14, 2026
12 checks passed
@Paladin173
Paladin173 deleted the notification-replies-settings branch November 14, 2026 20:59
@Paladin173

Copy link
Copy Markdown
Collaborator Author

Outcome

Shipped in #201 and release #203 as v1.3.3: quiet Settings access, eligible WebUI inline replies, and About/Updates together at the bottom of Settings.

Root cause: The live harness could treat a service process as a ready foreground WebView and attach before its debug endpoint/page was ready. Its activity launch and bounded readiness handling now have failing-then-passing regressions. Live QA also found and fixed the blank release-notes target outside the GitHub channel.

What changed:

  • Keep Settings reachable through a quiet, minimized ongoing notification.
  • Reply to eligible completed WebUI conversations directly from their notifications.
  • Find About, version/update actions, and working release-note links at the bottom of Settings.
  • Preserve existing package identities, signing, update providers and permissions. Official Webapp direct replies remain excluded.

Verification: 316 JVM and 121 tooling tests, lint/build/FOSS checks, observed RED/GREEN and mutation checks, independent exact-SHA reviews, and the complete API 35/36 PR suites passed. Actual API 36 SystemUI RemoteInput and authenticated persisted conversation readback proved exactly one reply and assistant response; a separate real turn completed while the app remained backgrounded. The minimized notification's Settings action and disable/reenable behavior were exercised live.

Production orchestration passed full API 36 instrumentation and signed APK/AAB checks. Direct GitHub release/tag readback confirms exactly the intended APK and reviewed release SHA. The actual Play publisher job verified production 10303, completed status, en-US notes and English descriptions through a fresh Publisher API edit. Local tooling-test mock output is not publication evidence.

Not covered / retained here: public Play review/visibility and device update/install, physical/OEM/process-survival behavior, the two live s04 failures identical on the production base, scripted-history/cold-preflight discrepancies, the local unfocused-editor timing discrepancy, and Chrome beyond first-run. No F-Droid publication is claimed. Keep this enhancement open for those explicitly documented follow-ups; they are not represented as passing checks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant