Rudder with RUDDER_ENGINE=0 never starts the engine, and a page on another machine never offers to record the server's mic

A server where Rudder is laptop-only (RUDDER_ENGINE=0) no longer starts a
leftover engine binary. If an engine that records its own machine's microphone
is reached from another machine anyway, Rudder shows the laptop notice and
disables Record instead of recording the server.
This commit is contained in:
Doxa Maps 2026-09-27 23:24:08 +00:00
parent 9b150b902d
commit bac8a1048c
2 changed files with 14 additions and 4 deletions

View file

@ -33,6 +33,9 @@ export const DEV_BACKENDS = [
// This server is SUPPOSED to run the engine (a server deployment with the engine switched on): while it
// is down, the plugin says "not running yet" instead of "runs on your own computer".
expected: () => process.env.RUDDER_ENGINE === '1' || process.env.RUDDER_AUDIO === 'browser',
// RUDDER_ENGINE=0 (a server where Rudder is laptop-only, the Driver 2026-09-27): never start it, even if a
// binary built by an earlier engine-on deploy is still there — it would offer to record a server's mic.
disabled: () => process.env.RUDDER_ENGINE === '0',
},
]
@ -117,6 +120,10 @@ export function backendDevPlugin(root) {
logger.info(`[${b.name}] still running → ${b.route} (kept across the dev-server restart)`)
continue
}
if (b.disabled && b.disabled()) {
logger.info(`[backend] ${b.name} switched off here (${b.name === 'rudder-engine' ? 'RUDDER_ENGINE=0' : 'disabled'})`)
continue
}
if (!existsSync(resolve(root, b.bin))) {
logger.warn(`[backend] ${b.name} not built — its plugin will show "engine offline". Build: ${b.build}`)
continue

View file

@ -382,6 +382,9 @@ const audioMode = ref('local')
// The server is set up to run the engine (it reports expected=true while the engine is down): an absent
// engine there means "starting or failed to set up", not "this only runs on your computer".
const engineExpected = ref(false)
// An engine that records ITS OWN machine's microphone, reached from another machine: it would record the
// server, not this reader, so the page treats it as laptop-only.
const remoteLocalMic = computed(() => audioMode.value === 'local' && !onOwnComputer.value && engine.value === 'ready')
let sock = null, media = null, actx = null
async function startBrowser() {
@ -586,7 +589,7 @@ watch([draft, recording], queueActivity)
const statusText = computed(() => ({
connecting: 'Connecting…',
starting: 'Loading speech model… (about 20 s the first time)',
ready: recording.value ? 'Listening' : 'Ready',
ready: remoteLocalMic.value ? 'Runs on your computer' : recording.value ? 'Listening' : 'Ready',
error: 'Engine error',
offline: onOwnComputer.value ? 'Engine offline' : engineExpected.value ? 'Not running yet' : 'Runs on your computer',
}[engine.value] || engine.value))
@ -647,7 +650,7 @@ const statusText = computed(() => ({
<button
class="mic"
:class="{ on: recording }"
:disabled="busy || engine !== 'ready'"
:disabled="busy || engine !== 'ready' || remoteLocalMic"
:aria-pressed="recording"
:aria-label="recording ? 'Stop recording' : 'Start recording'"
@click="toggle"
@ -689,7 +692,7 @@ const statusText = computed(() => ({
<p v-else-if="engine === 'offline' && !onOwnComputer && engineExpected" class="notice" data-kind="warn">
The voice engine on this server isn't running yet (it is starting, or it failed to set up). Try again in a minute.
</p>
<p v-else-if="engine === 'offline' && !onOwnComputer" class="notice" data-kind="warn">
<p v-else-if="(engine === 'offline' || remoteLocalMic) && !onOwnComputer" class="notice" data-kind="warn">
Voice to text runs on your own computer, not on this server: it listens to the microphone of the machine
the engine runs on. Open the Plugin Studio on your computer (<code>bun run dev</code>) or use the Rudder desktop app.
</p>
@ -719,7 +722,7 @@ const statusText = computed(() => ({
v-if="compact"
class="mic sm"
:class="{ on: recording }"
:disabled="busy || engine !== 'ready'"
:disabled="busy || engine !== 'ready' || remoteLocalMic"
:aria-pressed="recording"
:aria-label="recording ? 'Stop recording' : 'Start recording'"
@click="toggle"