MCPcopy Create free account
hub / github.com/CopilotKit/OpenTag / fileIssueSubmit

Function fileIssueSubmit

app/modals/file-issue.tsx:53–80  ·  view source on GitHub ↗
({
  values,
  thread,
  user,
})

Source from the content-addressed store, hash-verified

51 */
52export const fileIssueSubmit: ModalSubmitHandler = async ({
53 values,
54 thread,
55 actor,
56 privateMetadata,
57}) => {
58 const issue = issueFromValues(values);
59 if (!issue.title.trim()) {
60 return { errors: { title: "Give the issue a title." } };
61 }
62 // No conversation context on the submission → nothing to post into; ack only.
63 if (!thread) return;
64 // Fire-and-forget: see the deadline note above — do NOT await this.
65 void thread
66 .runAgent({
67 prompt:
68 `Draft this Linear issue from the submitted form:\n` +
69 `- Title: ${issue.title}\n- Type: ${issue.type}\n- Priority: ${issue.priority}\n` +
70 `- Description: ${issue.description || "(none)"}\n` +
71 `Call the Linear create tool with these exact details. Its protected ` +
72 `MCP handler emits confirm_write and files only after approval. Then ` +
73 `show the issue card.`,
74 ...platformRunInput(privateMetadata ?? thread.platform, actor),
75 })
76 .catch(async (error) => {
77 try {
78 await thread.post(
79 `I could not file that issue. ${userFacingRunError(error)}`,
80 );
81 } catch (postError) {
82 throw new AggregateError(
83 [error, postError],

Callers 1

Calls 2

issueFromValuesFunction · 0.85
senderContextFunction · 0.85

Tested by

no test coverage detected