feat(mcp): expose startup_script as direct parameter on update_ticket

Allows agents to set an explicit startup script without triggering a
title/description/type change. Auto-generation still fires when those
fields change and startup_script is not provided.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
caoimhinr 2026-05-29 16:39:42 +02:00
parent 6e2c62288d
commit dd4eaa6f77

View file

@ -225,6 +225,7 @@ def update_ticket(
status: str = "", status: str = "",
type: str = "", type: str = "",
user: str = "", user: str = "",
startup_script: str = "",
parent_id: int = -1, parent_id: int = -1,
effort: int = -1, effort: int = -1,
environment_id: int = -1, environment_id: int = -1,
@ -240,6 +241,10 @@ def update_ticket(
status: open, ongoing, completed, abandoned. status: open, ongoing, completed, abandoned.
type: feature, bug, chore, project. type: feature, bug, chore, project.
user: kevin or claude. user: kevin or claude.
startup_script: Override the auto-generated claude startup command.
Pass the full claude "..." --allowedTools "..." string.
When omitted but title/description/type changes, the
script is regenerated automatically.
parent_id: Set parent ticket ID; pass 0 to clear the parent. parent_id: Set parent ticket ID; pass 0 to clear the parent.
Omit (default -1) to leave unchanged. Omit (default -1) to leave unchanged.
effort: Effort rating 110; pass 0 to clear it. effort: Effort rating 110; pass 0 to clear it.
@ -259,11 +264,16 @@ def update_ticket(
body["effort"] = effort if effort > 0 else None body["effort"] = effort if effort > 0 else None
if environment_id >= 0: if environment_id >= 0:
body["environment_id"] = environment_id if environment_id > 0 else None body["environment_id"] = environment_id if environment_id > 0 else None
if not body: if not body and not startup_script:
raise ValueError("Provide at least one field to update") raise ValueError("Provide at least one field to update")
with _client() as c: with _client() as c:
ticket = _check(c.patch(f"/api/tickets/{ticket_id}", json=body)) if body:
if title or description or type: ticket = _check(c.patch(f"/api/tickets/{ticket_id}", json=body))
else:
ticket = _check(c.get(f"/api/tickets/{ticket_id}"))
if startup_script:
ticket = _check(c.patch(f"/api/tickets/{ticket_id}", json={"startup_script": startup_script}))
elif title or description or type:
script = _generate_startup_script( script = _generate_startup_script(
ticket["id"], ticket["human_id"], ticket["id"], ticket["human_id"],
ticket["title"], ticket["description"], ticket["type"], ticket["title"], ticket["description"], ticket["type"],