Make Mobile Bash the default mobile MCP surface - #38
Conversation
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
There was a problem hiding this comment.
1 issue found across 37 files
Not reviewed (too large): app/src/main/assets/mobile-bash-runtime.js (~1,656 lines) - if these are generated or fixture files, add them to ignored paths to exclude them from future reviews.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="app/src/main/java/ai/sealgate/stdiod/mcp/BluetoothModule.kt">
<violation number="1" location="app/src/main/java/ai/sealgate/stdiod/mcp/BluetoothModule.kt:1200">
P3: The 16/32-bit BLE UUID alias expansion is implemented twice: `canonicalGattUuid` in this module and `expandBluetoothUuid` in AndroidBluetoothSource.kt are the same `0x`-strip, pad-16-bit, expand-32-bit algorithm. The module canonicalizes every service/characteristic before calling the source, so the source copy is redundant on these paths, and the two can drift. Consolidate into one shared helper (e.g. a top-level utility) so alias handling stays in sync.</violation>
</file>
Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.
Re-trigger cubic
| isError = true, | ||
| ) | ||
|
|
||
| private fun canonicalGattUuid(raw: String): String? { |
There was a problem hiding this comment.
P3: The 16/32-bit BLE UUID alias expansion is implemented twice: canonicalGattUuid in this module and expandBluetoothUuid in AndroidBluetoothSource.kt are the same 0x-strip, pad-16-bit, expand-32-bit algorithm. The module canonicalizes every service/characteristic before calling the source, so the source copy is redundant on these paths, and the two can drift. Consolidate into one shared helper (e.g. a top-level utility) so alias handling stays in sync.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At app/src/main/java/ai/sealgate/stdiod/mcp/BluetoothModule.kt, line 1200:
<comment>The 16/32-bit BLE UUID alias expansion is implemented twice: `canonicalGattUuid` in this module and `expandBluetoothUuid` in AndroidBluetoothSource.kt are the same `0x`-strip, pad-16-bit, expand-32-bit algorithm. The module canonicalizes every service/characteristic before calling the source, so the source copy is redundant on these paths, and the two can drift. Consolidate into one shared helper (e.g. a top-level utility) so alias handling stays in sync.</comment>
<file context>
@@ -916,6 +1096,135 @@ class BluetoothModule(private val source: BluetoothControlSource) : BaseMcpModul
+ isError = true,
+ )
+
+ private fun canonicalGattUuid(raw: String): String? {
+ val compact = raw.trim().removePrefix("0x").lowercase()
+ val canonical = when {
</file context>
There was a problem hiding this comment.
1 issue found across 16 files (changes from recent commits).
Not reviewed (too large): app/src/main/assets/mobile-bash-runtime.js (~302 lines) - if these are generated or fixture files, add them to ignored paths to exclude them from future reviews.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="app/src/main/java/ai/sealgate/stdiod/tunnel/TunnelClient.kt">
<violation number="1" location="app/src/main/java/ai/sealgate/stdiod/tunnel/TunnelClient.kt:84">
P1: When the service restarts while a Mobile Bash call is executing, `stop()` returns before the old module and capability resources are closed. `TunnelService.connect()` then creates a replacement tunnel, allowing the old script and new tunnel to operate concurrently. Coordinate stop completion with replacement creation, or cancel in-flight module work before starting the new tunnel.</violation>
</file>
Requires human review: Auto-approval blocked because this review re-detected 1 unresolved issue already reported by Cubic.
Re-trigger cubic
| if (modulesClosed.compareAndSet(false, true)) { | ||
| // A QuickJS evaluation may hold its runtime lock until the 60-second | ||
| // execution limit. Never make the service/main thread wait for it. | ||
| thread(start = true, isDaemon = true, name = "mobile-mcp-close") { |
There was a problem hiding this comment.
P1: When the service restarts while a Mobile Bash call is executing, stop() returns before the old module and capability resources are closed. TunnelService.connect() then creates a replacement tunnel, allowing the old script and new tunnel to operate concurrently. Coordinate stop completion with replacement creation, or cancel in-flight module work before starting the new tunnel.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At app/src/main/java/ai/sealgate/stdiod/tunnel/TunnelClient.kt, line 84:
<comment>When the service restarts while a Mobile Bash call is executing, `stop()` returns before the old module and capability resources are closed. `TunnelService.connect()` then creates a replacement tunnel, allowing the old script and new tunnel to operate concurrently. Coordinate stop completion with replacement creation, or cancel in-flight module work before starting the new tunnel.</comment>
<file context>
@@ -76,10 +78,15 @@ class TunnelClient(
+ if (modulesClosed.compareAndSet(false, true)) {
+ // A QuickJS evaluation may hold its runtime lock until the 60-second
+ // execution limit. Never make the service/main thread wait for it.
+ thread(start = true, isDaemon = true, name = "mobile-mcp-close") {
+ modulesByName.values.filterIsInstance<AutoCloseable>().forEach { module ->
+ runCatching(module::close).onFailure {
</file context>
There was a problem hiding this comment.
All reported issues were addressed across 12 files (changes from recent commits).
Not reviewed (too large): app/src/main/assets/mobile-bash-runtime.js (~359 lines) - if these are generated or fixture files, add them to ignored paths to exclude them from future reviews.
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
|
Babysit complete at head 9549738.
|
Summary
Verification
Dashboard registration
Display name: Mobile Bash
MCP prefix: mobilebash
Command: mobile-builtin
Arguments: none
Summary by cubic
Makes Mobile Bash the default and only MCP surface on Android. The app now exposes one
mobilebashserver with a singleruntool instead of the five separate mobile modules, executing scripts in a pinnedjust-bashruntime inside QuickJS with an in-memory filesystem.What changed
run.stopreturns immediately while module teardown finishes in the background.Migration
mobilebashCLI commands.Mobile Bash, prefixmobilebash, and commandmobile-builtin.Written for commit 9549738. Summary will update on new commits.