Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

feat: improve create issue field controls (#5532)

Jiayuan Zhanged9adc2bbe40
diff --git a/packages/core/api/client.ts b/packages/core/api/client.ts
index 09c85cad62..31ea83b329 100644
--- a/packages/core/api/client.ts
+++ b/packages/core/api/client.ts
@@ -1,5 +1,6 @@
import type {
Issue,
+ IssuePriority,
CreateIssueRequest,
UpdateIssueRequest,
GroupedIssuesResponse,
@@ -687,6 +688,8 @@ export class ApiClient {
agent_id?: string;
squad_id?: string;
prompt: string;
+ priority?: IssuePriority;
+ due_date?: string;
project_id?: string | null;
parent_issue_id?: string | null;
attachment_ids?: string[];
diff --git a/packages/core/issues/stores/draft-store.test.ts b/packages/core/issues/stores/draft-store.test.ts
index 03d8cc5d9d..b5bf80d583 100644
--- a/packages/core/issues/stores/draft-store.test.ts
+++ b/packages/core/issues/stores/draft-store.test.ts
@@ -35,6 +35,7 @@ const RESET_STATE = {
startDate: null,
dueDate: null,
labelIds: [],
+ propertyValues: {},
attachments: [],
},
lastAssigneeType: undefined,
@@ -101,6 +102,15 @@ describe("issue draft store — last assignee", () => {
expect(useIssueDraftStore.getState().draft.attachments).toEqual([]);
});
+ it("clearDraft removes persisted custom property values", () => {
+ const { setDraft, clearDraft } = useIssueDraftStore.getState();
+
+ setDraft({ propertyValues: { "property-1": "option-1" } });
+ clearDraft();
+
+ expect(useIssueDraftStore.getState().draft.propertyValues).toEqual({});
+ });
+
it("setLastAssignee(undefined) lets the user opt back out of a default", () => {
const { setLastAssignee, clearDraft } = useIssueDraftStore.getState();
@@ -125,7 +135,7 @@ describe("issue draft store — legacy rehydrate", () => {
setCurrentWorkspace(null, null);
});
- it("backfills attachments for drafts persisted before the field existed", async () => {
+ it("backfills attachments and custom properties for legacy drafts", async () => {
localStorage.setItem(
"multica_issue_draft:acme",
JSON.stringify({
@@ -151,5 +161,6 @@ describe("issue draft store — legacy rehydrate", () => {
const { draft } = useIssueDraftStore.getState();
expect(draft.title).toBe("legacy");
expect(draft.attachments).toEqual([]);
+ expect(draft.propertyValues).toEqual({});
});
});
diff --git a/packages/core/issues/stores/draft-store.ts b/packages/core/issues/stores/draft-store.ts
index 57a2968d63..f5c60dff33 100644
--- a/packages/core/issues/stores/draft-store.ts
+++ b/packages/core/issues/stores/draft-store.ts
@@ -1,6 +1,12 @@
import { create } from "zustand";
import { createJSONStorage, persist } from "zustand/middleware";
-import type { IssueStatus, IssuePriority, IssueAssigneeType, Attachment } from "../../types";
+import type {
+ IssueStatus,
+ IssuePriority,
+ IssueAssigneeType,
+ IssuePropertyValues,
+ Attachment,
+} from "../../types";
import { createWorkspaceAwareStorage, registerForWorkspaceRehydration } from "../../platform/workspace-storage";
import { defaultStorage } from "../../platform/storage";
@@ -17,6 +23,7 @@ interface IssueDraft {
* after it is created (the create endpoint takes no labels), so they are
* kept as a plain id list rather than full Label objects. */
labelIds: string[];
+ propertyValues: IssuePropertyValues;
attachments: Attachment[];
}
@@ -30,6 +37,7 @@ const EMPTY_DRAFT: IssueDraft = {
startDate: null,
dueDate: null,
labelIds: [],
+ propertyValues: {},
attachments: [],
};
@@ -66,7 +74,11 @@ export const useIssueDraftStore = create<IssueDraftStore>()(
set({ lastAssigneeType: type, lastAssigneeId: id }),
hasDraft: () => {
const { draft } = get();
- return !!(draft.title || draft.description);
+ return !!(
+ draft.title ||
+ draft.description ||
+ Object.keys(draft.propertyValues).length > 0
+ );
},
}),
{
diff --git a/packages/core/issues/stores/quick-create-store.test.ts b/packages/core/issues/stores/quick-create-store.test.ts
index 30668bd536..6f99ad40e6 100644
--- a/packages/core/issues/stores/quick-create-store.test.ts
+++ b/packages/core/issues/stores/quick-create-store.test.ts
@@ -1,10 +1,14 @@
import { beforeEach, describe, expect, it } from "vitest";
-import { useQuickCreateStore } from "./quick-create-store";
+import {
+ DEFAULT_QUICK_CREATE_FIELDS,
+ useQuickCreateStore,
+} from "./quick-create-store";
const RESET_STATE = {
lastActorType: null,
lastActorId: null,
lastProjectId: null,
+ visibleFields: DEFAULT_QUICK_CREATE_FIELDS,
prompt: "",
keepOpen: false,
};
@@ -51,4 +55,16 @@ describe("quick create store", () => {
expect(useQuickCreateStore.getState().lastActorType).toBeNull();
expect(useQuickCreateStore.getState().lastActorId).toBeNull();
});
+
+ it("persists the fields exposed in the quick create toolbar", () => {
+ const { setVisibleFields } = useQuickCreateStore.getState();
+
+ setVisibleFields(["project", "priority", "due_date"]);
+
+ expect(useQuickCreateStore.getState().visibleFields).toEqual([
+ "project",
+ "priority",
+ "due_date",
+ ]);
+ });
});
diff --git a/packages/core/issues/stores/quick-create-store.ts b/packages/core/issues/stores/quick-create-store.ts
index 93dae2922d..8d69859f1b 100644
--- a/packages/core/issues/stores/quick-create-store.ts
+++ b/packages/core/issues/stores/quick-create-store.ts
@@ -6,6 +6,9 @@ import { createWorkspaceAwareStorage, registerForWorkspaceRehydration } from "..
import { defaultStorage } from "../../platform/storage";
export type QuickCreateActorType = "agent" | "squad";
+export type QuickCreateField = "project" | "priority" | "due_date";
+
+export const DEFAULT_QUICK_CREATE_FIELDS: QuickCreateField[] = ["project"];
// Per-workspace memory of the last actor (agent or squad) and project the
// user picked in the Quick Create modal. Defaulted to those values on next
@@ -27,6 +30,8 @@ interface QuickCreateState {
setLastActor: (type: QuickCreateActorType | null, id: string | null) => void;
lastProjectId: string | null;
setLastProjectId: (id: string | null) => void;
+ visibleFields: QuickCreateField[];
+ setVisibleFields: (fields: QuickCreateField[]) => void;
prompt: string;
setPrompt: (prompt: string) => void;
clearPrompt: () => void;
@@ -42,6 +47,8 @@ export const useQuickCreateStore = create<QuickCreateState>()(
setLastActor: (type, id) => set({ lastActorType: type, lastActorId: id }),
lastProjectId: null,
setLastProjectId: (id) => set({ lastProjectId: id }),
+ visibleFields: DEFAULT_QUICK_CREATE_FIELDS,
+ setVisibleFields: (visibleFields) => set({ visibleFields }),
prompt: "",
setPrompt: (prompt) => set({ prompt }),
clearPrompt: () => set({ prompt: "" }),
@@ -51,6 +58,14 @@ export const useQuickCreateStore = create<QuickCreateState>()(
{
name: "multica_quick_create",
storage: createJSONStorage(() => createWorkspaceAwareStorage(defaultStorage)),
+ merge: (persistedState, currentState) => {
+ const persisted = (persistedState ?? {}) as Partial<QuickCreateState>;
+ return {
+ ...currentState,
+ ...persisted,
+ visibleFields: persisted.visibleFields ?? DEFAULT_QUICK_CREATE_FIELDS,
+ };
+ },
},
),
);
diff --git a/packages/core/runtimes/cli-version.test.ts b/packages/core/runtimes/cli-version.test.ts
index 06b44fa82e..c00df052d3 100644
--- a/packages/core/runtimes/cli-version.test.ts
+++ b/packages/core/runtimes/cli-version.test.ts
@@ -1,6 +1,7 @@
import { describe, it, expect } from "vitest";
import {
checkQuickCreateCliVersion,
+ checkQuickCreateFieldsCliVersion,
handoffSupported,
MIN_HANDOFF_CLI_VERSION,
} from "./cli-version";
@@ -29,6 +30,14 @@ describe("checkQuickCreateCliVersion", () => {
});
});
+describe("checkQuickCreateFieldsCliVersion", () => {
+ it("requires the first daemon release that transports explicit fields", () => {
+ expect(checkQuickCreateFieldsCliVersion("0.4.2").state).toBe("too_old");
+ expect(checkQuickCreateFieldsCliVersion("0.4.3").state).toBe("ok");
+ expect(checkQuickCreateFieldsCliVersion("v0.4.3-1-gabc1234").state).toBe("ok");
+ });
+});
+
// Mirrors server/pkg/agent/handoff_version_test.go so the frontend soft-gate
// signal and the server's authoritative one agree by construction.
describe("handoffSupported", () => {
diff --git a/packages/core/runtimes/cli-version.ts b/packages/core/runtimes/cli-version.ts
index 77d9b25b39..41b51e4ca3 100644
--- a/packages/core/runtimes/cli-version.ts
+++ b/packages/core/runtimes/cli-version.ts
@@ -11,6 +11,7 @@
* "your daemon needs an upgrade" before they hit submit.
*/
export const MIN_QUICK_CREATE_CLI_VERSION = "0.2.21";
+export const MIN_QUICK_CREATE_FIELDS_CLI_VERSION = "0.4.3";
export type CliVersionState = "ok" | "too_old" | "missing";
@@ -52,19 +53,33 @@ function lessThan(a: [number, number, number], b: [number, number, number]) {
* itself is the shared signal, so frontend and server agree by construction.
*/
export function checkQuickCreateCliVersion(detected: string | undefined | null): CliVersionCheck {
+ return checkCliVersion(detected, MIN_QUICK_CREATE_CLI_VERSION);
+}
+
+/** Capability gate for explicit quick-create priority and due-date fields. */
+export function checkQuickCreateFieldsCliVersion(
+ detected: string | undefined | null,
+): CliVersionCheck {
+ return checkCliVersion(detected, MIN_QUICK_CREATE_FIELDS_CLI_VERSION);
+}
+
+function checkCliVersion(
+ detected: string | undefined | null,
+ minimum: string,
+): CliVersionCheck {
const current = (detected ?? "").trim();
if (DEV_DESCRIBE_RE.test(current)) {
- return { state: "ok", current, min: MIN_QUICK_CREATE_CLI_VERSION };
+ return { state: "ok", current, min: minimum };
}
const parsed = current ? parseSemver(current) : null;
if (!parsed) {
- return { state: "missing", current, min: MIN_QUICK_CREATE_CLI_VERSION };
+ return { state: "missing", current, min: minimum };
}
- const min = parseSemver(MIN_QUICK_CREATE_CLI_VERSION)!;
+ const min = parseSemver(minimum)!;
if (lessThan(parsed, min)) {
- return { state: "too_old", current, min: MIN_QUICK_CREATE_CLI_VERSION };
+ return { state: "too_old", current, min: minimum };
}
- return { state: "ok", current, min: MIN_QUICK_CREATE_CLI_VERSION };
+ return { state: "ok", current, min: minimum };
}
/** Pull `cli_version` off a runtime row's loosely-typed metadata bag. */
diff --git a/packages/views/issues/components/pickers/custom-property-picker.tsx b/packages/views/issues/components/pickers/custom-property-picker.tsx
index 7eee204d47..8a58db2b3f 100644
--- a/packages/views/issues/components/pickers/custom-property-picker.tsx
+++ b/packages/views/issues/components/pickers/custom-property-picker.tsx
@@ -47,24 +47,69 @@ export function CustomPropertyValueEditor({
property: IssueProperty;
defaultOpen?: boolean;
}) {
- const { t } = useT("issues");
- const [open, setOpen] = useState(defaultOpen);
const setProperty = useSetIssueProperty();
const unsetProperty = useUnsetIssueProperty();
-
const value = issue.properties[property.id];
- const hasValue = value !== undefined;
-
const onError = (error: unknown) =>
toast.error(error instanceof Error ? error.message : String(error));
- const commit = (next: IssuePropertyValue) =>
- setProperty.mutate(
- { issueId: issue.id, propertyId: property.id, value: next },
- { onError },
- );
- const clear = () =>
- unsetProperty.mutate({ issueId: issue.id, propertyId: property.id }, { onError });
+ return (
+ <CustomPropertyValueInput
+ property={property}
+ value={value}
+ defaultOpen={defaultOpen}
+ onChange={(next) => {
+ if (next === undefined) {
+ unsetProperty.mutate(
+ { issueId: issue.id, propertyId: property.id },
+ { onError },
+ );
+ return;
+ }
+ setProperty.mutate(
+ { issueId: issue.id, propertyId: property.id, value: next },
+ { onError },
+ );
+ }}
+ />
+ );
+}
+
+/**
+ * Mutation-free custom-property editor. Create flows use this while an issue
+ * still exists only as a draft; issue detail wraps it above with the normal
+ * optimistic mutations.
+ */
+export function CustomPropertyValueInput({
+ property,
+ value,
+ onChange,
+ defaultOpen = false,
+ open: controlledOpen,
+ onOpenChange: controlledOnOpenChange,
+ trigger,
+ triggerRender,
+}: {
+ property: IssueProperty;
+ value: IssuePropertyValue | undefined;
+ onChange: (value: IssuePropertyValue | undefined) => void;
+ defaultOpen?: boolean;
+ open?: boolean;
+ onOpenChange?: (open: boolean) => void;
+ trigger?: React.ReactNode;
+ triggerRender?: React.ReactElement<Record<string, unknown>>;
+}) {
+ const { t } = useT("issues");
+ const [internalOpen, setInternalOpen] = useState(defaultOpen);
+ const open = controlledOpen ?? internalOpen;
+ const setOpen = controlledOnOpenChange ?? setInternalOpen;
+ const hasValue = value !== undefined;
+
+ const commit = (next: IssuePropertyValue) => onChange(next);
+ const clear = () => onChange(undefined);
+ const valueTrigger = trigger ?? (
+ <CustomPropertyValueDisplay property={property} value={value} />
+ );
const emptyLabel = (
<span className="text-muted-foreground">
@@ -100,7 +145,8 @@ export function CustomPropertyValueEditor({
open={open}
onOpenChange={setOpen}
align="start"
- trigger={<CustomPropertyValueDisplay property={property} value={value} />}
+ trigger={valueTrigger}
+ triggerRender={triggerRender}
footer={clearFooter}
>
<p className="px-2 py-1.5 text-xs text-muted-foreground">
@@ -119,7 +165,8 @@ export function CustomPropertyValueEditor({
onOpenChange={setOpen}
align="start"
searchable={options.length > 7}
- trigger={<CustomPropertyValueDisplay property={property} value={value} />}
+ trigger={valueTrigger}
+ triggerRender={triggerRender}
footer={clearFooter}
>
{options.map((option) => (
@@ -154,7 +201,8 @@ export function CustomPropertyValueEditor({
onOpenChange={setOpen}
align="start"
searchable={options.length > 7}
- trigger={<CustomPropertyValueDisplay property={property} value={value} />}
+ trigger={valueTrigger}
+ triggerRender={triggerRender}
footer={clearFooter}
>
{options.map((option) => (
@@ -174,8 +222,11 @@ export function CustomPropertyValueEditor({
const date = typeof value === "string" ? dateOnlyToLocalDate(value) : undefined;
return (
<Popover open={open} onOpenChange={setOpen}>
- <PopoverTrigger className="flex items-center gap-1.5 cursor-pointer rounded px-1 -mx-1 hover:bg-accent/30 transition-colors overflow-hidden">
- <CustomPropertyValueDisplay property={property} value={value} />
+ <PopoverTrigger
+ className={triggerRender ? undefined : "flex items-center gap-1.5 cursor-pointer rounded px-1 -mx-1 hover:bg-accent/30 transition-colors overflow-hidden"}
+ render={triggerRender}
+ >
+ {valueTrigger}
</PopoverTrigger>
<PopoverContent className="w-auto p-0" align="start">
<Calendar
@@ -212,7 +263,8 @@ export function CustomPropertyValueEditor({
open={open}
onOpenChange={setOpen}
align="start"
- trigger={<CustomPropertyValueDisplay property={property} value={value} />}
+ trigger={valueTrigger}
+ triggerRender={triggerRender}
footer={clearFooter}
>
<PickerItem
@@ -245,6 +297,8 @@ export function CustomPropertyValueEditor({
onCommit={commit}
onClear={clear}
emptyLabel={emptyLabel}
+ trigger={valueTrigger}
+ triggerRender={triggerRender}
/>
);
}
@@ -259,6 +313,8 @@ function TextishPropertyEditor({
onCommit,
onClear,
emptyLabel,
+ trigger,
+ triggerRender,
}: {
property: IssueProperty;
value: IssuePropertyValue | undefined;
@@ -267,6 +323,8 @@ function TextishPropertyEditor({
onCommit: (next: IssuePropertyValue) => void;
onClear: () => void;
emptyLabel: React.ReactNode;
+ trigger?: React.ReactNode;
+ triggerRender?: React.ReactElement<Record<string, unknown>>;
}) {
const { t } = useT("issues");
const [draft, setDraft] = useState("");
@@ -301,12 +359,15 @@ function TextishPropertyEditor({
return (
<Popover open={open} onOpenChange={onOpenChange}>
- <PopoverTrigger className="flex items-center gap-1.5 cursor-pointer rounded px-1 -mx-1 hover:bg-accent/30 transition-colors overflow-hidden">
- {value === undefined ? (
+ <PopoverTrigger
+ className={triggerRender ? undefined : "flex items-center gap-1.5 cursor-pointer rounded px-1 -mx-1 hover:bg-accent/30 transition-colors overflow-hidden"}
+ render={triggerRender}
+ >
+ {trigger ?? (value === undefined ? (
emptyLabel
) : (
<CustomPropertyValueDisplay property={property} value={value} />
- )}
+ ))}
</PopoverTrigger>
<PopoverContent className="w-64 p-2" align="start">
<form
diff --git a/packages/views/locales/en/modals.json b/packages/views/locales/en/modals.json
index bdd4ccf555..a6838fa245 100644
--- a/packages/views/locales/en/modals.json
+++ b/packages/views/locales/en/modals.json
@@ -164,6 +164,7 @@
"toast_link_subissues_all_failed": "Failed to link sub-issues",
"toast_link_subissues_partial": "Failed to link {{failed}} of {{total}} sub-issues",
"toast_link_labels_failed": "Failed to attach labels",
+ "toast_set_properties_failed": "Could not set {{count}} custom property values",
"switch_to_agent": "Switch to Agent",
"switch_to_agent_tooltip": "Switch to create with agent — describe in one line and let the agent file it",
"switch_to_manual": "Switch to Manual",
@@ -178,6 +179,7 @@
"set_start_date": "Set start date...",
"set_parent": "Set parent issue...",
"add_subissue": "Add sub-issue...",
+ "custom_properties": "Custom properties",
"remove_parent": "Remove parent",
"set_parent_picker": {
"title": "Set parent issue",
@@ -198,6 +200,19 @@
"version_missing": "This agent's daemon doesn't report a CLI version. Create with agent needs multica CLI ≥ {{min}}. Upgrade the daemon and reconnect, or switch to manual create.",
"version_below": "This agent's daemon CLI is {{current}} — Create with agent needs ≥ {{min}}. Upgrade the daemon, or switch to manual create.",
"prompt_placeholder": "Tell the agent what to do, e.g. \"let Bohan fix the inbox loading slowness in the Web project\"",
+ "more_fields_aria": "More fields",
+ "set_project": "Set project...",
+ "set_priority": "Set priority...",
+ "set_due_date": "Set due date...",
+ "customize_fields": "Customize fields...",
+ "field_settings_title": "Quick create fields",
+ "field_settings_description": "Choose which fields stay visible in the quick create toolbar.",
+ "field_settings_done": "Done",
+ "fields": {
+ "project": "Project",
+ "priority": "Priority",
+ "due_date": "Due date"
+ },
"submit": "Create",
"sending": "Sending…",
"uploading": "Uploading…",
diff --git a/packages/views/locales/ja/modals.json b/packages/views/locales/ja/modals.json
index 4fcb817c13..db04e7a8bc 100644
--- a/packages/views/locales/ja/modals.json
+++ b/packages/views/locales/ja/modals.json
@@ -162,6 +162,7 @@
"toast_link_subissues_all_failed": "サブイシューをリンクできませんでした",
"toast_link_subissues_partial": "サブイシュー {{total}} 件中 {{failed}} 件をリンクできませんでした",
"toast_link_labels_failed": "ラベルを付けられませんでした",
+ "toast_set_properties_failed": "{{count}} 件のカスタムプロパティを設定できませんでした",
"switch_to_agent": "エージェントに切り替え",
"switch_to_agent_tooltip": "エージェントで作成に切り替えます。一行で説明すれば、エージェントがイシューを作成します",
"switch_to_manual": "手動に切り替え",
@@ -176,6 +177,7 @@
"set_start_date": "開始日を設定...",
"set_parent": "親イシューを設定...",
"add_subissue": "サブイシューを追加...",
+ "custom_properties": "カスタムプロパティ",
"remove_parent": "親を削除",
"set_parent_picker": {
"title": "親イシューを設定",
@@ -196,6 +198,19 @@
"version_missing": "このエージェントのデーモンは CLI バージョンを報告していません。エージェントで作成には multica CLI {{min}} 以上が必要です。デーモンをアップグレードして再接続するか、手動作成に切り替えてください。",
"version_below": "このエージェントのデーモン CLI は {{current}} です。エージェントで作成には {{min}} 以上が必要です。デーモンをアップグレードするか、手動作成に切り替えてください。",
"prompt_placeholder": "エージェントにやってほしいことを伝えてください。例: 「Bohan に Web プロジェクトのインボックス読み込みの遅さを直してもらう」",
+ "more_fields_aria": "その他のフィールド",
+ "set_project": "プロジェクトを設定...",
+ "set_priority": "優先度を設定...",
+ "set_due_date": "期限を設定...",
+ "customize_fields": "フィールドをカスタマイズ...",
+ "field_settings_title": "クイック作成フィールド",
+ "field_settings_description": "クイック作成ツールバーに常に表示するフィールドを選択します。",
+ "field_settings_done": "完了",
+ "fields": {
+ "project": "プロジェクト",
+ "priority": "優先度",
+ "due_date": "期限"
+ },
"submit": "作成",
"sending": "送信中…",
"uploading": "アップロード中…",
diff --git a/packages/views/locales/ko/modals.json b/packages/views/locales/ko/modals.json
index 2a523c5247..032cdc045b 100644
--- a/packages/views/locales/ko/modals.json
+++ b/packages/views/locales/ko/modals.json
@@ -162,6 +162,7 @@
"toast_link_subissues_all_failed": "하위 이슈를 연결하지 못했습니다",
"toast_link_subissues_partial": "하위 이슈 {{total}}개 중 {{failed}}개를 연결하지 못했습니다",
"toast_link_labels_failed": "라벨을 연결하지 못했습니다",
+ "toast_set_properties_failed": "사용자 지정 속성 값 {{count}}개를 설정하지 못했습니다",
"switch_to_agent": "에이전트로 전환",
"switch_to_agent_tooltip": "에이전트로 만들기로 전환합니다. 한 줄로 설명하면 에이전트가 이슈를 작성합니다.",
"switch_to_manual": "직접 만들기로 전환",
@@ -176,6 +177,7 @@
"set_start_date": "시작일 설정...",
"set_parent": "상위 이슈 설정...",
"add_subissue": "하위 이슈 추가...",
+ "custom_properties": "사용자 지정 속성",
"remove_parent": "상위 이슈 제거",
"set_parent_picker": {
"title": "상위 이슈 설정",
@@ -196,6 +198,19 @@
"version_missing": "이 에이전트의 데몬이 CLI 버전을 보고하지 않습니다. 에이전트로 만들기에는 multica CLI {{min}} 이상이 필요합니다. 데몬을 업그레이드하고 다시 연결하거나 직접 만들기로 전환하세요.",
"version_below": "이 에이전트의 데몬 CLI는 {{current}}입니다. 에이전트로 만들기에는 {{min}} 이상이 필요합니다. 데몬을 업그레이드하거나 직접 만들기로 전환하세요.",
"prompt_placeholder": "에이전트에게 할 일을 알려주세요. 예: \"Bohan이 Web 프로젝트의 인박스 로딩 지연을 고치게 해줘\"",
+ "more_fields_aria": "추가 필드",
+ "set_project": "프로젝트 설정...",
+ "set_priority": "우선순위 설정...",
+ "set_due_date": "마감일 설정...",
+ "customize_fields": "필드 사용자 지정...",
+ "field_settings_title": "빠른 만들기 필드",
+ "field_settings_description": "빠른 만들기 도구 모음에 항상 표시할 필드를 선택하세요.",
+ "field_settings_done": "완료",
+ "fields": {
+ "project": "프로젝트",
+ "priority": "우선순위",
+ "due_date": "마감일"
+ },
"submit": "만들기",
"sending": "보내는 중...",
"uploading": "업로드 중...",
diff --git a/packages/views/locales/zh-Hans/modals.json b/packages/views/locales/zh-Hans/modals.json
index 7f916bdddd..483d659e8e 100644
--- a/packages/views/locales/zh-Hans/modals.json
+++ b/packages/views/locales/zh-Hans/modals.json
@@ -162,6 +162,7 @@
"toast_link_subissues_all_failed": "关联子 issue 失败",
"toast_link_subissues_partial": "{{total}} 个子 issue 中有 {{failed}} 个关联失败",
"toast_link_labels_failed": "关联标签失败",
+ "toast_set_properties_failed": "有 {{count}} 个自定义属性设置失败",
"switch_to_agent": "切换到智能体",
"switch_to_agent_tooltip": "切换到通过智能体创建——一句话描述,让它替你建",
"switch_to_manual": "切换到手动",
@@ -176,6 +177,7 @@
"set_start_date": "设置开始日期...",
"set_parent": "设置父 issue...",
"add_subissue": "添加子 issue...",
+ "custom_properties": "自定义属性",
"remove_parent": "移除父级",
"set_parent_picker": {
"title": "设置父 issue",
@@ -196,6 +198,19 @@
"version_missing": "该智能体的守护进程没有报告 CLI 版本。通过智能体创建需要 multica CLI ≥ {{min}}。请升级守护进程并重连,或切换到手动创建。",
"version_below": "该智能体的守护进程 CLI 是 {{current}}——通过智能体创建需要 ≥ {{min}}。请升级守护进程,或切换到手动创建。",
"prompt_placeholder": "告诉智能体要做什么,例如:\"让 Bohan 修一下 Web 项目里收件箱加载慢的问题\"",
+ "more_fields_aria": "更多字段",
+ "set_project": "设置项目...",
+ "set_priority": "设置优先级...",
+ "set_due_date": "设置截止日期...",
+ "customize_fields": "自定义字段...",
+ "field_settings_title": "快速创建字段",
+ "field_settings_description": "选择快速创建工具栏中常驻显示的字段。",
+ "field_settings_done": "完成",
+ "fields": {
+ "project": "项目",
+ "priority": "优先级",
+ "due_date": "截止日期"
+ },
"submit": "创建",
"sending": "发送中...",
"uploading": "上传中...",
diff --git a/packages/views/modals/create-issue.test.tsx b/packages/views/modals/create-issue.test.tsx
index cc1a599c68..4e835d9248 100644
--- a/packages/views/modals/create-issue.test.tsx
+++ b/packages/views/modals/create-issue.test.tsx
@@ -24,6 +24,8 @@ function I18nWrapper({ children }: { children: ReactNode }) {
const mockPush = vi.hoisted(() => vi.fn());
const mockCreateIssue = vi.hoisted(() => vi.fn());
const mockAttachLabel = vi.hoisted(() => vi.fn());
+const mockListProperties = vi.hoisted(() => vi.fn());
+const mockSetIssueProperty = vi.hoisted(() => vi.fn());
const mockSetDraft = vi.hoisted(() => vi.fn());
const mockClearDraft = vi.hoisted(() => vi.fn());
const mockSetLastAssignee = vi.hoisted(() => vi.fn());
@@ -44,6 +46,7 @@ const mockDraftStore = {
startDate: null,
dueDate: null,
labelIds: [] as string[],
+ propertyValues: {} as Record<string, string | number | boolean | string[]>,
attachments: [] as Array<{
id: string;
workspace_id: string;
@@ -145,6 +148,20 @@ vi.mock("@multica/core/labels", () => ({
useAttachLabelToIssue: () => ({ mutateAsync: mockAttachLabel }),
}));
+vi.mock("@multica/core/properties", async (importOriginal) => {
+ const actual = await importOriginal<typeof import("@multica/core/properties")>();
+ return {
+ ...actual,
+ useSetIssueProperty: () => ({
+ mutateAsync: ({ issueId, propertyId, value }: {
+ issueId: string;
+ propertyId: string;
+ value: string | number | boolean | string[];
+ }) => mockSetIssueProperty(issueId, propertyId, value),
+ }),
+ };
+});
+
vi.mock("@multica/core/hooks/use-file-upload", () => ({
useFileUpload: () => ({ uploadWithToast: mockUploadWithToast }),
}));
@@ -182,7 +199,10 @@ vi.mock("@multica/core/api", async () => {
typeof import("@multica/core/api/schemas")
>("@multica/core/api/schemas");
return {
- api: {},
+ api: {
+ listProperties: mockListProperties,
+ setIssueProperty: mockSetIssueProperty,
+ },
ApiError,
parseWithFallback,
DuplicateIssueErrorBodySchema,
@@ -293,6 +313,19 @@ vi.mock("../issues/components", () => ({
LabelPicker: () => <div data-testid="label-picker" />,
}));
+vi.mock("../issues/components/pickers/custom-property-picker", () => ({
+ CustomPropertyValueInput: ({ property, onChange }: any) => (
+ <button
+ type="button"
+ aria-label={`Edit ${property.name}`}
+ onClick={() => onChange("option-enterprise")}
+ >
+ {property.name}
+ </button>
+ ),
+ CustomPropertyValueDisplay: ({ value }: any) => <span>{String(value)}</span>,
+}));
+
vi.mock("../projects/components/project-picker", () => ({
ProjectPicker: () => <div data-testid="project-picker" />,
}));
@@ -315,6 +348,9 @@ vi.mock("@multica/ui/components/ui/dropdown-menu", () => ({
<button type="button" onClick={onClick}>{children}</button>
),
DropdownMenuSeparator: () => null,
+ DropdownMenuSub: ({ children }: { children: React.ReactNode }) => <>{children}</>,
+ DropdownMenuSubTrigger: ({ children }: { children: React.ReactNode }) => <>{children}</>,
+ DropdownMenuSubContent: ({ children }: { children: React.ReactNode }) => <>{children}</>,
}));
vi.mock("./issue-picker-modal", () => ({
@@ -418,6 +454,7 @@ describe("CreateIssueModal", () => {
mockDraftStore.draft.startDate = null;
mockDraftStore.draft.dueDate = null;
mockDraftStore.draft.labelIds = [];
+ mockDraftStore.draft.propertyValues = {};
mockDraftStore.draft.attachments = [];
mockSetDraft.mockImplementation((patch: Partial<typeof mockDraftStore.draft>) => {
mockDraftStore.draft = { ...mockDraftStore.draft, ...patch };
@@ -433,6 +470,7 @@ describe("CreateIssueModal", () => {
startDate: null,
dueDate: null,
labelIds: [],
+ propertyValues: {},
attachments: [],
};
});
@@ -466,6 +504,29 @@ describe("CreateIssueModal", () => {
labels: [],
});
mockAttachLabel.mockResolvedValue({ labels: [] });
+ mockListProperties.mockResolvedValue({
+ properties: [
+ {
+ id: "property-tier",
+ workspace_id: "ws-test",
+ name: "Customer tier",
+ type: "select",
+ config: {
+ options: [
+ { id: "option-enterprise", name: "Enterprise", color: "#3b82f6" },
+ ],
+ },
+ position: 0,
+ archived: false,
+ created_at: "2026-01-01T00:00:00Z",
+ updated_at: "2026-01-01T00:00:00Z",
+ },
+ ],
+ total: 1,
+ });
+ mockSetIssueProperty.mockResolvedValue({
+ properties: { "property-tier": "option-enterprise" },
+ });
});
it("shows success feedback with a direct path to the new issue", async () => {
@@ -620,10 +681,32 @@ describe("CreateIssueModal", () => {
startDate: null,
dueDate: null,
labelIds: [],
+ propertyValues: {},
attachments: [],
});
});
+ it("sets configured custom property values after the issue is created", async () => {
+ const user = userEvent.setup();
+
+ renderModal(<CreateIssueModal onClose={vi.fn()} />);
+
+ await screen.findByText("Customer tier");
+ await user.click(screen.getByText("Customer tier"));
+ await user.click(screen.getByRole("button", { name: "Edit Customer tier" }));
+ await user.type(screen.getByPlaceholderText("Issue title"), "Enterprise follow-up");
+ await user.click(screen.getByRole("button", { name: "Create Issue" }));
+
+ await waitFor(() => {
+ expect(mockSetIssueProperty).toHaveBeenCalledWith(
+ "issue-123",
+ "property-tier",
+ "option-enterprise",
+ );
+ });
+ expect(mockClearDraft).toHaveBeenCalled();
+ });
+
it("persists manual-mode uploads in the issue draft", async () => {
const user = userEvent.setup();
@@ -1035,16 +1118,12 @@ describe("CreateIssueModal", () => {
);
});
- it("blocks Enter on the title while an upload is in flight", async () => {
+ it("never submits manual create from Enter in the title", async () => {
const user = userEvent.setup();
renderManual();
const title = screen.getByPlaceholderText("Issue title");
await user.type(title, "Has a screenshot");
- startPendingUpload();
-
- // Title Enter routes to the same handler as the Create button but never
- // consults its disabled state — the handler's own check is the gate.
fireEvent.keyDown(title, { key: "Enter" });
await Promise.resolve();
expect(mockCreateIssue).not.toHaveBeenCalled();
diff --git a/packages/views/modals/create-issue.tsx b/packages/views/modals/create-issue.tsx
index ab0effafa3..ec7454ab2b 100644
--- a/packages/views/modals/create-issue.tsx
+++ b/packages/views/modals/create-issue.tsx
@@ -15,11 +15,19 @@ import {
Maximize2,
Minimize2,
MoreHorizontal,
+ Shapes,
X as XIcon,
} from "lucide-react";
import { cn } from "@multica/ui/lib/utils";
import { toast } from "sonner";
-import type { Issue, IssueStatus, IssuePriority, IssueAssigneeType, Attachment } from "@multica/core/types";
+import type {
+ Issue,
+ IssueStatus,
+ IssuePriority,
+ IssueAssigneeType,
+ IssuePropertyValue,
+ Attachment,
+} from "@multica/core/types";
import { contentReferencesAttachment } from "@multica/core/types";
import {
DialogContent,
@@ -30,6 +38,9 @@ import {
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuSeparator,
+ DropdownMenuSub,
+ DropdownMenuSubContent,
+ DropdownMenuSubTrigger,
DropdownMenuTrigger,
} from "@multica/ui/components/ui/dropdown-menu";
import { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from "@multica/ui/components/ui/tooltip";
@@ -49,6 +60,10 @@ import { useQuickCreateStore } from "@multica/core/issues/stores/quick-create-st
import { issueDetailOptions, childIssuesOptions } from "@multica/core/issues/queries";
import { useCreateIssue, useUpdateIssue } from "@multica/core/issues/mutations";
import { useAttachLabelToIssue } from "@multica/core/labels";
+import {
+ propertyListOptions,
+ useSetIssueProperty,
+} from "@multica/core/properties";
import {
ApiError,
DuplicateIssueErrorBodySchema,
@@ -58,6 +73,11 @@ import {
import { FileUploadButton } from "@multica/ui/components/common/file-upload-button";
import { PillButton } from "../common/pill-button";
import { ActorAvatar } from "../common/actor-avatar";
+import { PropertyIcon } from "../common/property-icon";
+import {
+ CustomPropertyValueDisplay,
+ CustomPropertyValueInput,
+} from "../issues/components/pickers/custom-property-picker";
import { IssuePickerModal } from "./issue-picker-modal";
import { useT } from "../i18n";
@@ -208,7 +228,9 @@ export function ManualCreatePanel({
onDrop: (files) => files.forEach((f) => descEditorRef.current?.uploadFile(f)),
});
const [status, setStatus] = useState<IssueStatus>((data?.status as IssueStatus) || draft.status);
- const [priority, setPriority] = useState<IssuePriority>(draft.priority);
+ const [priority, setPriority] = useState<IssuePriority>(
+ (data?.priority as IssuePriority | undefined) ?? draft.priority,
+ );
const [submitting, setSubmitting] = useState(false);
const [assigneeType, setAssigneeType] = useState<IssueAssigneeType | undefined>(() => {
if (data && "assignee_type" in data) {
@@ -223,8 +245,12 @@ export function ManualCreatePanel({
return draft.assigneeId;
});
const [startDate, setStartDate] = useState<string | null>(draft.startDate);
- const [dueDate, setDueDate] = useState<string | null>(draft.dueDate);
+ const [dueDate, setDueDate] = useState<string | null>(
+ (data?.due_date as string | undefined) ?? draft.dueDate,
+ );
const [labelIds, setLabelIds] = useState<string[]>(draft.labelIds);
+ const [propertyValues, setPropertyValues] = useState(draft.propertyValues ?? {});
+ const [customPropertyPickerId, setCustomPropertyPickerId] = useState<string | null>(null);
const [projectId, setProjectId] = useState<string | undefined>(
(data?.project_id as string) || undefined,
);
@@ -253,6 +279,7 @@ export function ManualCreatePanel({
// Fetch parent issue details for the chip (status/identifier/title).
// List cache usually has it already, so this resolves synchronously.
const wsId = useWorkspaceId();
+ const { data: workspaceProperties = [] } = useQuery(propertyListOptions(wsId));
const { data: parentIssue } = useQuery({
...issueDetailOptions(wsId, parentIssueId ?? ""),
enabled: !!parentIssueId,
@@ -283,8 +310,8 @@ export function ManualCreatePanel({
}, []);
const { uploadWithToast } = useEditorUpload();
- // Gate every action that fixes this draft: Create, Enter on the title, and
- // the switch to agent mode (which re-serializes the description into a
+ // Gate every action that fixes this draft: Create and the switch to agent
+ // mode (which re-serializes the description into a
// prompt and would carry a stripped body across).
const uploadGate = useUploadGate(descEditorRef);
const handleUpload = async (file: File) => {
@@ -311,10 +338,18 @@ export function ManualCreatePanel({
const updateStartDate = (v: string | null) => { setStartDate(v); setDraft({ startDate: v }); };
const updateDueDate = (v: string | null) => { setDueDate(v); setDraft({ dueDate: v }); };
const updateLabelIds = (ids: string[]) => { setLabelIds(ids); setDraft({ labelIds: ids }); };
+ const updatePropertyValue = (propertyId: string, value: IssuePropertyValue | undefined) => {
+ const next = { ...propertyValues };
+ if (value === undefined) delete next[propertyId];
+ else next[propertyId] = value;
+ setPropertyValues(next);
+ setDraft({ propertyValues: next });
+ };
const createIssueMutation = useCreateIssue();
const updateIssueMutation = useUpdateIssue();
const attachLabelMutation = useAttachLabelToIssue();
+ const setIssuePropertyMutation = useSetIssueProperty();
const resetForNextIssue = () => {
setTitle("");
setStatus("todo");
@@ -322,6 +357,8 @@ export function ManualCreatePanel({
setStartDate(null);
setDueDate(null);
setLabelIds([]);
+ setPropertyValues({});
+ setCustomPropertyPickerId(null);
setProjectId(undefined);
setParentIssueId(undefined);
setStage(null);
@@ -336,6 +373,7 @@ export function ManualCreatePanel({
startDate: null,
dueDate: null,
labelIds: [],
+ propertyValues: {},
attachments: [],
});
descEditorRef.current?.clearContent();
@@ -344,7 +382,6 @@ export function ManualCreatePanel({
const handleSubmit = async () => {
if (!title.trim() || submitting) return;
- // Covers both the Create button and TitleEditor's Enter, which route here.
if (uploadGate.isBlocked()) return;
setSubmitting(true);
try {
@@ -374,6 +411,34 @@ export function ManualCreatePanel({
project_id: projectId,
});
+ // Custom-property values can only be addressed once the issue has an
+ // id. Keep the modal in its submitting state until every value settles
+ // so closing or "Create another" cannot race the fan-out.
+ const propertyEntries = Object.entries(propertyValues);
+ if (propertyEntries.length > 0) {
+ const results = await Promise.allSettled(
+ propertyEntries.map(([propertyId, value]) =>
+ setIssuePropertyMutation.mutateAsync({
+ issueId: issue.id,
+ propertyId,
+ value,
+ }),
+ ),
+ );
+ let failed = 0;
+ for (const result of results) {
+ if (result.status === "rejected") {
+ failed += 1;
+ console.error("[create-issue] custom property set failed", result.reason);
+ }
+ }
+ if (failed > 0) {
+ toast.error(
+ t(($) => $.create_issue.toast_set_properties_failed, { count: failed }),
+ );
+ }
+ }
+
// Link queued children to the new parent. Deferred to after create
// because the new issue's ID doesn't exist yet. Partial failures don't
// roll back the new issue — it's already committed.
@@ -570,6 +635,8 @@ export function ManualCreatePanel({
? { squad_id: assigneeId }
: {}),
...(projectId ? { project_id: projectId } : {}),
+ ...(priority !== "none" ? { priority } : {}),
+ ...(dueDate ? { due_date: dueDate } : {}),
...(parentIssueId ? { parent_issue_id: parentIssueId } : {}),
...(carryParentIdentifier ? { parent_issue_identifier: carryParentIdentifier } : {}),
});
@@ -631,7 +698,6 @@ export function ManualCreatePanel({
placeholder={t(($) => $.create_issue.title_placeholder)}
className="text-lg font-semibold"
onChange={(v) => updateTitle(v)}
- onSubmit={handleSubmit}
/>
</div>
@@ -745,6 +811,42 @@ export function ManualCreatePanel({
/>
)}
+ {/* Workspace-defined fields use the same typed editors as issue
+ detail, but write into the persisted draft until creation. */}
+ {workspaceProperties
+ .filter(
+ (property) =>
+ Object.prototype.hasOwnProperty.call(propertyValues, property.id) ||
+ customPropertyPickerId === property.id,
+ )
+ .map((property) => {
+ const value = propertyValues[property.id];
+ return (
+ <CustomPropertyValueInput
+ key={property.id}
+ property={property}
+ value={value}
+ onChange={(next) => updatePropertyValue(property.id, next)}
+ open={customPropertyPickerId === property.id}
+ onOpenChange={(open) =>
+ setCustomPropertyPickerId(open ? property.id : null)
+ }
+ triggerRender={<PillButton />}
+ trigger={
+ <>
+ <PropertyIcon property={property} className="size-3.5 text-xs" />
+ <span className="max-w-32 truncate">{property.name}</span>
+ {value !== undefined && (
+ <span className="max-w-40 truncate text-muted-foreground">
+ <CustomPropertyValueDisplay property={property} value={value} />
+ </span>
+ )}
+ </>
+ }
+ />
+ );
+ })}
+
{/* Parent chip — appears when parent is set.
Placed before the ⋯ so it wraps to a new line with ⋯ if
space is tight, but ⋯ always stays last in DOM order. */}
@@ -833,6 +935,33 @@ export function ManualCreatePanel({
<ArrowDown className="h-3.5 w-3.5" />
{t(($) => $.create_issue.add_subissue)}
</DropdownMenuItem>
+ {workspaceProperties.length > 0 && (
+ <DropdownMenuSub>
+ <DropdownMenuSubTrigger>
+ <Shapes className="h-3.5 w-3.5" />
+ {t(($) => $.create_issue.custom_properties)}
+ </DropdownMenuSubTrigger>
+ <DropdownMenuSubContent className="w-56">
+ {workspaceProperties.map((property) => (
+ <DropdownMenuItem
+ key={property.id}
+ disabled={Object.prototype.hasOwnProperty.call(
+ propertyValues,
+ property.id,
+ )}
+ onClick={() => setCustomPropertyPickerId(property.id)}
+ >
+ <PropertyIcon property={property} className="size-3.5 text-xs" />
+ <span className="truncate">{property.name}</span>
+ {Object.prototype.hasOwnProperty.call(
+ propertyValues,
+ property.id,
+ ) && <Check className="ml-auto size-3.5" />}
+ </DropdownMenuItem>
+ ))}
+ </DropdownMenuSubContent>
+ </DropdownMenuSub>
+ )}
{parentIssueId && parentIssue && (
<>
<DropdownMenuSeparator />
diff --git a/packages/views/modals/quick-create-issue.test.tsx b/packages/views/modals/quick-create-issue.test.tsx
index 91c52546b2..a3a39519c8 100644
--- a/packages/views/modals/quick-create-issue.test.tsx
+++ b/packages/views/modals/quick-create-issue.test.tsx
@@ -6,6 +6,7 @@ import userEvent from "@testing-library/user-event";
const mockQuickCreateIssue = vi.hoisted(() => vi.fn());
const mockSetLastActor = vi.hoisted(() => vi.fn());
const mockSetLastProjectId = vi.hoisted(() => vi.fn());
+const mockSetVisibleFields = vi.hoisted(() => vi.fn());
const mockSetPrompt = vi.hoisted(() => vi.fn());
const mockClearPrompt = vi.hoisted(() => vi.fn());
const mockSetKeepOpen = vi.hoisted(() => vi.fn());
@@ -19,6 +20,8 @@ const mockQuickCreateStore = {
setLastActor: mockSetLastActor,
lastProjectId: null as string | null,
setLastProjectId: mockSetLastProjectId,
+ visibleFields: ["project"] as Array<"project" | "priority" | "due_date">,
+ setVisibleFields: mockSetVisibleFields,
prompt: "Persisted draft prompt",
setPrompt: mockSetPrompt,
clearPrompt: mockClearPrompt,
@@ -112,6 +115,7 @@ vi.mock("@multica/core/auth", () => ({
vi.mock("@multica/core/runtimes", () => ({
runtimeListOptions: () => ({ queryKey: ["runtimes"] }),
checkQuickCreateCliVersion: () => ({ state: "ok", min: "1.0.0" }),
+ checkQuickCreateFieldsCliVersion: () => ({ state: "ok", min: "1.0.0" }),
readRuntimeCliVersion: () => "1.2.3",
MIN_QUICK_CREATE_CLI_VERSION: "1.0.0",
}));
@@ -129,16 +133,43 @@ vi.mock("../common/actor-avatar", () => ({
}));
vi.mock("../issues/components", () => ({
- PriorityPicker: () => <div data-testid="priority-picker" />,
- DueDatePicker: () => <div data-testid="due-date-picker" />,
+ PriorityIcon: ({ priority }: { priority: string }) => <span>{priority}</span>,
+ PriorityPicker: ({ onUpdate }: any) => (
+ <button type="button" data-testid="priority-picker" onClick={() => onUpdate({ priority: "high" })}>
+ Priority
+ </button>
+ ),
+ DueDatePicker: ({ onUpdate }: any) => (
+ <button type="button" data-testid="due-date-picker" onClick={() => onUpdate({ due_date: "2026-08-01" })}>
+ Due date
+ </button>
+ ),
}));
vi.mock("../projects/components/project-picker", () => ({
- ProjectPicker: () => <div data-testid="project-picker" />,
+ ProjectPicker: ({ onUpdate }: any) => (
+ <button type="button" data-testid="project-picker" onClick={() => onUpdate({ project_id: "proj-1" })}>
+ Project
+ </button>
+ ),
}));
vi.mock("../common/pill-button", () => ({
- PillButton: () => <div data-testid="pill-button" />,
+ PillButton: ({ children, ...props }: any) => <button type="button" {...props}>{children}</button>,
+}));
+
+vi.mock("@multica/ui/components/ui/dropdown-menu", () => ({
+ DropdownMenu: ({ children }: { children: ReactNode }) => <>{children}</>,
+ DropdownMenuTrigger: ({ render }: { render: ReactNode }) => <>{render}</>,
+ DropdownMenuContent: ({ children }: { children: ReactNode }) => <>{children}</>,
+ DropdownMenuItem: ({ children, onClick }: any) => (
+ <button type="button" onClick={onClick}>{children}</button>
+ ),
+ DropdownMenuSeparator: () => null,
+}));
+
+vi.mock("@multica/ui/lib/utils", () => ({
+ cn: (...values: Array<string | false | null | undefined>) => values.filter(Boolean).join(" "),
}));
vi.mock("../editor", async () => {
@@ -277,7 +308,6 @@ vi.mock("@multica/ui/components/ui/button", () => ({
vi.mock("@multica/ui/components/ui/switch", () => ({
Switch: ({ checked, onCheckedChange }: { checked: boolean; onCheckedChange: (v: boolean) => void }) => (
<input
- aria-label="Create another"
type="checkbox"
checked={checked}
onChange={(e) => onCheckedChange(e.target.checked)}
@@ -320,6 +350,7 @@ describe("AgentCreatePanel", () => {
mockQuickCreateStore.lastActorType = null;
mockQuickCreateStore.lastActorId = null;
mockQuickCreateStore.lastProjectId = null;
+ mockQuickCreateStore.visibleFields = ["project"];
mockQuickCreateStore.prompt = "Persisted draft prompt";
mockQuickCreateStore.keepOpen = false;
mockProjectsQuery.data = [];
@@ -346,6 +377,11 @@ describe("AgentCreatePanel", () => {
mockSetKeepOpen.mockImplementation((value: boolean) => {
mockQuickCreateStore.keepOpen = value;
});
+ mockSetVisibleFields.mockImplementation(
+ (fields: Array<"project" | "priority" | "due_date">) => {
+ mockQuickCreateStore.visibleFields = fields;
+ },
+ );
});
it("loads the persisted prompt draft when no transient prompt is provided", () => {
@@ -391,6 +427,60 @@ describe("AgentCreatePanel", () => {
expect(onClose).toHaveBeenCalled();
});
+ it("reveals optional fields from the overflow and submits their values", async () => {
+ const user = userEvent.setup();
+
+ renderPanel({ onClose: vi.fn(), isExpanded: false, setIsExpanded: vi.fn() });
+
+ expect(screen.queryByTestId("priority-picker")).not.toBeInTheDocument();
+ await user.click(screen.getByText("Set priority..."));
+ await user.click(screen.getByTestId("priority-picker"));
+ await user.click(screen.getByRole("button", { name: /^Create$/i }));
+
+ await waitFor(() => {
+ expect(mockQuickCreateIssue).toHaveBeenCalledWith(
+ expect.objectContaining({
+ agent_id: "agent-1",
+ priority: "high",
+ }),
+ );
+ });
+ });
+
+ it("lets users choose which quick-create fields stay exposed", async () => {
+ const user = userEvent.setup();
+
+ renderPanel({ onClose: vi.fn(), isExpanded: false, setIsExpanded: vi.fn() });
+
+ await user.click(screen.getByRole("button", { name: "Customize fields..." }));
+ expect(screen.getByText("Quick create fields")).toBeInTheDocument();
+ await user.click(screen.getAllByRole("checkbox")[1]!);
+
+ expect(mockSetVisibleFields).toHaveBeenCalledWith(["project", "priority"]);
+ });
+
+ it("submits seeded priority and due date as authoritative quick-create fields", async () => {
+ const user = userEvent.setup();
+
+ renderPanel({
+ onClose: vi.fn(),
+ isExpanded: false,
+ setIsExpanded: vi.fn(),
+ data: { priority: "urgent", due_date: "2026-08-01" },
+ });
+
+ await user.click(screen.getByRole("button", { name: /^Create$/i }));
+
+ await waitFor(() => {
+ expect(mockQuickCreateIssue).toHaveBeenCalledWith(
+ expect.objectContaining({
+ priority: "urgent",
+ due_date: "2026-08-01",
+ }),
+ );
+ });
+ });
+
it("passes referenced upload attachment ids to quick-create", async () => {
const user = userEvent.setup();
const onClose = vi.fn();
diff --git a/packages/views/modals/quick-create-issue.tsx b/packages/views/modals/quick-create-issue.tsx
index c076f57a23..9df37466eb 100644
--- a/packages/views/modals/quick-create-issue.tsx
+++ b/packages/views/modals/quick-create-issue.tsx
@@ -1,10 +1,30 @@
"use client";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
-import { ArrowLeftRight, Check, ChevronRight, Maximize2, Minimize2, X as XIcon } from "lucide-react";
+import {
+ ArrowLeft,
+ ArrowLeftRight,
+ CalendarDays,
+ Check,
+ ChevronRight,
+ FolderKanban,
+ Maximize2,
+ Minimize2,
+ MoreHorizontal,
+ Settings2,
+ X as XIcon,
+} from "lucide-react";
import { useQuery } from "@tanstack/react-query";
import { toast } from "sonner";
+import { cn } from "@multica/ui/lib/utils";
import { DialogTitle } from "@multica/ui/components/ui/dialog";
+import {
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuSeparator,
+ DropdownMenuTrigger,
+} from "@multica/ui/components/ui/dropdown-menu";
import { Button } from "@multica/ui/components/ui/button";
import { Switch } from "@multica/ui/components/ui/switch";
import { api, ApiError } from "@multica/core/api";
@@ -15,21 +35,29 @@ import { projectListOptions } from "@multica/core/projects/queries";
import {
useQuickCreateStore,
type QuickCreateActorType,
+ type QuickCreateField,
} from "@multica/core/issues/stores/quick-create-store";
import { useIssueDraftStore } from "@multica/core/issues/stores/draft-store";
import { useCreateModeStore } from "@multica/core/issues/stores/create-mode-store";
import {
runtimeListOptions,
checkQuickCreateCliVersion,
+ checkQuickCreateFieldsCliVersion,
readRuntimeCliVersion,
- MIN_QUICK_CREATE_CLI_VERSION,
} from "@multica/core/runtimes";
import { useShortcut } from "@multica/core/shortcuts";
import { ShortcutKeycaps } from "../common/shortcut-keycaps";
-import { contentReferencesAttachment, type Agent, type Attachment, type Squad } from "@multica/core/types";
+import {
+ contentReferencesAttachment,
+ type Agent,
+ type Attachment,
+ type IssuePriority,
+ type Squad,
+} from "@multica/core/types";
import { ActorAvatar } from "../common/actor-avatar";
import { PillButton } from "../common/pill-button";
import { ProjectPicker } from "../projects/components/project-picker";
+import { DueDatePicker, PriorityIcon, PriorityPicker } from "../issues/components";
import { canAssignAgent } from "../issues/components/pickers/assignee-picker";
import {
PropertyPicker,
@@ -131,6 +159,8 @@ export function AgentCreatePanel({
const setLastActor = useQuickCreateStore((s) => s.setLastActor);
const lastProjectId = useQuickCreateStore((s) => s.lastProjectId);
const setLastProjectId = useQuickCreateStore((s) => s.setLastProjectId);
+ const visibleFields = useQuickCreateStore((s) => s.visibleFields);
+ const setVisibleFields = useQuickCreateStore((s) => s.setVisibleFields);
const promptDraft = useQuickCreateStore((s) => s.prompt);
const setPrompt = useQuickCreateStore((s) => s.setPrompt);
const clearPrompt = useQuickCreateStore((s) => s.clearPrompt);
@@ -203,6 +233,14 @@ export function AgentCreatePanel({
const seed = (data?.project_id as string | undefined) ?? lastProjectId;
return seed ?? null;
});
+ const [priority, setPriority] = useState<IssuePriority>(
+ (data?.priority as IssuePriority | undefined) ?? "none",
+ );
+ const [dueDate, setDueDate] = useState<string | null>(
+ (data?.due_date as string | undefined) ?? null,
+ );
+ const [fieldPickerOpen, setFieldPickerOpen] = useState<QuickCreateField | null>(null);
+ const [settingsOpen, setSettingsOpen] = useState(false);
// Parent-issue context — seeded by `openCreateSubIssue` when the modal is
// opened from the "Add sub issue" entry on an existing issue. We carry it
@@ -244,11 +282,20 @@ export function AgentCreatePanel({
: undefined,
[runtimes, selectedAgent?.runtime_id],
);
- const versionCheck = useMemo(
- () => checkQuickCreateCliVersion(readRuntimeCliVersion(selectedRuntime?.metadata)),
- [selectedRuntime?.metadata],
+ const runtimeCliVersion = readRuntimeCliVersion(selectedRuntime?.metadata);
+ const baseVersionCheck = useMemo(
+ () => checkQuickCreateCliVersion(runtimeCliVersion),
+ [runtimeCliVersion],
);
- const versionBlocked = versionCheck.state !== "ok";
+ const fieldVersionCheck = useMemo(
+ () => checkQuickCreateFieldsCliVersion(runtimeCliVersion),
+ [runtimeCliVersion],
+ );
+ const usesExplicitFields = priority !== "none" || dueDate !== null;
+ const versionCheck = usesExplicitFields ? fieldVersionCheck : baseVersionCheck;
+ const versionBlocked =
+ baseVersionCheck.state !== "ok" ||
+ (usesExplicitFields && fieldVersionCheck.state !== "ok");
const initialPrompt = (data?.prompt as string) || promptDraft;
// The editor is uncontrolled — we read the latest markdown via the ref at
@@ -311,6 +358,8 @@ export function AgentCreatePanel({
: { squad_id: actor.id }),
prompt: md,
project_id: projectId ?? undefined,
+ ...(priority !== "none" ? { priority } : {}),
+ ...(dueDate ? { due_date: dueDate } : {}),
parent_issue_id: parentIssueId,
...(activeAttachmentIds.length > 0 ? { attachment_ids: activeAttachmentIds } : {}),
});
@@ -360,7 +409,7 @@ export function AgentCreatePanel({
setError(
t(($) => $.create_issue.agent.error_daemon_version, {
current: cur,
- min: body.min_version || MIN_QUICK_CREATE_CLI_VERSION,
+ min: body.min_version || versionCheck.min,
}),
);
setSubmitting(false);
@@ -403,22 +452,49 @@ export function AgentCreatePanel({
// through.
const carry: Record<string, unknown> = {};
if (projectId) carry.project_id = projectId;
+ if (priority !== "none") carry.priority = priority;
+ if (dueDate) carry.due_date = dueDate;
if (parentIssueId) carry.parent_issue_id = parentIssueId;
if (parentIssueIdentifier) carry.parent_issue_identifier = parentIssueIdentifier;
onSwitchMode?.(Object.keys(carry).length > 0 ? carry : null);
};
+ const toggleVisibleField = (field: QuickCreateField, visible: boolean) => {
+ setVisibleFields(
+ visible
+ ? [...visibleFields.filter((item) => item !== field), field]
+ : visibleFields.filter((item) => item !== field),
+ );
+ };
+
+ const openFieldSettings = () => {
+ setPrompt(editorRef.current?.getMarkdown() ?? "");
+ setFieldPickerOpen(null);
+ setSettingsOpen(true);
+ };
+
return (
<>
<DialogTitle className="sr-only">{t(($) => $.create_issue.sr_agent)}</DialogTitle>
{/* Header */}
<div className="flex items-center justify-between px-5 pt-3 pb-2 shrink-0">
- <div className="flex items-center gap-1.5 text-xs">
- <span className="text-muted-foreground">{workspaceName}</span>
- <ChevronRight className="size-3 text-muted-foreground/50" />
- <span className="font-medium">{t(($) => $.create_issue.agent_breadcrumb)}</span>
- </div>
+ {settingsOpen ? (
+ <button
+ type="button"
+ onClick={() => setSettingsOpen(false)}
+ className="flex items-center gap-1.5 rounded-sm px-1 py-0.5 text-xs font-medium hover:bg-accent/60"
+ >
+ <ArrowLeft className="size-3.5" />
+ {t(($) => $.create_issue.agent.field_settings_title)}
+ </button>
+ ) : (
+ <div className="flex items-center gap-1.5 text-xs">
+ <span className="text-muted-foreground">{workspaceName}</span>
+ <ChevronRight className="size-3 text-muted-foreground/50" />
+ <span className="font-medium">{t(($) => $.create_issue.agent_breadcrumb)}</span>
+ </div>
+ )}
{/* Native `title` instead of Base UI Tooltip — Tooltip opens on
keyboard focus, and the dialog's focus trap briefly lands focus
on the first focusable element on mount, causing the tooltip to
@@ -445,6 +521,47 @@ export function AgentCreatePanel({
</div>
</div>
+ {settingsOpen ? (
+ <div className="flex min-h-0 flex-1 flex-col">
+ <div className="flex-1 overflow-y-auto px-5 py-3">
+ <p className="mb-3 text-xs text-muted-foreground">
+ {t(($) => $.create_issue.agent.field_settings_description)}
+ </p>
+ <div className="overflow-hidden rounded-lg border">
+ {([
+ ["project", <FolderKanban key="project" className="size-4 text-muted-foreground" />],
+ ["priority", <PriorityIcon key="priority" priority="none" className="size-4" />],
+ ["due_date", <CalendarDays key="due-date" className="size-4 text-muted-foreground" />],
+ ] as const).map(([field, icon], index) => (
+ <label
+ key={field}
+ className={cn(
+ "flex cursor-pointer items-center gap-3 px-3 py-2.5 text-sm",
+ index > 0 && "border-t",
+ )}
+ >
+ {icon}
+ <span className="flex-1">
+ {t(($) => $.create_issue.agent.fields[field])}
+ </span>
+ <Switch
+ size="sm"
+ checked={visibleFields.includes(field)}
+ onCheckedChange={(checked) => toggleVisibleField(field, checked)}
+ />
+ </label>
+ ))}
+ </div>
+ </div>
+ <div className="flex justify-end border-t px-4 py-3">
+ <Button size="sm" onClick={() => setSettingsOpen(false)}>
+ {t(($) => $.create_issue.agent.field_settings_done)}
+ </Button>
+ </div>
+ </div>
+ ) : (
+ <>
+
{/* Actor picker — agents and squads in one searchable list. Squads
route to their leader agent on the backend; the leader runs the
quick-create flow with the squad's Operating Protocol layered
@@ -507,12 +624,9 @@ export function AgentCreatePanel({
<div className="px-5 pb-2 text-xs text-destructive">{error}</div>
)}
- {/* Property toolbar — mirrors the manual panel's pill row so the
- project pill sits in the same place across both modes. Agent mode
- owns only the project (status / priority / assignee / due-date are
- inferred from the prompt), so it's a single pill. The pick is
- persisted per-workspace via useQuickCreateStore.lastProjectId so
- users targeting one project skip retyping "in project X".
+ {/* Property toolbar — the project is visible by default; priority and
+ due date live behind the overflow until exposed in settings or
+ given a value. The project pick remains workspace-persistent.
When the modal was opened from "Add sub issue" on an existing
issue, a read-only chip on the same row tells the user that the
new issue will be filed as a sub-issue of that parent — the agent
@@ -521,12 +635,81 @@ export function AgentCreatePanel({
it non-editable: changing the parent is a `Set parent` action on
the parent itself, not a knob in the quick-create flow. */}
<div className="flex items-center gap-1.5 px-4 pb-2 shrink-0 flex-wrap">
- <ProjectPicker
- projectId={projectId}
- onUpdate={(u) => setProjectId(u.project_id ?? null)}
- triggerRender={<PillButton />}
- align="start"
- />
+ {(visibleFields.includes("project") ||
+ projectId !== null ||
+ fieldPickerOpen === "project") && (
+ <ProjectPicker
+ projectId={projectId}
+ onUpdate={(u) => setProjectId(u.project_id ?? null)}
+ triggerRender={<PillButton />}
+ align="start"
+ open={fieldPickerOpen === "project" ? true : undefined}
+ onOpenChange={(open) => setFieldPickerOpen(open ? "project" : null)}
+ />
+ )}
+ {(visibleFields.includes("priority") ||
+ priority !== "none" ||
+ fieldPickerOpen === "priority") && (
+ <PriorityPicker
+ priority={priority}
+ onUpdate={(updates) => {
+ if (updates.priority) setPriority(updates.priority);
+ }}
+ triggerRender={<PillButton />}
+ align="start"
+ open={fieldPickerOpen === "priority" ? true : undefined}
+ onOpenChange={(open) => setFieldPickerOpen(open ? "priority" : null)}
+ />
+ )}
+ {(visibleFields.includes("due_date") ||
+ dueDate !== null ||
+ fieldPickerOpen === "due_date") && (
+ <DueDatePicker
+ dueDate={dueDate}
+ onUpdate={(updates) => setDueDate(updates.due_date ?? null)}
+ triggerRender={<PillButton />}
+ align="start"
+ open={fieldPickerOpen === "due_date" ? true : undefined}
+ onOpenChange={(open) => setFieldPickerOpen(open ? "due_date" : null)}
+ />
+ )}
+ <DropdownMenu>
+ <DropdownMenuTrigger
+ render={
+ <PillButton
+ aria-label={t(($) => $.create_issue.agent.more_fields_aria)}
+ title={t(($) => $.create_issue.agent.more_fields_aria)}
+ >
+ <MoreHorizontal className="size-3.5" />
+ </PillButton>
+ }
+ />
+ <DropdownMenuContent align="start" className="w-52">
+ {!visibleFields.includes("project") && projectId === null && (
+ <DropdownMenuItem onClick={() => setFieldPickerOpen("project")}>
+ <FolderKanban className="size-3.5 text-muted-foreground" />
+ {t(($) => $.create_issue.agent.set_project)}
+ </DropdownMenuItem>
+ )}
+ {!visibleFields.includes("priority") && priority === "none" && (
+ <DropdownMenuItem onClick={() => setFieldPickerOpen("priority")}>
+ <PriorityIcon priority="none" className="size-3.5" />
+ {t(($) => $.create_issue.agent.set_priority)}
+ </DropdownMenuItem>
+ )}
+ {!visibleFields.includes("due_date") && dueDate === null && (
+ <DropdownMenuItem onClick={() => setFieldPickerOpen("due_date")}>
+ <CalendarDays className="size-3.5 text-muted-foreground" />
+ {t(($) => $.create_issue.agent.set_due_date)}
+ </DropdownMenuItem>
+ )}
+ <DropdownMenuSeparator />
+ <DropdownMenuItem onClick={openFieldSettings}>
+ <Settings2 className="size-3.5 text-muted-foreground" />
+ {t(($) => $.create_issue.agent.customize_fields)}
+ </DropdownMenuItem>
+ </DropdownMenuContent>
+ </DropdownMenu>
{parentIssueId && (
<span
data-testid="agent-sub-issue-chip"
@@ -611,6 +794,8 @@ export function AgentCreatePanel({
</Button>
</div>
</div>
+ </>
+ )}
</>
);
}
diff --git a/packages/views/projects/components/project-picker.test.tsx b/packages/views/projects/components/project-picker.test.tsx
new file mode 100644
index 0000000000..63a397bead
--- /dev/null
+++ b/packages/views/projects/components/project-picker.test.tsx
@@ -0,0 +1,65 @@
+import { cloneElement, isValidElement, type ReactElement, type ReactNode } from "react";
+import { describe, expect, it, vi } from "vitest";
+import { render, screen } from "@testing-library/react";
+import userEvent from "@testing-library/user-event";
+import { I18nProvider } from "@multica/core/i18n/react";
+import enProjects from "../../locales/en/projects.json";
+import { ProjectPicker } from "./project-picker";
+import { PillButton } from "../../common/pill-button";
+
+vi.mock("@tanstack/react-query", () => ({
+ useQuery: () => ({
+ data: [{ id: "project-1", title: "Launch Command Center", icon: null }],
+ }),
+}));
+
+vi.mock("@multica/core/hooks", () => ({
+ useWorkspaceId: () => "workspace-1",
+}));
+
+vi.mock("@multica/core/projects/queries", () => ({
+ projectListOptions: () => ({ queryKey: ["projects"] }),
+}));
+
+vi.mock("./project-icon", () => ({
+ ProjectIcon: () => <span data-testid="project-icon" />,
+}));
+
+vi.mock("@multica/ui/components/ui/dropdown-menu", () => ({
+ DropdownMenu: ({ children }: { children: ReactNode }) => <>{children}</>,
+ DropdownMenuTrigger: ({ render: trigger, children }: { render?: ReactElement; children: ReactNode }) =>
+ isValidElement(trigger)
+ ? cloneElement(trigger, {}, children)
+ : <button type="button">{children}</button>,
+ DropdownMenuContent: ({ children }: { children: ReactNode }) => <>{children}</>,
+ DropdownMenuItem: ({ children, onClick }: { children: ReactNode; onClick?: () => void }) => (
+ <button type="button" onClick={onClick}>{children}</button>
+ ),
+ DropdownMenuSeparator: () => null,
+}));
+
+describe("ProjectPicker", () => {
+ it("shows a hover clear action for the selected project", async () => {
+ const user = userEvent.setup();
+ const onUpdate = vi.fn();
+
+ render(
+ <I18nProvider locale="en" resources={{ en: { projects: enProjects } }}>
+ <ProjectPicker
+ projectId="project-1"
+ onUpdate={onUpdate}
+ triggerRender={<PillButton />}
+ />
+ </I18nProvider>,
+ );
+
+ const clear = screen
+ .getAllByRole("button", { name: "Remove from project" })
+ .find((button) => button.className.includes("group-hover/project:opacity-100"));
+ expect(clear).toBeDefined();
+ expect(clear!.className).toContain("group-hover/project:opacity-100");
+
+ await user.click(clear!);
+ expect(onUpdate).toHaveBeenCalledWith({ project_id: null });
+ });
+});
diff --git a/packages/views/projects/components/project-picker.tsx b/packages/views/projects/components/project-picker.tsx
index 53c3cb6b6b..9020f9d8cf 100644
--- a/packages/views/projects/components/project-picker.tsx
+++ b/packages/views/projects/components/project-picker.tsx
@@ -21,6 +21,8 @@ export function ProjectPicker({
triggerRender,
align = "start",
defaultOpen = false,
+ open,
+ onOpenChange,
}: {
projectId: string | null;
onUpdate: (updates: Partial<UpdateIssueRequest>) => void;
@@ -29,6 +31,8 @@ export function ProjectPicker({
/** Open the dropdown on first mount. Used by progressive-disclosure
* sidebars so a newly-added field immediately enters edit state. */
defaultOpen?: boolean;
+ open?: boolean;
+ onOpenChange?: (open: boolean) => void;
}) {
const { t } = useT("projects");
const wsId = useWorkspaceId();
@@ -36,18 +40,34 @@ export function ProjectPicker({
const current = projects.find((p) => p.id === projectId);
return (
- <DropdownMenu defaultOpen={defaultOpen}>
- <DropdownMenuTrigger
- className={triggerRender ? undefined : "flex items-center gap-1.5 cursor-pointer rounded px-1 -mx-1 hover:bg-accent/30 transition-colors overflow-hidden"}
- render={triggerRender}
- >
- {current ? (
- <ProjectIcon project={current} size="sm" />
- ) : (
- <FolderKanban className="h-3.5 w-3.5 shrink-0 text-muted-foreground" />
+ <DropdownMenu defaultOpen={defaultOpen} open={open} onOpenChange={onOpenChange}>
+ <div className="group/project relative inline-flex min-w-0">
+ <DropdownMenuTrigger
+ className={triggerRender ? undefined : "flex items-center gap-1.5 cursor-pointer rounded px-1 -mx-1 hover:bg-accent/30 transition-colors overflow-hidden"}
+ render={triggerRender}
+ >
+ {current ? (
+ <ProjectIcon project={current} size="sm" />
+ ) : (
+ <FolderKanban className="h-3.5 w-3.5 shrink-0 text-muted-foreground" />
+ )}
+ <span className="truncate">{current ? current.title : t(($) => $.picker.no_project)}</span>
+ </DropdownMenuTrigger>
+ {current && (
+ <button
+ type="button"
+ aria-label={t(($) => $.picker.remove)}
+ onClick={(event) => {
+ event.preventDefault();
+ event.stopPropagation();
+ onUpdate({ project_id: null });
+ }}
+ className="pointer-events-none absolute inset-y-0 right-0 flex w-7 items-center justify-center rounded-r-full bg-background/95 text-muted-foreground opacity-0 transition-opacity hover:text-foreground group-hover/project:pointer-events-auto group-hover/project:opacity-100 focus-visible:pointer-events-auto focus-visible:opacity-100"
+ >
+ <X className="size-3" />
+ </button>
)}
- <span className="truncate">{current ? current.title : t(($) => $.picker.no_project)}</span>
- </DropdownMenuTrigger>
+ </div>
<DropdownMenuContent align={align} className="w-52">
{projects.map((p) => (
<DropdownMenuItem key={p.id} onClick={() => onUpdate({ project_id: p.id })}>
diff --git a/server/cmd/server/quick_create_subscriber_test.go b/server/cmd/server/quick_create_subscriber_test.go
index 14e638a1fe..14a615f76f 100644
--- a/server/cmd/server/quick_create_subscriber_test.go
+++ b/server/cmd/server/quick_create_subscriber_test.go
@@ -36,6 +36,8 @@ func TestQuickCreateCompletion_SubscribesRequester(t *testing.T) {
parseUUID(agentID),
pgtype.UUID{},
"please file a bug",
+ "",
+ "",
pgtype.UUID{},
pgtype.UUID{},
nil,
@@ -111,6 +113,8 @@ func TestQuickCreateFailure_DoesNotSubscribeRequester(t *testing.T) {
parseUUID(agentID),
pgtype.UUID{},
"another bug",
+ "",
+ "",
pgtype.UUID{},
pgtype.UUID{},
nil,
diff --git a/server/internal/daemon/prompt.go b/server/internal/daemon/prompt.go
index 68779fa5e3..2a7892421b 100644
--- a/server/internal/daemon/prompt.go
+++ b/server/internal/daemon/prompt.go
@@ -69,7 +69,11 @@ func buildQuickCreatePrompt(task Task) string {
b.WriteString(" Passing the description: a short, single-line body with no code, quotes, backticks, `$()`, or other special characters may go inline via `--description \"...\"`. Anything multi-line, or containing code snippets / file paths / quotes / backticks / `$()` / special characters, or otherwise long — which quick-create descriptions usually are — MUST be written to `./description.md` and passed with `--description-file ./description.md`; passing rich text inline lets the shell rewrite or truncate it (MUL-2904). That file MUST live inside your current working directory (e.g. `./description.md`) — never `/tmp` or any machine-shared path, where a different run may have left a stale file that would silently become this issue's description. If the file write fails for any reason, stop and fix it; never run `--description-file` against a file whose write did not succeed.\n\n")
// priority
- b.WriteString("- **priority**: one of `urgent`, `high`, `medium`, `low`, or omit. Map P0/P1 → urgent/high; \"asap\" → urgent. If unspecified, omit.\n\n")
+ if task.QuickCreatePriority != "" {
+ fmt.Fprintf(&b, "- **priority**: required for this run. Pass `--priority %s`; the quick-create selection is authoritative.\n\n", task.QuickCreatePriority)
+ } else {
+ b.WriteString("- **priority**: one of `urgent`, `high`, `medium`, `low`, or omit. Map P0/P1 → urgent/high; \"asap\" → urgent. If unspecified, omit.\n\n")
+ }
// assignee
b.WriteString("- **assignee**:\n")
@@ -100,6 +104,10 @@ func buildQuickCreatePrompt(task Task) string {
b.WriteString(" - When the user did NOT name an assignee, default to YOURSELF (the picker agent): pass `--assignee-id <your agent UUID>` (preferred) or `--assignee <your agent name>`. Never leave the issue unassigned.\n\n")
}
+ if task.QuickCreateDueDate != "" {
+ fmt.Fprintf(&b, "- **due-date**: required for this run. Pass `--due-date %s`; the quick-create selection is authoritative.\n\n", task.QuickCreateDueDate)
+ }
+
// project — pinned by the modal when the user picked one, otherwise
// omitted so the platform routes to the workspace default. Always pass
// the UUID (never a name) so the issue lands in the right project even
diff --git a/server/internal/daemon/prompt_test.go b/server/internal/daemon/prompt_test.go
index f1cfe72ea2..d850731bea 100644
--- a/server/internal/daemon/prompt_test.go
+++ b/server/internal/daemon/prompt_test.go
@@ -154,6 +154,26 @@ func TestBuildQuickCreatePromptProjectPinning(t *testing.T) {
}
}
+func TestBuildQuickCreatePromptExplicitPriorityAndDueDate(t *testing.T) {
+ out := buildQuickCreatePrompt(Task{
+ QuickCreatePrompt: "fix the login button color",
+ QuickCreatePriority: "urgent",
+ QuickCreateDueDate: "2026-08-01",
+ })
+ for _, want := range []string{
+ "--priority urgent",
+ "--due-date 2026-08-01",
+ "quick-create selection is authoritative",
+ } {
+ if !strings.Contains(out, want) {
+ t.Errorf("buildQuickCreatePrompt with explicit fields missing %q\n--- output ---\n%s", want, out)
+ }
+ }
+ if strings.Contains(out, "Map P0/P1") {
+ t.Errorf("explicit priority must replace inference rules, got:\n%s", out)
+ }
+}
+
// TestBuildQuickCreatePromptParentPinning verifies that when the user
// opened quick-create from "Add sub issue" on an existing issue, the prompt
// instructs the agent to pass `--parent <uuid>` so the new issue is filed
diff --git a/server/internal/daemon/types.go b/server/internal/daemon/types.go
index 49b038f2f2..89ac57d595 100644
--- a/server/internal/daemon/types.go
+++ b/server/internal/daemon/types.go
@@ -66,42 +66,44 @@ type Task struct {
// prompt set in Settings → General). Server populates this on every claim
// regardless of task kind so the daemon can inject `## Workspace Context`
// into the brief. Empty when the owner hasn't set one.
- WorkspaceContext string `json:"workspace_context,omitempty"`
- ThreadName string `json:"thread_name,omitempty"` // semantic title for provider-native session/thread history
- Agent *AgentData `json:"agent,omitempty"`
- ConnectedApps []ConnectedAppData `json:"connected_apps,omitempty"` // per-run app capabilities mounted through runtime MCP overlays
- Repos []RepoData `json:"repos,omitempty"`
- ProjectID string `json:"project_id,omitempty"` // issue's project, when present
- ProjectTitle string `json:"project_title,omitempty"` // human-readable project title for context injection
- ProjectDescription string `json:"project_description,omitempty"` // durable project-level context injected into the brief
- ProjectResources []ProjectResourceData `json:"project_resources,omitempty"` // project-scoped resources to expose to the agent
- IsLeaderTask bool `json:"is_leader_task,omitempty"` // true when executing in the squad-leader coordinator role
- PriorSessionID string `json:"prior_session_id,omitempty"` // Claude session ID from a previous task on this issue
- PriorWorkDir string `json:"prior_work_dir,omitempty"` // work_dir from a previous task on this issue
- TriggerCommentID string `json:"trigger_comment_id,omitempty"` // comment that triggered this task
- CoalescedCommentIDs []string `json:"coalesced_comment_ids,omitempty"` // MUL-4195: earlier comments folded into this run while it was still queued; the agent must address these in addition to the (newest) triggering comment. Empty for old servers / non-merged runs
- CoalescedComments []CoalescedCommentData `json:"coalesced_comments,omitempty"` // MUL-4195: full detail of the folded comments (thread_id/author/created_at/content) so the prompt can address each without assuming a shared thread. Empty for old servers / non-merged runs
- TriggerThreadID string `json:"trigger_thread_id,omitempty"` // root comment ID for the triggering thread; falls back to trigger_comment_id on old servers
- TriggerCommentContent string `json:"trigger_comment_content,omitempty"` // content of the triggering comment
- TriggerAuthorType string `json:"trigger_author_type,omitempty"` // "agent" or "member" — author kind for the triggering comment
- TriggerAuthorName string `json:"trigger_author_name,omitempty"` // display name of the triggering comment author
- NewCommentCount int `json:"new_comment_count,omitempty"` // issue-wide comments since this agent's last run (excludes its own and the injected trigger); 0/omitted for old daemons or cold start
- NewCommentsSince string `json:"new_comments_since,omitempty"` // RFC3339 anchor (last run's started_at) the count is measured from; empty on cold start
- ChatSessionID string `json:"chat_session_id,omitempty"` // non-empty for chat tasks
- ChatChannelType string `json:"chat_channel_type,omitempty"` // "slack" when the chat session is backed by an IM channel; empty for a web-only chat. Drives the channel-awareness block in the prompt
- ChatInThread bool `json:"chat_in_thread,omitempty"` // true when the latest @mention was a thread reply; selects which read command the prompt tells the agent to start with
- ChatMessage string `json:"chat_message,omitempty"` // user message content for chat tasks
- ChatMessageAttachments []ChatAttachmentMeta `json:"chat_message_attachments,omitempty"` // attachments linked to the chat message; agent uses these to `multica attachment download <id>`
- ChatIntro bool `json:"chat_intro,omitempty"` // true for the agent's proactive self-introduction chat (no user message); selects the self-introduction prompt in buildChatPrompt
- AutopilotRunID string `json:"autopilot_run_id,omitempty"` // non-empty for autopilot run_only tasks
- AutopilotID string `json:"autopilot_id,omitempty"` // autopilot that spawned this run
- AutopilotTitle string `json:"autopilot_title,omitempty"` // autopilot title used as task context
- AutopilotDescription string `json:"autopilot_description,omitempty"` // autopilot description used as task prompt
- AutopilotSource string `json:"autopilot_source,omitempty"` // manual, schedule, webhook, or api
- AutopilotTriggerPayload json.RawMessage `json:"autopilot_trigger_payload,omitempty"` // optional trigger payload for webhook/api runs
- QuickCreatePrompt string `json:"quick_create_prompt,omitempty"` // user's natural-language input for quick-create tasks
- QuickCreateAttachmentIDs []string `json:"quick_create_attachment_ids,omitempty"` // attachments uploaded in the quick-create prompt and bound by issue create
- HandoffNote string `json:"handoff_note,omitempty"` // assignment handoff instruction; rendered into the opening prompt + issue_context.md
+ WorkspaceContext string `json:"workspace_context,omitempty"`
+ ThreadName string `json:"thread_name,omitempty"` // semantic title for provider-native session/thread history
+ Agent *AgentData `json:"agent,omitempty"`
+ ConnectedApps []ConnectedAppData `json:"connected_apps,omitempty"` // per-run app capabilities mounted through runtime MCP overlays
+ Repos []RepoData `json:"repos,omitempty"`
+ ProjectID string `json:"project_id,omitempty"` // issue's project, when present
+ ProjectTitle string `json:"project_title,omitempty"` // human-readable project title for context injection
+ ProjectDescription string `json:"project_description,omitempty"` // durable project-level context injected into the brief
+ ProjectResources []ProjectResourceData `json:"project_resources,omitempty"` // project-scoped resources to expose to the agent
+ IsLeaderTask bool `json:"is_leader_task,omitempty"` // true when executing in the squad-leader coordinator role
+ PriorSessionID string `json:"prior_session_id,omitempty"` // Claude session ID from a previous task on this issue
+ PriorWorkDir string `json:"prior_work_dir,omitempty"` // work_dir from a previous task on this issue
+ TriggerCommentID string `json:"trigger_comment_id,omitempty"` // comment that triggered this task
+ CoalescedCommentIDs []string `json:"coalesced_comment_ids,omitempty"` // MUL-4195: earlier comments folded into this run while it was still queued; the agent must address these in addition to the (newest) triggering comment. Empty for old servers / non-merged runs
+ CoalescedComments []CoalescedCommentData `json:"coalesced_comments,omitempty"` // MUL-4195: full detail of the folded comments (thread_id/author/created_at/content) so the prompt can address each without assuming a shared thread. Empty for old servers / non-merged runs
+ TriggerThreadID string `json:"trigger_thread_id,omitempty"` // root comment ID for the triggering thread; falls back to trigger_comment_id on old servers
+ TriggerCommentContent string `json:"trigger_comment_content,omitempty"` // content of the triggering comment
+ TriggerAuthorType string `json:"trigger_author_type,omitempty"` // "agent" or "member" — author kind for the triggering comment
+ TriggerAuthorName string `json:"trigger_author_name,omitempty"` // display name of the triggering comment author
+ NewCommentCount int `json:"new_comment_count,omitempty"` // issue-wide comments since this agent's last run (excludes its own and the injected trigger); 0/omitted for old daemons or cold start
+ NewCommentsSince string `json:"new_comments_since,omitempty"` // RFC3339 anchor (last run's started_at) the count is measured from; empty on cold start
+ ChatSessionID string `json:"chat_session_id,omitempty"` // non-empty for chat tasks
+ ChatChannelType string `json:"chat_channel_type,omitempty"` // "slack" when the chat session is backed by an IM channel; empty for a web-only chat. Drives the channel-awareness block in the prompt
+ ChatInThread bool `json:"chat_in_thread,omitempty"` // true when the latest @mention was a thread reply; selects which read command the prompt tells the agent to start with
+ ChatMessage string `json:"chat_message,omitempty"` // user message content for chat tasks
+ ChatMessageAttachments []ChatAttachmentMeta `json:"chat_message_attachments,omitempty"` // attachments linked to the chat message; agent uses these to `multica attachment download <id>`
+ ChatIntro bool `json:"chat_intro,omitempty"` // true for the agent's proactive self-introduction chat (no user message); selects the self-introduction prompt in buildChatPrompt
+ AutopilotRunID string `json:"autopilot_run_id,omitempty"` // non-empty for autopilot run_only tasks
+ AutopilotID string `json:"autopilot_id,omitempty"` // autopilot that spawned this run
+ AutopilotTitle string `json:"autopilot_title,omitempty"` // autopilot title used as task context
+ AutopilotDescription string `json:"autopilot_description,omitempty"` // autopilot description used as task prompt
+ AutopilotSource string `json:"autopilot_source,omitempty"` // manual, schedule, webhook, or api
+ AutopilotTriggerPayload json.RawMessage `json:"autopilot_trigger_payload,omitempty"` // optional trigger payload for webhook/api runs
+ QuickCreatePrompt string `json:"quick_create_prompt,omitempty"` // user's natural-language input for quick-create tasks
+ QuickCreatePriority string `json:"quick_create_priority,omitempty"` // explicit priority selected in quick-create
+ QuickCreateDueDate string `json:"quick_create_due_date,omitempty"` // explicit calendar due date selected in quick-create
+ QuickCreateAttachmentIDs []string `json:"quick_create_attachment_ids,omitempty"` // attachments uploaded in the quick-create prompt and bound by issue create
+ HandoffNote string `json:"handoff_note,omitempty"` // assignment handoff instruction; rendered into the opening prompt + issue_context.md
SquadID string `json:"squad_id,omitempty"` // when the picker was a squad, the squad's UUID; Agent is still the resolved leader
SquadName string `json:"squad_name,omitempty"` // display name for the picker squad, used in prompt text
diff --git a/server/internal/handler/agent.go b/server/internal/handler/agent.go
index c2f4f4a60b..88bfef2817 100644
--- a/server/internal/handler/agent.go
+++ b/server/internal/handler/agent.go
@@ -335,6 +335,8 @@ type AgentTaskResponse struct {
AutopilotSource string `json:"autopilot_source,omitempty"` // manual, schedule, webhook, or api
AutopilotTriggerPayload json.RawMessage `json:"autopilot_trigger_payload,omitempty"` // optional trigger payload for webhook/api runs
QuickCreatePrompt string `json:"quick_create_prompt,omitempty"` // user's natural-language input for quick-create tasks
+ QuickCreatePriority string `json:"quick_create_priority,omitempty"` // explicit priority selected in quick-create
+ QuickCreateDueDate string `json:"quick_create_due_date,omitempty"` // explicit calendar due date selected in quick-create
QuickCreateAttachmentIDs []string `json:"quick_create_attachment_ids,omitempty"` // attachment ids uploaded in the quick-create prompt and bound on issue create
HandoffNote string `json:"handoff_note,omitempty"` // assignment handoff instruction; rendered into the run's opening prompt + issue_context.md (omitempty so old daemons ignore it)
SquadID string `json:"squad_id,omitempty"` // for quick-create tasks where the picker was a squad; Agent is still the resolved leader
diff --git a/server/internal/handler/daemon.go b/server/internal/handler/daemon.go
index 40b91211be..f3996499fb 100644
--- a/server/internal/handler/daemon.go
+++ b/server/internal/handler/daemon.go
@@ -2215,6 +2215,8 @@ func (h *Handler) buildClaimedTaskResponse(r *http.Request, task *db.AgentTaskQu
if json.Unmarshal(task.Context, &qc) == nil && qc.Type == service.QuickCreateContextType {
hasQuickCreate = true
resp.QuickCreatePrompt = qc.Prompt
+ resp.QuickCreatePriority = qc.Priority
+ resp.QuickCreateDueDate = qc.DueDate
resp.QuickCreateAttachmentIDs = append([]string(nil), qc.AttachmentIDs...)
resp.ThreadName = qc.Prompt
resp.WorkspaceID = qc.WorkspaceID
diff --git a/server/internal/handler/daemon_test.go b/server/internal/handler/daemon_test.go
index 3fd132c47c..8842ce23c0 100644
--- a/server/internal/handler/daemon_test.go
+++ b/server/internal/handler/daemon_test.go
@@ -3091,6 +3091,8 @@ type claimRuntimeGuardTask struct {
ChatMessage string `json:"chat_message"`
ThreadName string `json:"thread_name"`
QuickCreateAttachmentIDs []string `json:"quick_create_attachment_ids"`
+ QuickCreatePriority string `json:"quick_create_priority"`
+ QuickCreateDueDate string `json:"quick_create_due_date"`
ProjectID string `json:"project_id"`
ProjectDescription string `json:"project_description"`
}
@@ -3853,6 +3855,8 @@ func TestClaimTask_QuickCreatePopulatesThreadName(t *testing.T) {
"prompt": quickPrompt,
"requester_id": testUserID,
"workspace_id": testWorkspaceID,
+ "priority": "high",
+ "due_date": "2026-08-01",
"attachment_ids": []string{attachmentID},
})
@@ -3870,6 +3874,9 @@ func TestClaimTask_QuickCreatePopulatesThreadName(t *testing.T) {
if len(task.QuickCreateAttachmentIDs) != 1 || task.QuickCreateAttachmentIDs[0] != attachmentID {
t.Fatalf("quick-create attachment ids = %#v, want [%q]", task.QuickCreateAttachmentIDs, attachmentID)
}
+ if task.QuickCreatePriority != "high" || task.QuickCreateDueDate != "2026-08-01" {
+ t.Fatalf("quick-create fields = {%q, %q}, want {high, 2026-08-01}", task.QuickCreatePriority, task.QuickCreateDueDate)
+ }
}
func TestClaimTask_ChatForceFreshSessionSkipsPriorSession(t *testing.T) {
diff --git a/server/internal/handler/issue.go b/server/internal/handler/issue.go
index 6dbf29d281..799bc101e2 100644
--- a/server/internal/handler/issue.go
+++ b/server/internal/handler/issue.go
@@ -23,7 +23,7 @@ import (
"github.com/multica-ai/multica/server/internal/middleware"
"github.com/multica-ai/multica/server/internal/service"
"github.com/multica-ai/multica/server/internal/util"
- "github.com/multica-ai/multica/server/pkg/agent"
+ agentpkg "github.com/multica-ai/multica/server/pkg/agent"
db "github.com/multica-ai/multica/server/pkg/db/generated"
"github.com/multica-ai/multica/server/pkg/protocol"
)
@@ -1898,6 +1898,8 @@ type QuickCreateIssueRequest struct {
AgentID string `json:"agent_id,omitempty"`
SquadID string `json:"squad_id,omitempty"`
Prompt string `json:"prompt"`
+ Priority string `json:"priority,omitempty"`
+ DueDate string `json:"due_date,omitempty"`
ProjectID string `json:"project_id,omitempty"`
ParentIssueID string `json:"parent_issue_id,omitempty"`
AttachmentIDs []string `json:"attachment_ids,omitempty"`
@@ -1920,6 +1922,20 @@ func (h *Handler) QuickCreateIssue(w http.ResponseWriter, r *http.Request) {
writeError(w, http.StatusBadRequest, "prompt is required")
return
}
+ priority := strings.ToLower(strings.TrimSpace(req.Priority))
+ if priority != "" && priority != "urgent" && priority != "high" && priority != "medium" && priority != "low" {
+ writeError(w, http.StatusBadRequest, "priority must be one of: urgent, high, medium, low")
+ return
+ }
+ dueDate := strings.TrimSpace(req.DueDate)
+ if dueDate != "" {
+ parsed, err := util.ParseCalendarDate(dueDate)
+ if err != nil {
+ writeError(w, http.StatusBadRequest, "invalid due_date format, expected YYYY-MM-DD")
+ return
+ }
+ dueDate = parsed.Time.Format("2006-01-02")
+ }
hasAgent := strings.TrimSpace(req.AgentID) != ""
hasSquad := strings.TrimSpace(req.SquadID) != ""
@@ -2027,6 +2043,14 @@ func (h *Handler) QuickCreateIssue(w http.ResponseWriter, r *http.Request) {
writeJSON(w, status, payload)
return
}
+ if priority != "" || dueDate != "" {
+ if status, payload := h.checkQuickCreateDaemonVersionAtLeast(
+ r.Context(), agent.RuntimeID, agentpkg.MinQuickCreateFieldsCLIVersion,
+ ); status != 0 {
+ writeJSON(w, status, payload)
+ return
+ }
+ }
attachmentIDs, ok := parseUUIDSliceOrBadRequest(w, req.AttachmentIDs, "attachment_ids")
if !ok {
@@ -2074,7 +2098,7 @@ func (h *Handler) QuickCreateIssue(w http.ResponseWriter, r *http.Request) {
parentIssueUUID = pid
}
- task, err := h.TaskService.EnqueueQuickCreateTask(r.Context(), wsUUID, requesterUUID, agentUUID, squadUUID, prompt, projectUUID, parentIssueUUID, attachmentIDs)
+ task, err := h.TaskService.EnqueueQuickCreateTask(r.Context(), wsUUID, requesterUUID, agentUUID, squadUUID, prompt, priority, dueDate, projectUUID, parentIssueUUID, attachmentIDs)
if err != nil {
slog.Warn("quick-create enqueue failed", append(logger.RequestAttrs(r), "error", err)...)
writeError(w, http.StatusInternalServerError, "failed to enqueue quick-create task")
@@ -2122,6 +2146,10 @@ func (h *Handler) isRuntimeOnline(ctx context.Context, runtimeID pgtype.UUID) bo
// "runtime_id": "<uuid>"
// }
func (h *Handler) checkQuickCreateDaemonVersion(ctx context.Context, runtimeID pgtype.UUID) (int, map[string]any) {
+ return h.checkQuickCreateDaemonVersionAtLeast(ctx, runtimeID, agentpkg.MinQuickCreateCLIVersion)
+}
+
+func (h *Handler) checkQuickCreateDaemonVersionAtLeast(ctx context.Context, runtimeID pgtype.UUID, minimum string) (int, map[string]any) {
rt, err := h.Queries.GetAgentRuntime(ctx, runtimeID)
if err != nil {
// Runtime row vanished between the online check and here — treat
@@ -2132,14 +2160,14 @@ func (h *Handler) checkQuickCreateDaemonVersion(ctx context.Context, runtimeID p
}
}
current := readRuntimeCLIVersion(rt.Metadata)
- switch err := agent.CheckMinCLIVersion(current); {
+ switch err := agentpkg.CheckMinCLIVersionFor(current, minimum); {
case err == nil:
return 0, nil
- case errors.Is(err, agent.ErrCLIVersionMissing), errors.Is(err, agent.ErrCLIVersionTooOld):
+ case errors.Is(err, agentpkg.ErrCLIVersionMissing), errors.Is(err, agentpkg.ErrCLIVersionTooOld):
return http.StatusUnprocessableEntity, map[string]any{
"code": "daemon_version_unsupported",
"current_version": current,
- "min_version": agent.MinQuickCreateCLIVersion,
+ "min_version": minimum,
"runtime_id": uuidToString(runtimeID),
}
default:
@@ -2149,7 +2177,7 @@ func (h *Handler) checkQuickCreateDaemonVersion(ctx context.Context, runtimeID p
return http.StatusUnprocessableEntity, map[string]any{
"code": "daemon_version_unsupported",
"current_version": current,
- "min_version": agent.MinQuickCreateCLIVersion,
+ "min_version": minimum,
"runtime_id": uuidToString(runtimeID),
}
}
diff --git a/server/internal/handler/quick_create_parent_test.go b/server/internal/handler/quick_create_parent_test.go
index d9f6999b02..8b580e88f1 100644
--- a/server/internal/handler/quick_create_parent_test.go
+++ b/server/internal/handler/quick_create_parent_test.go
@@ -56,7 +56,7 @@ func TestQuickCreateIssueParentTrustBoundary(t *testing.T) {
}
if _, err := testPool.Exec(ctx,
`UPDATE agent_runtime SET metadata = jsonb_build_object('cli_version', $1::text) WHERE id = $2`,
- agent.MinQuickCreateCLIVersion, runtimeID,
+ agent.MinQuickCreateFieldsCLIVersion, runtimeID,
); err != nil {
t.Fatalf("bump runtime cli_version: %v", err)
}
@@ -134,6 +134,8 @@ func TestQuickCreateIssueParentTrustBoundary(t *testing.T) {
req := newRequest("POST", "/api/issues/quick-create", map[string]any{
"agent_id": agentID,
"prompt": "Create a follow-up issue for the local parent",
+ "priority": " HIGH ",
+ "due_date": " 2026-08-01 ",
"parent_issue_id": localParentID,
"attachment_ids": []string{attachmentID},
})
@@ -168,6 +170,12 @@ func TestQuickCreateIssueParentTrustBoundary(t *testing.T) {
if qc.ParentIssueID != localParentID {
t.Fatalf("expected parent_issue_id=%q in context, got %q", localParentID, qc.ParentIssueID)
}
+ if qc.Priority != "high" {
+ t.Fatalf("expected priority=high in context, got %q", qc.Priority)
+ }
+ if qc.DueDate != "2026-08-01" {
+ t.Fatalf("expected due_date=2026-08-01 in context, got %q", qc.DueDate)
+ }
if len(qc.AttachmentIDs) != 1 || qc.AttachmentIDs[0] != attachmentID {
t.Fatalf("expected attachment_ids=[%q] in context, got %#v", attachmentID, qc.AttachmentIDs)
}
@@ -225,4 +233,76 @@ func TestQuickCreateIssueParentTrustBoundary(t *testing.T) {
t.Fatalf("bogus attachment id must not enqueue a task: expected %d quick-create tasks, got %d", before, got)
}
})
+
+ for _, tc := range []struct {
+ name string
+ field string
+ value string
+ }{
+ {name: "invalid priority", field: "priority", value: "none"},
+ {name: "invalid due date", field: "due_date", value: "tomorrow"},
+ } {
+ t.Run(tc.name, func(t *testing.T) {
+ before := countQuickCreateTasks(t)
+ body := map[string]any{
+ "agent_id": agentID,
+ "prompt": "Try an invalid explicit field",
+ tc.field: tc.value,
+ }
+ w := httptest.NewRecorder()
+ req := newRequest("POST", "/api/issues/quick-create", body)
+ testHandler.QuickCreateIssue(w, req)
+ if w.Code != http.StatusBadRequest {
+ t.Fatalf("expected 400, got %d: %s", w.Code, w.Body.String())
+ }
+ if got := countQuickCreateTasks(t); got != before {
+ t.Fatalf("invalid field must not enqueue a task: expected %d, got %d", before, got)
+ }
+ })
+ }
+
+ t.Run("legacy daemon only rejects requests using explicit fields", func(t *testing.T) {
+ if _, err := testPool.Exec(ctx,
+ `UPDATE agent_runtime SET metadata = jsonb_build_object('cli_version', '0.4.2') WHERE id = $1`,
+ runtimeID,
+ ); err != nil {
+ t.Fatalf("set legacy daemon version: %v", err)
+ }
+ defer testPool.Exec(ctx,
+ `UPDATE agent_runtime SET metadata = jsonb_build_object('cli_version', $1::text) WHERE id = $2`,
+ agent.MinQuickCreateFieldsCLIVersion, runtimeID,
+ )
+
+ before := countQuickCreateTasks(t)
+ w := httptest.NewRecorder()
+ req := newRequest("POST", "/api/issues/quick-create", map[string]any{
+ "agent_id": agentID,
+ "prompt": "Explicit priority needs the new daemon transport",
+ "priority": "high",
+ })
+ testHandler.QuickCreateIssue(w, req)
+ if w.Code != http.StatusUnprocessableEntity {
+ t.Fatalf("explicit fields on 0.4.2: expected 422, got %d: %s", w.Code, w.Body.String())
+ }
+ if got := countQuickCreateTasks(t); got != before {
+ t.Fatalf("unsupported explicit fields must not enqueue: expected %d, got %d", before, got)
+ }
+
+ w = httptest.NewRecorder()
+ req = newRequest("POST", "/api/issues/quick-create", map[string]any{
+ "agent_id": agentID,
+ "prompt": "Basic quick create remains backward compatible",
+ })
+ testHandler.QuickCreateIssue(w, req)
+ if w.Code != http.StatusAccepted {
+ t.Fatalf("basic quick create on 0.4.2: expected 202, got %d: %s", w.Code, w.Body.String())
+ }
+ var resp QuickCreateIssueResponse
+ if err := json.NewDecoder(w.Body).Decode(&resp); err != nil {
+ t.Fatalf("decode response: %v", err)
+ }
+ t.Cleanup(func() {
+ testPool.Exec(context.Background(), `DELETE FROM agent_task_queue WHERE id = $1`, resp.TaskID)
+ })
+ })
}
diff --git a/server/internal/integrations/slack/slash_command.go b/server/internal/integrations/slack/slash_command.go
index ac9c76695c..763b9070be 100644
--- a/server/internal/integrations/slack/slash_command.go
+++ b/server/internal/integrations/slack/slash_command.go
@@ -66,7 +66,7 @@ type slashQueries interface {
// command needs to hand the invoker's prompt to the agent. *service.TaskService
// satisfies it; tests supply a fake.
type quickCreateEnqueuer interface {
- EnqueueQuickCreateTask(ctx context.Context, workspaceID, requesterID, agentID, squadID pgtype.UUID, prompt string, projectID, parentIssueID pgtype.UUID, attachmentIDs []pgtype.UUID) (db.AgentTaskQueue, error)
+ EnqueueQuickCreateTask(ctx context.Context, workspaceID, requesterID, agentID, squadID pgtype.UUID, prompt, priority, dueDate string, projectID, parentIssueID pgtype.UUID, attachmentIDs []pgtype.UUID) (db.AgentTaskQueue, error)
}
// SlashCommandProcessor handles the Slack `/issue` slash command end to end.
@@ -191,6 +191,8 @@ func (p *SlashCommandProcessor) process(ctx context.Context, cmd slack.SlashComm
inst.AgentID,
pgtype.UUID{}, // no squad — dispatch straight to the installation agent
prompt,
+ "", // no explicit priority
+ "", // no explicit due date
pgtype.UUID{}, // no project
pgtype.UUID{}, // no parent issue
nil, // no attachments
diff --git a/server/internal/integrations/slack/slash_command_test.go b/server/internal/integrations/slack/slash_command_test.go
index 9e6e19ebee..cf98133883 100644
--- a/server/internal/integrations/slack/slash_command_test.go
+++ b/server/internal/integrations/slack/slash_command_test.go
@@ -52,7 +52,7 @@ type fakeQuickCreate struct {
prompt string
}
-func (f *fakeQuickCreate) EnqueueQuickCreateTask(_ context.Context, workspaceID, requesterID, agentID, squadID pgtype.UUID, prompt string, _, _ pgtype.UUID, _ []pgtype.UUID) (db.AgentTaskQueue, error) {
+func (f *fakeQuickCreate) EnqueueQuickCreateTask(_ context.Context, workspaceID, requesterID, agentID, squadID pgtype.UUID, prompt, _, _ string, _, _ pgtype.UUID, _ []pgtype.UUID) (db.AgentTaskQueue, error) {
f.calls++
f.workspaceID = workspaceID
f.requesterID = requesterID
diff --git a/server/internal/service/task.go b/server/internal/service/task.go
index 46f110d190..4aa357c66c 100644
--- a/server/internal/service/task.go
+++ b/server/internal/service/task.go
@@ -1250,6 +1250,8 @@ type QuickCreateContext struct {
Prompt string `json:"prompt"`
RequesterID string `json:"requester_id"`
WorkspaceID string `json:"workspace_id"`
+ Priority string `json:"priority,omitempty"`
+ DueDate string `json:"due_date,omitempty"`
ProjectID string `json:"project_id,omitempty"`
SquadID string `json:"squad_id,omitempty"`
AttachmentIDs []string `json:"attachment_ids,omitempty"`
@@ -1284,7 +1286,7 @@ const QuickCreateContextType = "quick_create"
// parentIssueID is optional (zero-valued pgtype.UUID when the user didn't
// open the modal from "Add sub issue"). The handler is responsible for
// validating it belongs to the same workspace before passing it in.
-func (s *TaskService) EnqueueQuickCreateTask(ctx context.Context, workspaceID, requesterID pgtype.UUID, agentID, squadID pgtype.UUID, prompt string, projectID, parentIssueID pgtype.UUID, attachmentIDs []pgtype.UUID) (db.AgentTaskQueue, error) {
+func (s *TaskService) EnqueueQuickCreateTask(ctx context.Context, workspaceID, requesterID pgtype.UUID, agentID, squadID pgtype.UUID, prompt, priority, dueDate string, projectID, parentIssueID pgtype.UUID, attachmentIDs []pgtype.UUID) (db.AgentTaskQueue, error) {
agent, err := s.Queries.GetAgent(ctx, agentID)
if err != nil {
return db.AgentTaskQueue{}, fmt.Errorf("load agent: %w", err)
@@ -1301,6 +1303,8 @@ func (s *TaskService) EnqueueQuickCreateTask(ctx context.Context, workspaceID, r
Prompt: prompt,
RequesterID: util.UUIDToString(requesterID),
WorkspaceID: util.UUIDToString(workspaceID),
+ Priority: priority,
+ DueDate: dueDate,
}
if projectID.Valid {
payload.ProjectID = util.UUIDToString(projectID)
diff --git a/server/pkg/agent/version.go b/server/pkg/agent/version.go
index aa3eeb221b..2a8bd9c1fe 100644
--- a/server/pkg/agent/version.go
+++ b/server/pkg/agent/version.go
@@ -27,6 +27,12 @@ var MinVersions = map[string]string{
// this threshold all fail closed.
const MinQuickCreateCLIVersion = "0.2.21"
+// MinQuickCreateFieldsCLIVersion is the first daemon release that carries
+// explicit quick-create priority and due-date fields from the claim response
+// into the generated issue-create prompt. Basic quick-create remains on the
+// older floor above; only requests using these optional fields need this gate.
+const MinQuickCreateFieldsCLIVersion = "0.4.3"
+
// MinHandoffCLIVersion is the lowest multica CLI version whose daemon renders
// the assignment handoff note into the run's opening prompt + issue_context.md
// (MUL-3375). Unlike quick-create this is a SOFT gate: assigning an issue with
@@ -83,6 +89,13 @@ var devDescribeRe = regexp.MustCompile(`^v?\d+\.\d+\.\d+-\d+-g[0-9a-fA-F]+`)
// itself is the shared signal, so the modal pre-check and this server gate
// agree by construction without needing to compare separate env flags.
func CheckMinCLIVersion(detected string) error {
+ return CheckMinCLIVersionFor(detected, MinQuickCreateCLIVersion)
+}
+
+// CheckMinCLIVersionFor applies the quick-create version policy against a
+// caller-provided capability floor. It preserves the dev-build exemption so
+// feature-specific server and frontend gates agree with the base gate.
+func CheckMinCLIVersionFor(detected, minimum string) error {
d := strings.TrimSpace(detected)
if d == "" {
return ErrCLIVersionMissing
@@ -94,7 +107,7 @@ func CheckMinCLIVersion(detected string) error {
if err != nil {
return ErrCLIVersionMissing
}
- min, err := parseSemver(MinQuickCreateCLIVersion)
+ min, err := parseSemver(minimum)
if err != nil {
// Misconfiguration in the constant itself — fail closed as missing.
return ErrCLIVersionMissing
diff --git a/server/pkg/agent/version_test.go b/server/pkg/agent/version_test.go
index c78b908b48..cfc4ae406c 100644
--- a/server/pkg/agent/version_test.go
+++ b/server/pkg/agent/version_test.go
@@ -79,6 +79,18 @@ func TestCheckMinCLIVersion(t *testing.T) {
}
}
+func TestCheckMinCLIVersionForQuickCreateFields(t *testing.T) {
+ if err := CheckMinCLIVersionFor("0.4.2", MinQuickCreateFieldsCLIVersion); !errors.Is(err, ErrCLIVersionTooOld) {
+ t.Fatalf("0.4.2 error = %v, want ErrCLIVersionTooOld", err)
+ }
+ if err := CheckMinCLIVersionFor("0.4.3", MinQuickCreateFieldsCLIVersion); err != nil {
+ t.Fatalf("0.4.3 error = %v, want nil", err)
+ }
+ if err := CheckMinCLIVersionFor("v0.4.2-7-gabc1234", MinQuickCreateFieldsCLIVersion); err != nil {
+ t.Fatalf("dev build error = %v, want nil", err)
+ }
+}
+
func TestExtractVersionLine(t *testing.T) {
tests := []struct {
name string