A real queue between agents: fair order, visible position, and the action continues by itself when it is its turn
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 34/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, swift
Hướng nghiên cứu
Read mcp-server/programlaas.js, mcp-server/godkend.js, and mcp-server/index.js to trace the existing app and screen locks, then inspect mcp-server/audit.js and mcp-server/status.js for waiting state. Start with the concurrency tests in test/parallel.mjs, test/concurrent.mjs, and test/samtidige-agenter.mjs; the acceptance criteria describe FIFO order, automatic continuation, cancellation, progress, and queue status, each with tests. The proposed design is open for discussion, so agree on a scoped piece before implementation.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Why
Several agents running at once is one of the things computer-mcp does that most computer-use servers do not. Today, though, the "queue" between them is really a set of locks and refusals, and the agent has to keep retrying by itself. When two agents want the same app, or the screen, the one that loses has no idea how long it will wait, where it is in line, or whether it should come back. That wastes tokens and time and makes multi-agent setups feel flaky.
We would like a real queue: fair, visible, cancellable, and one that continues the action by itself once it is its turn, instead of telling the agent to "ask again in a moment".
How it works today
- Per-app lock -
mcp-server/programlaas.js(medProgramLaas). One lock file per app under~/.local/state/computer-mcp/laase/, created withO_EXCL. A waiting server polls every 40 ms. There is no order: whoever wins the nextopenSyncgoes first, so a server that has waited 50 s can lose to one that just arrived. The wait is capped atmin(60_000, restMs())(mcp-server/index.js, around themedProgramLaas(targetBundleId || '_global', ...)call), after which the call ends with "nothing was done". - The screen -
laanSkaermeninmcp-server/godkend.js. When another agent holds the screen, the call can end withkoe: true, andindex.jsreturnsRefused: ... Nobody said no - ask again in a moment; the screen goes to one agent at a time.The agent must poll. - What is waiting -
noterVentende/ventendeinmcp-server/audit.jsappend topending.jsonl, andcomputer_pendingreturns the last 20 lines. Entries are never marked as resolved, so the list says what was waiting, not what is. - Cancellation already exists and must keep working:
kaldAfbrudt()/kaldStoppet()(client cancel, "Stop all agents now").
Proposed approach (open for discussion)
- Ticket-based FIFO per app (and one for the screen): on arrival a server takes a monotonic ticket (e.g. a file
laase/<app>.q/<seq>-<pid>), and the lock goes to the lowest live ticket. Keep the two properties the current lock has on purpose: it fails closed if the lock cannot be taken, and a stale owner is only broken when its pid is provably dead - never after a timeout. - Wait instead of refuse, and keep the call alive: if the client sent a
progressToken, sendnotifications/progresswhile waiting ("2nd in line for Slack"), so the call is not cut off by the client's ~60 s timeout. Without a token, keep today's behaviour but return the queue position and an estimate, so the agent can decide. - Auto-continue: when the ticket reaches the front, the action runs in the same call - re-checking everything inside the lock as today (target, log writable, person idle). This is only for waits that need no human yes; approvals keep their existing rules ("a yes counts once, for exactly that action").
- Visible: show waiting agents in the menu bar box/dropdown (
status.jsalready writes per-session status files), and letcomputer_pendingreport state (waiting/done/refused/cancelled) rather than raw history. - Backpressure: a max queue length per app; beyond it, refuse at once with a clear reason.
Acceptance criteria
- Two or more servers waiting for the same app are served in arrival order (test alongside
test/parallel.mjs/test/samtidige-agenter.mjs). - A queued call that reaches the front performs its action without the agent calling again, and the audit log shows one coherent sequence (
waited->allowed/performed). - Cancelling a queued call (client cancel or "Stop all agents now") removes its ticket and nothing is done.
- A crashed server's ticket is removed only when its pid is gone.
- Progress notifications are sent when a
progressTokenis present. -
computer_pendingdistinguishes waiting from finished entries. - Per CONTRIBUTING: each new guarantee has a test, and the PR shows it going red under a mutation.
Pointers
mcp-server/programlaas.js, mcp-server/godkend.js (laanSkaermen), mcp-server/index.js (skaermLaan, the medProgramLaas call), mcp-server/audit.js (noterVentende, ventende), mcp-server/status.js, test/parallel.mjs, test/concurrent.mjs, test/samtidige-agenter.mjs, test/skaerm-laan.mjs.
This is one of the most impactful things to build right now. If you want to take it - or just a piece of it, like the FIFO lock - say so in a comment and we will help you get started. Design discussion in this thread is very welcome before any code.
Related: #18 (the server and icon switch on by themselves when something lands in the queue) and #25 (hands-free and voice use).
- Ngôn ngữ chính
- JavaScript
- Star
- 1
- Fork
- 0
- Merge trung bình
- 1 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 9
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Agent360dk/computerMCP
-
Recipes for the native Mac apps everyone uses (Finder, Mail, Notes, System Settings, Safari, ...)Đang mởgood first issue recipe
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Agent360dk/computerMCP#21 ·
-
Setup guides for more MCP clients: Zed, Windsurf, Continue, LM Studio, Cline, Goose, RaycastĐang mởdocumentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Agent360dk/computerMCP#20 ·
-
good first issue help wanted protection-list
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 94/100
-
enhancement help wanted
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Agent360dk/computerMCP#25 ·
-
Serve recipes as MCP resources, so every agent reads the right recipe before it drives an appĐang mởenhancement help wanted
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 50/100
Agent360dk/computerMCP#24 ·
Tất cả issue của Agent360dk/computerMCP
Issue tương tự
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:auth-provider issue-rating: 🦞 diamond lobster no-stale P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
openclaw/clawrouter#1348 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Missing repro Platform: Android
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
software-mansion/react-native-reanimated#11554 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[DOCS]: Correct ESM initialization in the README examplesCó thể đã có người làm @VIOLETee0 đã nhận hôm nay. Đang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
octokit/graphql.js#716 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
directus/directus#28558 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày