{"record":{"id":"2b82109f0f0f6c95","repo":"moeru-ai/airi","slug":"computer-use-routing-and-storage-are-managed-by-airi","errorCode":null,"errorMessage":"Computer use routing and storage are managed by AIRI.","messagePattern":"Computer use routing and storage are managed by AIRI\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/stage-tamagotchi/src/main/services/airi/computer-use/runtime.ts","lineNumber":93,"sourceCode":"    const next = queue.then(() => {\n      if (disposed)\n        throw new Error('Computer use has stopped.')\n      return operation()\n    })\n    // A failed command must not prevent later commands from running.\n    queue = next.then(() => undefined, () => undefined)\n    return next\n  }\n\n  async function run(input: unknown): Promise<ComputerUseResult> {\n    const { argv } = v.parse(inputSchema, input)\n    if (argv[0] !== 'invoke' || !/^(?:--help|-h|help|(?:app|display|screen|window|input|mediaControl)\\.[a-zA-Z]+)$/.test(argv[1]))\n      throw new Error('Use invoke with a desktop command or --help.')\n\n    // The host owns routing and artifact storage. CLI global flags must not replace them.\n    const managedFlags = ['--store-root', '--endpoint', '--device', '--device-id', '--run', '--config', '--profile', '--discovery-file', '--pairing-store']\n    if (argv.some(arg => managedFlags.some(flag => arg === flag || arg.startsWith(`${flag}=`))))\n      throw new Error('Computer use routing and storage are managed by AIRI.')\n\n    return enqueue(async () => {\n      const active = await connect()\n      const command = [...argv]\n      if (!command.includes('--json') && !command.includes('--help') && !command.includes('-h') && command[1] !== 'help')\n        command.push('--json')\n      command.push('--store-root', options.storeRoot)\n      let stdout: string\n      let stderr: string\n      let exitCode = 0\n      try {\n        ({ stdout, stderr } = await execFileAsync(options.binaryPath, command, {\n          env: { ...process.env, AUV_ENDPOINT: active.connectionOptions.endpoint, AUV_CONTEXT: undefined },\n          encoding: 'utf8',\n          timeout: 120000,\n          maxBuffer: 4 * 1024 * 1024,\n          windowsHide: true,\n          signal: abort.signal,","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/moeru-ai/airi/blob/438a067dde47aa0bdb46c2323d1fe293dc805218/apps/stage-tamagotchi/src/main/services/airi/computer-use/runtime.ts#L75-L111","documentation":"run() rejects any CLI global flag that would override host-managed routing or storage (--store-root, --endpoint, --device, --device-id, --run, --config, --profile, --discovery-file, --pairing-store), both in 'flag value' and 'flag=value' form. AIRI owns these settings, so caller-supplied values are not allowed.","triggerScenarios":"Appending flags like --store-root=/tmp or --endpoint=... to the argv passed to run(), even when the command itself is valid.","commonSituations":"Reusing raw CLI snippets from documentation; an LLM hallucinating extra flags; trying to point the CLI at a custom daemon or store.","solutions":["Remove all managed flags from argv; rely on AIRI's own store/endpoint configuration","If you need a different store or endpoint, change it through AIRI's computer-use settings, not the CLI args","Strip/normalize LLM-generated argv before calling run"],"exampleFix":"// before\nawait run({ argv: ['invoke', 'screen.capture', '--store-root=/tmp/shots'] })\n// after\nawait run({ argv: ['invoke', 'screen.capture'] })","handlingStrategy":"validation","validationCode":"const MANAGED = ['--store-root','--endpoint','--device','--device-id','--run','--config','--profile','--discovery-file','--pairing-store']nfunction hasManagedFlag(argv: string[]): boolean {\n  return argv.some(a => MANAGED.some(f => a === f || a.startsWith(`${f}=`)))\n}","typeGuard":null,"tryCatchPattern":"try {\n  return await run({ argv })\n} catch (e) {\n  if (e instanceof Error && e.message.includes('managed by AIRI')) {\n    console.warn('Strip host-managed flags; configure routing via AIRI settings')\n    return null\n  }\n  throw e\n}","preventionTips":["Never pass global CLI flags; configure store/endpoint via the host settings instead","Filter argv through a flag-stripper before calling run","When relaying user-provided commands, reject managed flags up front with a clear message"],"tags":["security","cli","forbidden-flag"],"backgroundTag":"conflicting-config-options","analyzedSha":"438a067dde47aa0bdb46c2323d1fe293dc805218","analyzedAt":"2026-09-17T01:14:42.644Z","contentChangedAt":"2026-09-17T01:14:42.644Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}