mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-27 21:33:41 +02:00
Addresses GPT-Boy's second-pass review on #1786: 1. The runtime_config.go Output section forced "Final results MUST be delivered via multica issue comment add" for every non-autopilot task — quick-create still got this conflicting instruction even though there's no issue to comment on. Switched the Output block to a three-way switch so quick-create gets a tailored "stdout is captured automatically; do NOT call comment add" branch matching the autopilot variant. 2. Completion lookup was "most recent issue created by this agent since task.started_at", which races against concurrent issue creates by the same agent (assignment task running alongside quick-create when max_concurrent_tasks > 1). Replaced with a deterministic origin link: - Migration 060 extends issue.origin_type CHECK to allow 'quick_create'. - Daemon sets MULTICA_QUICK_CREATE_TASK_ID env var when running a quick-create task. - multica issue create CLI reads the env var and stamps the new issue with origin_type=quick_create + origin_id=<task_id>. - Server CreateIssue handler accepts (origin_type, origin_id) from trusted callers (only "quick_create" is allowed; the pair is rejected unless both fields are provided together). - notifyQuickCreateCompleted now calls GetIssueByOrigin keyed on (workspace_id, "quick_create", task.ID) — no more time-window racing against parallel agent activity. The old GetRecentIssueByCreatorSince query is removed.
10 lines
640 B
SQL
10 lines
640 B
SQL
-- Extend issue.origin_type to allow the quick-create flow to stamp issues with
|
|
-- origin_type='quick_create' + origin_id=<agent_task_queue.id>. The completion
|
|
-- handler uses this for a deterministic lookup of "the issue this quick-create
|
|
-- task produced" instead of "the agent's most recent issue", which races against
|
|
-- concurrent issue creates by the same agent (e.g. assignment task running
|
|
-- alongside quick-create when max_concurrent_tasks > 1).
|
|
ALTER TABLE issue DROP CONSTRAINT IF EXISTS issue_origin_type_check;
|
|
ALTER TABLE issue ADD CONSTRAINT issue_origin_type_check
|
|
CHECK (origin_type IN ('autopilot', 'quick_create'));
|