Skip to content

Commit f19feaf

Browse files
mttmcknnclaude
andcommitted
Store command in database when using MCP run_task tool
The MCP server was not storing the command in the queue database, while the CLI (tq.py) was. This caused the prism plugin to fall back to showing just task counts instead of the actual command being run. - Add command parameter to wait_for_turn function - Include command in INSERT statement - Pass command from run_task to wait_for_turn Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent fbede33 commit f19feaf

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

task_queue.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def get_memory_mb() -> float:
231231

232232

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

251251
with get_db() as conn:
252252
cursor = conn.execute(
253-
"INSERT INTO queue (queue_name, status, pid, server_id) VALUES (?, ?, ?, ?)",
254-
(queue_name, "waiting", my_pid, SERVER_INSTANCE_ID),
253+
"INSERT INTO queue (queue_name, status, pid, server_id, command) VALUES (?, ?, ?, ?, ?)",
254+
(queue_name, "waiting", my_pid, SERVER_INSTANCE_ID, command),
255255
)
256256
task_id = cursor.lastrowid
257257

@@ -440,7 +440,7 @@ async def run_task(
440440
key, value = pair.split("=", 1)
441441
env[key.strip()] = value.strip()
442442

443-
task_id = await wait_for_turn(queue_name)
443+
task_id = await wait_for_turn(queue_name, command)
444444
mem_before = get_memory_mb()
445445

446446
start = time.time()

0 commit comments

Comments
 (0)