Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "agent-task-queue"
version = "0.3.1"
version = "0.3.2"
description = "MCP server for sequential task execution via FIFO queue"
readme = "README.md"
requires-python = ">=3.10"
Expand Down
8 changes: 4 additions & 4 deletions task_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def get_memory_mb() -> float:


# --- Core Queue Logic ---
async def wait_for_turn(queue_name: str) -> int:
async def wait_for_turn(queue_name: str, command: str | None = None) -> int:
"""Register task, wait for turn, return task ID when acquired."""
# Ensure database exists and is valid
ensure_db()
Expand All @@ -250,8 +250,8 @@ async def wait_for_turn(queue_name: str) -> int:

with get_db() as conn:
cursor = conn.execute(
"INSERT INTO queue (queue_name, status, pid, server_id) VALUES (?, ?, ?, ?)",
(queue_name, "waiting", my_pid, SERVER_INSTANCE_ID),
"INSERT INTO queue (queue_name, status, pid, server_id, command) VALUES (?, ?, ?, ?, ?)",
(queue_name, "waiting", my_pid, SERVER_INSTANCE_ID, command),
)
task_id = cursor.lastrowid

Expand Down Expand Up @@ -440,7 +440,7 @@ async def run_task(
key, value = pair.split("=", 1)
env[key.strip()] = value.strip()

task_id = await wait_for_turn(queue_name)
task_id = await wait_for_turn(queue_name, command)
mem_before = get_memory_mb()

start = time.time()
Expand Down