Skip to content

watcher: directory-type subscriptions always fail on android ("backend not supported"), file/entries fall back fine #58503

Open

Description

@jayfinklegotmoney

Summary

Every type=directory watcher subscription on native Android/Termux logs level=ERROR message="watcher backend not supported" directory=<path> platform=android role=server: there is no directory-watcher backend for platform=android, while type=file / type=entries subscriptions on the same platform start normally with backend=node. Each serve start produces one ERROR per directory watch (config dir, ~/.opencode, agents/skills stores), so daily restarts generate steady error noise — and, functionally, no live reload for those directories.

Environment

  • opencode version: 2.0.22
  • OS: Linux 6.6.127-android15-8 (android arm64, native Termux/Bionic — not proot)
  • Terminal: xterm-256color, COLORTERM=truecolor
  • Shell: Termux bash
  • Install/channel: release ("latest"; single-binary bun bundle installed at <prefix>/opt/fink-opencode/current/bin/opencode)
  • Active plugins: none configured

Reproduction

  1. Run opencode serve --service natively on Android/Termux (arm64, Bionic).
  2. Within the first second of serve start, read the server log.
  3. Count message="watcher backend not supported" lines vs message="watcher started" lines by type=.
  4. Restart serve and repeat — counts reproduce each time.

Expected Behavior

Directory-type subscriptions either start on android or degrade the same way file/entries subscriptions do (to backend=node). At minimum, a WARN instead of ERROR.

Actual Behavior

One ERROR per directory watch per serve start. Two verified serve starts in one day burst 31 then 21 errors; the count tracks the directory set being watched (10 fewer after a skills-store reorg between the runs). Example line shape (paths not sensitive):

timestamp=… level=ERROR run=… message="watcher backend not supported" directory=…/.config/opencode platform=android role=server

Adjacent, in the same second, healthy lines like:

timestamp=… level=INFO message="watcher started" path=…/.config type=entries ignores=3 backend=node

Verified over the full log window: 52 ERROR lines vs 0 message="watcher started" … type=directory successes (success counter anchored on message= to exclude self-referential diagnostic echoes).

Additional Context

  • Not symlinks: real (non-symlink) directories error identically (~/.config/opencode, ~/.opencode, real skills-store dirs). Only the skill entries inside one store are symlinks; the failing subscribes are the parent directories.
  • Fallback logic exists: file and entries subscriptions successfully start with backend=node on this platform — bundled-code inspection shows backend selection tracked by descriptor type, so it is the directory type that lacks an android fallback, not missing kernel support.
  • watcher.ignore cannot filter these: the failing subscriptions carry ignores=3 (hardcoded ["node_modules",".git","**/{node_modules,.git}/**"] for config dirs) or ignores=0 (skills stores); the config list feeds only the project-watcher transform, never these subscribes.
  • Functional impact: skills/config hot-reload is silently dead on android until the next serve restart; startup loading itself is unaffected (our store verifier resolves 18/18 skills across the same stores).
  • Local workaround: none possible via config — we run a fail-neutral census (watcher census (android): noise=N dir-watches-started=0) and restart serve after skill changes.
  • Request: an android fallback for directory-type watches (reuse the node backend already used by entries/file), or demote the message to WARN.
  • Secondary same-platform flag (not this bug): 5× Failed to fetch models.dev TimeoutError in the same window while curl https://models.dev from the same device returns HTTP 302 in 0.15s — suggests the android HTTP path may deserve its own look; filed separately to keep this report focused.
  • Unrelated errors present in the same window (excluded from this report): free-tier quota Failed to drain Session lines.

Activity

  1. opencode-agent commented on Oct 23, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed report and the log counts.

    What you're asking for, as I understand it: on Android/Termux, type=directory watches should either work (for example by falling back to Node's watcher, like file/entries already do) or at least log at WARN instead of ERROR. That would bring back live reload for config and skills directories.

    Android isn't currently a supported platform, so I'm treating this as a feature request rather than a bug. In the current code, file and entries watches always use Node's fs.watch, which is why they show backend=node on every platform. directory watches use the native recursive watcher (@parcel/watcher), which only has backends for Windows, macOS and Linux. On Android, process.platform is android, so no backend is selected and the watch is skipped with that ERROR line. That matches what you saw.

    This can't be worked around with a plugin, since the plugin API has no way to supply a watcher backend. The maintainers will consider the request. Related issues:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions