Add Midday Computer: API, compute runtime, CLI, database, and integrations#886
Add Midday Computer: API, compute runtime, CLI, database, and integrations#886pontusab wants to merge 1 commit into
Conversation
…tions Introduces the full Midday Computer stack: MCP computer tools, REST API routes (orchestrator, catalog, stubs), the compute worker runtime with secure sandbox execution, BullMQ job processing, scheduler, CLI commands, database schema and migrations, job client, and notification types. Made-with: Cursor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0d87898. Configure here.
| }); | ||
|
|
||
| return c.json({ data: agent }, 201); | ||
| }); |
There was a problem hiding this comment.
REST confirm endpoint accepts arbitrary unvalidated code for execution
High Severity
The /agents/confirm REST endpoint and computer_agent_confirm MCP tool accept a raw code string from the client and store it directly in the database for later execution by the compute runtime. Unlike generateAgentFromDescription, which type-checks and compiles the code before returning it, these endpoints perform no validation, sandboxing pre-check, or verification that the code actually came from the generation step. Any authenticated user can deploy arbitrary JavaScript that will be executed by the compute worker with full MCP tool access.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 0d87898. Configure here.
| ...agentMeta, | ||
| code: compiled.js, | ||
| compiledCode: compiled.js, | ||
| }; |
There was a problem hiding this comment.
Generated agent loses TypeScript source, duplicates compiled output
Medium Severity
In generateAgentFromDescription, the return value spreads agentMeta (which contains the original code field from the LLM — TypeScript source) but then immediately overwrites code with compiled.js. Both code and compiledCode end up holding the same compiled JavaScript. The original TypeScript source is lost, making it impossible for users to review or edit the generated agent's source code after generation.
Reviewed by Cursor Bugbot for commit 0d87898. Configure here.
| return; | ||
| } | ||
| logger.info("Acquired scheduler lock"); | ||
| } |
There was a problem hiding this comment.
Scheduler lock not re-validated after initial acquisition
Medium Severity
Once hasLock is set to true, the scheduler never re-validates it against the database. If the lock expires or is released (e.g., due to a database failover or connection reset), the in-memory hasLock flag remains true, so refreshSchedules skips re-acquisition. This means the instance continues scheduling jobs even though another instance may have taken over the lock, leading to duplicate scheduled runs.
Reviewed by Cursor Bugbot for commit 0d87898. Configure here.


Note
High Risk
Adds a new production service that executes generated code and triggers write actions via automation, plus broad changes to MCP tool output schemas that could break tool clients or agent code generation if mismatched.
Overview
Adds Midday Computer agents end-to-end: a new REST router (
/computer) and MCP tool suite (computer_*) to list catalog agents, enable/deploy generated agents, trigger runs, and inspect run history/proposals.Introduces a new
apps/computeservice (Docker/Railway-deployable) that consumes a BullMQcomputequeue to execute agent code in a sandbox (secure-exec), supports scheduled runs via cron + DB lock, records step logs/memory, and implements an approval workflow by persisting proposed actions and replaying them after approval.Hardens MCP tool schemas across many domains by replacing
record(any)outputs with typed Zod schemas, adding a sharedmcpListMetaSchema, and improving structured outputs for several write/destructive operations (e.g., invoices send/remind responses, recurring invoice preview sanitization). CI/CD is updated to detect/deploy the new@midday/computeservice in staging and production, and the dashboard chat UI recognizescomputer_*tool calls.Reviewed by Cursor Bugbot for commit 0d87898. Bugbot is set up for automated code reviews on this repo. Configure here.