[PR #7460] [MERGED] fix(claude-subscription): use any installed claude on Android #7744

Closed
opened 2026-10-24 04:07:04 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7460
Author: @qrewq5003-oss
Created: 10/12/2026
Status: ✅ Merged
Merged: 10/12/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/claude-subscription-termux-cli


📝 Commits (7)

  • 5889d81 fix(claude-subscription): use any installed claude on Android
  • 00162c3 Merge remote-tracking branch 'origin/staging' into fix/claude-subscription-termux-cli
  • d093b6c fix(claude-subscription): prefer a current install on Android too
  • 99d6985 fix(claude-subscription): stop the request when Claude Code loads claude.ai connectors
  • a0c4e22 fix(claude-subscription): tell Android only to update Claude Code
  • e564b12 Merge origin/staging into fix/claude-subscription-termux-cli
  • 2b0fa3b Merge branch 'staging' into fix/claude-subscription-termux-cli

📊 Changes

6 files changed (+202 additions, -45 deletions)

View changed files

📝 .env.example (+3 -1)
📝 docs/CONFIGURATION.md (+13 -13)
📝 packages/server/src/routes/connections.routes.ts (+14 -2)
📝 packages/server/src/services/llm/providers/claude-subscription.provider.ts (+39 -17)
📝 packages/server/src/services/llm/providers/claude-subscription/installed-cli.ts (+10 -6)
📝 scripts/regressions/claude-subscription-installed-cli.regression.ts (+123 -6)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #7459

Why this change

  • On Android (Termux), the Agent SDK has no bundled Claude Code build. Its optional dependencies cover only linux, darwin and win32, so falling back to the bundled copy fails with "Native CLI binary for android-arm64 not found".
  • findClaudeCodeInstall() picks the host claude only when its version is at least the bundled version, and returns nothing when the bundled version is unknown. On Termux, a host install that is older than the bundled copy (common after an SDK bump, before the host install auto-updates) therefore breaks Claude (Subscription) entirely, even though it is the only build that can run there.

What changed

  • installed-cli.ts: on process.platform === "android", accept any installed claude and skip the bundled-version floor. Other platforms are unchanged, and CLAUDE_SUBSCRIPTION_USE_INSTALLED_CLI=false is still honored.
  • claude-subscription-installed-cli.regression.ts: add Android cases (an older host install and an unknown bundled version). Existing cases now pin platform: "linux" so the suite gives the same result when it runs on Termux.
  • CHANGELOG.md: user-facing entry under [Unreleased]. Removed when staging was merged in: PRs no longer add changelog entries (maintainer policy, 2026-10-12); the changelog is written at release time.

Maintainer follow-up commits:

  • Merged origin/staging to resolve the CHANGELOG.md conflict by dropping this PR's entry.
  • installed-cli.ts: on Android, still prefer an install that is at least as new as the bundled version when one exists, and fall back to the first older install only when none is. Before this, a stale ~/.local/bin/claude could shadow an up-to-date claude later on PATH.
  • claude-subscription-installed-cli.regression.ts: Android cases for "a current install found after an older one wins" and "CLAUDE_SUBSCRIPTION_USE_INSTALLED_CLI=false still holds".

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

What the agent ran (Termux, Android 12, arm64):

  • node ./scripts/run-regressions.mjs --filter scripts/regressions/claude-subscription-installed-cli passes. It fails on the new Android assertion with the installed-cli.ts change reverted.
  • tsc --noEmit in packages/server reports no errors in the changed files. A full pnpm check was not run: pnpm is not installed on this device, and the temporary worktree type-checked against an older @marinara-engine/shared, which caused unrelated errors.
  • Live check on v2.5.0 with an equivalent patch (passing the host claude path to the SDK): Test Connection, Send Test Message and Diagnose Model Routing succeed on claude-opus-5-5, where all three failed before with the error above.
  • Local CodeRabbit review was not run (CLI not available on this device).

What the maintainer-side agent ran after the follow-up commits (macOS, arm64):

  • pnpm check exits 0.
  • node ./scripts/run-regressions.mjs --filter claude-subscription passes (2/2). The new "current install found after an older one" assertion fails against the earlier version of this branch.
  • Local CodeRabbit (--committed against the staging merge base) reported no findings.
  • Verified by me on Termux (Android 12, arm64)
    on v2.5.0 with an equivalent patch: Test
    Connection and Send Test Message pass.

Still to verify manually:

  • Manually verify on Termux with this branch that a Claude (Subscription) connection passes Test Connection and Send Test Message.
  • Manually verify on desktop Linux/macOS/Windows that the installed-vs-bundled selection is unchanged (an older host claude still falls back to the bundled build).

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

No files under docs/ are touched, and the CHANGELOG.md entry was dropped (see above). docs/CONFIGURATION.md and .env.example describe CLAUDE_SUBSCRIPTION_USE_INSTALLED_CLI as using the installed copy "when it is at least as new as the copy bundled with Marinara", which no longer covers Android; left for a maintainer decision.

UI evidence (if applicable)

No UI changes.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Android can use an installed Claude Code copy even when it is older than the bundled version or no bundled version is available. The opt-out setting remains respected.
    • Requests stop with an explanatory error when Claude Code reports exposed connectors or tools, rather than continuing with that configuration.
  • Documentation
    • Clarified that Android requires the installed-CLI setting to remain enabled because no bundled Claude Code copy is available.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/7460 **Author:** [@qrewq5003-oss](https://github.com/qrewq5003-oss) **Created:** 10/12/2026 **Status:** ✅ Merged **Merged:** 10/12/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/claude-subscription-termux-cli` --- ### 📝 Commits (7) - [`5889d81`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5889d81a59157f34dc5acdf3edfda8f64b5caa10) fix(claude-subscription): use any installed claude on Android - [`00162c3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/00162c3115ab8200f17a172be845fd860b063abe) Merge remote-tracking branch 'origin/staging' into fix/claude-subscription-termux-cli - [`d093b6c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d093b6c5f9b67ac8f96231df252b7b0da2b6add9) fix(claude-subscription): prefer a current install on Android too - [`99d6985`](https://github.com/Pasta-Devs/Marinara-Engine/commit/99d69856887e3e5c39628185a85f7faba6514a0c) fix(claude-subscription): stop the request when Claude Code loads claude.ai connectors - [`a0c4e22`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a0c4e220981dbf20ab94b6ebe1f5ccb3c96169bb) fix(claude-subscription): tell Android only to update Claude Code - [`e564b12`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e564b1239e3b7693a813a7587a42c7ed1bca87f8) Merge origin/staging into fix/claude-subscription-termux-cli - [`2b0fa3b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2b0fa3bff5486192b7df2a78fd5b251bb31535a7) Merge branch 'staging' into fix/claude-subscription-termux-cli ### 📊 Changes **6 files changed** (+202 additions, -45 deletions) <details> <summary>View changed files</summary> 📝 `.env.example` (+3 -1) 📝 `docs/CONFIGURATION.md` (+13 -13) 📝 `packages/server/src/routes/connections.routes.ts` (+14 -2) 📝 `packages/server/src/services/llm/providers/claude-subscription.provider.ts` (+39 -17) 📝 `packages/server/src/services/llm/providers/claude-subscription/installed-cli.ts` (+10 -6) 📝 `scripts/regressions/claude-subscription-installed-cli.regression.ts` (+123 -6) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue Closes #7459 ## Why this change - On Android (Termux), the Agent SDK has no bundled Claude Code build. Its optional dependencies cover only linux, darwin and win32, so falling back to the bundled copy fails with "Native CLI binary for android-arm64 not found". - `findClaudeCodeInstall()` picks the host `claude` only when its version is at least the bundled version, and returns nothing when the bundled version is unknown. On Termux, a host install that is older than the bundled copy (common after an SDK bump, before the host install auto-updates) therefore breaks **Claude (Subscription)** entirely, even though it is the only build that can run there. ## What changed - `installed-cli.ts`: on `process.platform === "android"`, accept any installed `claude` and skip the bundled-version floor. Other platforms are unchanged, and `CLAUDE_SUBSCRIPTION_USE_INSTALLED_CLI=false` is still honored. - `claude-subscription-installed-cli.regression.ts`: add Android cases (an older host install and an unknown bundled version). Existing cases now pin `platform: "linux"` so the suite gives the same result when it runs on Termux. - ~~`CHANGELOG.md`: user-facing entry under `[Unreleased]`.~~ Removed when `staging` was merged in: PRs no longer add changelog entries (maintainer policy, 2026-10-12); the changelog is written at release time. Maintainer follow-up commits: - Merged `origin/staging` to resolve the `CHANGELOG.md` conflict by dropping this PR's entry. - `installed-cli.ts`: on Android, still prefer an install that is at least as new as the bundled version when one exists, and fall back to the first older install only when none is. Before this, a stale `~/.local/bin/claude` could shadow an up-to-date `claude` later on PATH. - `claude-subscription-installed-cli.regression.ts`: Android cases for "a current install found after an older one wins" and "`CLAUDE_SUBSCRIPTION_USE_INSTALLED_CLI=false` still holds". ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes What the agent ran (Termux, Android 12, arm64): - `node ./scripts/run-regressions.mjs --filter scripts/regressions/claude-subscription-installed-cli` passes. It fails on the new Android assertion with the `installed-cli.ts` change reverted. - `tsc --noEmit` in `packages/server` reports no errors in the changed files. A full `pnpm check` was **not** run: pnpm is not installed on this device, and the temporary worktree type-checked against an older `@marinara-engine/shared`, which caused unrelated errors. - Live check on v2.5.0 with an equivalent patch (passing the host `claude` path to the SDK): **Test Connection**, **Send Test Message** and **Diagnose Model Routing** succeed on `claude-opus-5-5`, where all three failed before with the error above. - Local CodeRabbit review was not run (CLI not available on this device). What the maintainer-side agent ran after the follow-up commits (macOS, arm64): - `pnpm check` exits 0. - `node ./scripts/run-regressions.mjs --filter claude-subscription` passes (2/2). The new "current install found after an older one" assertion fails against the earlier version of this branch. - Local CodeRabbit (`--committed` against the `staging` merge base) reported no findings. - Verified by me on Termux (Android 12, arm64) on v2.5.0 with an equivalent patch: Test Connection and Send Test Message pass. Still to verify manually: - Manually verify on Termux with this branch that a Claude (Subscription) connection passes **Test Connection** and **Send Test Message**. - Manually verify on desktop Linux/macOS/Windows that the installed-vs-bundled selection is unchanged (an older host `claude` still falls back to the bundled build). ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) No files under `docs/` are touched, and the `CHANGELOG.md` entry was dropped (see above). `docs/CONFIGURATION.md` and `.env.example` describe `CLAUDE_SUBSCRIPTION_USE_INSTALLED_CLI` as using the installed copy "when it is at least as new as the copy bundled with Marinara", which no longer covers Android; left for a maintainer decision. ## UI evidence (if applicable) No UI changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Android can use an installed Claude Code copy even when it is older than the bundled version or no bundled version is available. The opt-out setting remains respected. * Requests stop with an explanatory error when Claude Code reports exposed connectors or tools, rather than continuing with that configuration. * **Documentation** * Clarified that Android requires the installed-CLI setting to remain enabled because no bundled Claude Code copy is available. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:07:04 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#7744
No description provided.