Repository navigation
DRU-1035 -- Open a chat-started build in the chat's request - #1104
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
DRU-1035: how it is addressed, every test, and open questionsAll results below are from How each requirement is addressed, and why
No author-surface module imports an app. Tracker reads, the route, and the dispatch errors live in Automated tests
Live tests, from first to last, and why eachThese ran on a local install against the real Linear, Jira, GitHub, and Slack. The bug sits between a chat request and the run's later events, which no unit test spans end to end. So each check starts a real run from a real conversation and reads what reached that conversation.
Before test 13, the person's DMs went to the events endpoint signed with the app's signing secret, because the person's linked Slack token is read-only. Test 13 is the person typing in Slack. Not run live: GitHub not connected. A live run means disconnecting the App. The dispatch test covers it, and the platform answers the not-connected error the same way it does for Questions for you
|
czpython
left a comment
There was a problem hiding this comment.
The fix works. A few changes before it lands:
-
Drop
asks_admin.Conversation.admin_account_idalready says whether a number's admin answers, andis_answerable_byreads it. On calls the flag is wrong: a call connection has no admin, so the admin branch returns nothing. Branch on the existing fact, and drop the flag and the two channel lines:async def ask_for_answer(session: AsyncSession, run: Run) -> str | None: if not run.input_request: return conversation = await session.get(Conversation, run.conversation_id) request = to_json(await run.get_ask()).decode() if not conversation.admin_account_id: return await report_outcome( session, run, PARKED_MESSAGE.format(run=run.id, request=request) ) admin = await get_or_create_admin_conversation(session, conversation) ...
A call's park then waits for the caller's next call, as its result and failure already do.
docs/chat.mdthen names only WhatsApp. -
Rename
Ticket.get_payloadtoto_tracker_ticket.get_means a fetch here.to_is the verb for one object in another shape (to_result,to_artifact). -
Drop
get_ticket_payload. Jira is the only tracker that shares its builder with its webhook. Revert thecore/webhooks/jira.pyhunk, and build the dict inJira.get_ticketfromself._client.get_issue(key), as the Linear and GitHub trackers do. -
Rename
TicketMergedtoTicketAlreadyMerged, so the class matches its code, as its siblings do. -
The start tool's docstring says the build "reports to this conversation". An MCP caller with no conversation gets no report, and the server instructions tell it to poll. Say "to the chat that started it".
-
docs/configuration.md: keep only that the tool does not move the ticket to the trigger status, and that the build moves it to In Progress. The tool's own description and errors carry the rest. -
test_a_parked_run_asks_the_chat_that_started_it: split the tuple assert into three asserts.
Your four questions each have their own issue: Slack's status line is #1116, progress and cancel notices are #1117, the "no result" misread is #1051 (your case is added there), and the unknown Linear key is #1118.
|
Thanks. All seven points are addressed in one commit, Your review points
Other decisions, and why
Tests rerun
Tests not rerun, and why
|
The chat's
starttool moved a Linear, Jira, or GitHub ticket to the trigger status, and the tracker's webhook then dispatched the build. That request had no conversation, so the run had none either, and its park, result, and failure never reached the chat that promised to report them. The tool now opens the build itself, in the chat's request, so a new build records the chat's conversation. A ticket that already has a build running returns that run, which keeps the conversation it started with.get_ticket(key), which returns the ticket in the shape of aticket.transitionedpayload. Linear reads the issue throughLinearClient.get_issue. Jira reads it throughJiraClient.get_issue. GitHub reads the issue and its status label. The board returnsTicket.to_tracker_ticket(), which its transition also publishes.start_work_itemreads the ticket and callsBuild.dispatch(ticket=...). It does not move the ticket. The build moves it to In Progress when it runs. That webhook dispatches nothing when In Progress is not the trigger status. If the two are the same, dispatch returns the active build and starts no second one. The tool returns the build's run id. For a ticket with a build already in flight, it returns that run's id.TicketNotRoutable(TICKET_NOT_ROUTABLE). An already-merged ticket raisesTicketAlreadyMerged(TICKET_ALREADY_MERGED). A missing GitHub connection announcesbuild.rejectedas before and raisesServiceNotConnectedError. The tool answers each one, and the webhook subscriber logs each one so the tracker does not deliver the ticket again.TicketNotMovablegoes, because the tool no longer moves tickets.Conversation.admin_account_id) asks that admin, as before. Any other chat (web, Slack, GitHub, a call, or a number with no admin) gets the request as an internal message, as it already does for the result and failure. A call's park then waits for the caller's next call, as its result and failure do. The post stays in thechat.ask_adminstep, so a parked run replays it unchanged.get_issue_statusread throughget_issue, and GitHub'sget_status_namereads throughget_ticket.