From dd4eaa6f772a3e769dd1b706231b290559dfe53b Mon Sep 17 00:00:00 2001 From: caoimhinr Date: Fri, 29 May 2026 16:39:42 +0200 Subject: [PATCH] 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 --- mcp_server.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/mcp_server.py b/mcp_server.py index f2918f8..692c47f 100644 --- a/mcp_server.py +++ b/mcp_server.py @@ -225,6 +225,7 @@ def update_ticket( status: str = "", type: str = "", user: str = "", + startup_script: str = "", parent_id: int = -1, effort: int = -1, environment_id: int = -1, @@ -240,6 +241,10 @@ def update_ticket( status: open, ongoing, completed, abandoned. type: feature, bug, chore, project. 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. Omit (default -1) to leave unchanged. effort: Effort rating 1–10; pass 0 to clear it. @@ -259,11 +264,16 @@ def update_ticket( body["effort"] = effort if effort > 0 else None if environment_id >= 0: 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") with _client() as c: - ticket = _check(c.patch(f"/api/tickets/{ticket_id}", json=body)) - if title or description or type: + if body: + 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( ticket["id"], ticket["human_id"], ticket["title"], ticket["description"], ticket["type"],