Skip to content

fix(android): release Gateway directory bootstrap - #578

Merged
Codename-11 merged 1 commit into
devfrom
fix/android-gateway-directory-bootstrap
Sep 12, 2026
Merged

Codename-11 merged 1 commit into
devfrom
fix/android-gateway-directory-bootstrap

Conversation

@Codename-11

Copy link
Copy Markdown
Owner

Summary

Refs #495 and #528. Follow-up to #571.

Android 1.16.0 admitted foreground Gateway observation before gateway.ready, but production still deferred that socket behind the exact profile-scoped Dashboard session directory. HermesRuntimeBinder started the directory from activeEndpoint, which belongs to the optional Relay socket and remains null on a valid Dashboard-only LAN connection. The directory and Gateway could therefore wait on each other until a lifecycle or route change retriggered binding.

Start the directory from the effective Dashboard origin instead. This preserves the existing profile-settle fence and directory ownership checks while allowing a standard Dashboard-only connection to reach the passive Gateway observation socket without a background/resume cycle.

Changes

  • Drive cold profile/session hydration from effectiveDashboardUrl, not the optional Relay endpoint.
  • Add policy coverage for Dashboard publication before Gateway readiness.
  • Add an API 36 Compose/instrumentation regression that starts from profile/session hydration, holds the directory read, and proves the socket opens after exact-owner publication without session.resume, session.activate, prompt.submit, or session.interrupt.
  • Extend the vanilla Gateway fixture with the independent profile-scoped session-directory read used before passive socket observation.
  • Add an Unreleased changelog entry.

Verification

Exact PR head: 68fce1b1dabe1a8dd1f9f6a7a1999938dd1d09bb.

  • scripts/android-lane.ps1 gradle :app:testSideloadDebugUnitTest --tests 'com.hermesandroid.relay.runtime.HermesRuntimeBinderSessionDirectoryPolicyTest' --tests 'com.hermesandroid.relay.viewmodel.ChatViewModelGatewayInboundTurnTest' --console=plain — 128 tests passed; zero failures/errors/skips.
  • scripts/android-lane.ps1 gradle :app:testGooglePlayDebugUnitTest --tests 'com.hermesandroid.relay.runtime.HermesRuntimeBinderSessionDirectoryPolicyTest' --tests 'com.hermesandroid.relay.viewmodel.ChatViewModelGatewayInboundTurnTest' --console=plain — 128 tests passed; zero failures/errors/skips.
  • scripts/android-lane.ps1 gradle :app:compileSideloadDebugAndroidTestKotlin --console=plain — passed.
  • scripts/android-lane.ps1 gradle :app:standardPhoneApi36SideloadDebugAndroidTest '-Pandroid.testInstrumentationRunnerArguments.class=com.hermesandroid.relay.viewmodel.GatewayForegroundRecoveryInstrumentedTest#dashboardOnlyColdLaunch_waitsForExactDirectoryThenOpensObservationSocket' --rerun-tasks --console=plain — one API 36 test passed. The first invocation assembled successfully but the managed emulator package service returned an ADB streamed-install broken pipe and produced no test result; the clean retry is the claimed result.
  • scripts/android-lane.ps1 gradle :app:lintSideloadDebug :app:lintGooglePlayDebug :app:assembleSideloadDebug :app:assembleGooglePlayDebug --console=plain — passed.
  • python -m unittest discover -s test-fixtures/vanilla-gateway/tests -p 'test_*.py' — 28 tests passed.
  • python -m unittest scripts.tests.check_gateway_scenario_conformance_test — 8 tests passed.
  • python scripts/check-gateway-scenario-conformance.py <clean-current-upstream> --scenario-manifest test-fixtures/vanilla-gateway/vanilla_gateway/scenarios/cold_start_observation.json — passed against clean NousResearch/hermes-agent commit 6c3d4a4af70d76b7365bf19e9420ffdcbb9830ad; Gateway runtime and provider calls were not started.
  • python scripts/check-android-locales.py — 12 catalogs passed.
  • python scripts/check-user-docs-locales.py — five locales and five core pages passed.
  • python scripts/check-android-collection-apis.py — passed.
  • python scripts/check-android-release-notes.py — passed.
  • python scripts/check-version-tracks.py — passed.
  • git diff --check — passed.

Screenshots

No visual change.

Compatibility / risk

Current upstream keeps authenticated GET /api/sessions?profile=..., ticket minting, /api/ws, gateway.ready, and session.active_list independent. The official Dashboard/Desktop path opens the socket directly and reserves resume/activate for explicit session ownership. This change keeps Android on those upstream surfaces and adds no Hermes-Relay Plugin dependency or API/SSE fallback.

Route/credential ownership, profile/session generations, drafts/history, terminal auth and unsupported dispositions, bounded reconnect cooldowns, and lifecycle recovery are unchanged. The cold path remains socket-only after the exact directory barrier.

Physical Android 16 LAN/Tailscale certification remains outstanding. No phone install, release, deployment, merge, or issue mutation was performed.

Lineage / contributor credit

  • Source PR(s): fix(android): wake gateway on cold foreground #571 established visibility/client order independence; this follow-up covers the production directory-bootstrap path its manually bound tests bypassed.
  • Attribution preserved by: no contributor history was rewritten.

Checklist

  • Target branch is dev, unless this is a dev → main release PR or a focused production-tag hotfix PR to main
  • Scope is focused and related issues/PRs are linked
  • Android changes: lint, focused tests for both flavors, both debug assemblies, and focused API 36 instrumentation passed
  • Translation changes: N/A; locale validators also passed
  • Server/plugin changes: N/A
  • Desktop changes: N/A
  • Docs/site changes: changelog only; release-note and version checks passed
  • UI changes were tested on API 36; physical LAN/Tailscale acceptance remains explicitly outstanding
  • Commit messages follow Conventional Commits
  • CHANGELOG.md is updated for user-visible changes
  • Public writing hygiene checked: no secrets, private infrastructure, personal names, or AI/process narration
  • Salvaged/replacement work links source PRs and preserves contributor authorship, or N/A

@Codename-11
Codename-11 merged commit c27ee43 into dev Sep 12, 2026
14 checks passed
@Codename-11
Codename-11 deleted the fix/android-gateway-directory-bootstrap branch October 8, 2026 22:20
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