Skip to content

KAP-990: suppress comment author self-triggers - #5642

Open
milymarkovic wants to merge 2 commits into
multica-ai:mainfrom
milymarkovic:fix/kap-990-comment-self-trigger
Open

KAP-990: suppress comment author self-triggers#5642
milymarkovic wants to merge 2 commits into
multica-ai:mainfrom
milymarkovic:fix/kap-990-comment-self-trigger

Conversation

@milymarkovic

Copy link
Copy Markdown
Contributor

Summary

  • suppress implicit squad-assignee wake when comment author is assigned squad leader
  • make explicit @agent / @squad self-mentions loop-safe no-ops with honest outcomes
  • preserve wake-up for comments from other agents and explicit delegation to different owners

Verification

  • DATABASE_URL=.../kap990_test go test ./internal/handler -count=1
  • go vet ./...
  • independent pre-commit review: no blocking logic or security findings

Migration impact

None.

Closes KAP-990

@vercel

vercel Bot commented Jul 19, 2026

Copy link
Copy Markdown

@milymarkovic is attempting to deploy a commit to the IndexLabs Team on Vercel.

A member of the Team first needs to authorize it.

@multica-eve multica-eve left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on the loop-safety problem. We can't merge this as proposed because it removes supported workflows where an assistant working on a child item explicitly wakes itself on the parent item, and where a squad leader who also completes a worker slice needs its result to resume coordination. Treating every same-identity mention or comment as a no-op changes those workflows without a replacement handoff mechanism. We need a narrower design that prevents accidental loops while retaining intentional cross-item handoffs, so we're not taking this PR forward in its current form.

@milymarkovic

Copy link
Copy Markdown
Contributor Author

Addressed review with narrow, source-task-bound suppression in 2361968ec.

  • Preserved explicit cross-item self-handoff when trusted X-Task-ID belongs to another issue.
  • Preserved same-squad worker-slice → leader coordination resume when the exact authoring task is a worker task for that squad.
  • Suppressed same-issue leader-run self-loops and same-issue explicit agent self-mentions.
  • Removed dependence on “latest task role”; unrelated historical tasks can no longer change routing.
  • Added/updated regressions for both intentional workflows and accidental-loop cases.

Verification: full go test ./internal/handler -count=1 PASS, go vet ./... PASS, GitHub CI all PASS. No migrations. Ready for re-review.

@milymarkovic

Copy link
Copy Markdown
Contributor Author

@multica-eve re-review requested: the corrective DoD from your 2026-07-19 09:06Z review has been addressed on new head 2361968ec (pushed 09:44Z).

Summary of the redesign: blanket same-identity suppression replaced with narrow same-issue/same-context criteria; intentional cross-item self-handoff and squad-leader worker→coordination resume are preserved and covered by regression tests, accidental same-issue self-loops remain suppressed. CI green, MERGEABLE.

@milymarkovic

Copy link
Copy Markdown
Contributor Author

Independent QA completed on exact head 2361968ec2042105ebbbd63f3f89a8adf213ee0c: PASS_WITH_NOTES.

Verified on isolated PostgreSQL test DB:

  • same-issue self-trigger: 0 queued follow-up;
  • same-issue explicit self-mention: suppressed/deferred, no duplicate;
  • trusted cross-item self-handoff: exactly 1 expected run;
  • same-squad worker→leader resume: exactly 1 coordination run;
  • other-author routing and handoff to another owner: no regression;
  • full go test ./internal/handler -count=1: PASS.

CI remains 5/5 PASS and PR merge state is clean. Requesting fresh upstream review of this exact SHA; no merge/release/deploy performed.

wujunyi792 referenced this pull request in hduhelp/multica Jul 21, 2026
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NYStwEXJFCJLokYqKVUBUg
wujunyi792 referenced this pull request in hduhelp/multica Jul 21, 2026
…) (#5625)

Reconciled issue.go batch-update: kept ours' ordered two-loop structure and
grafted theirs' childAttentionNeeded tracking + batch-level actor; dropped
theirs' now-duplicate updated++. Fixed daemon_terminal_reconcile_test.go
call site for the triggerTasksForComment signature grown by #5642.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NYStwEXJFCJLokYqKVUBUg
@apollion69

Copy link
Copy Markdown
Contributor

Related data point from a self-hosted v0.4.10 deployment — the wake surface seems wider
than comment self-triggers:

  • A plain top-level comment by a workspace member (no @-mention of any agent or squad)
    on a squad-assigned issue enqueued a new squad-leader task the same second the comment
    was created.
  • Cancelling that task (issue cancel-task) was itself followed ~4 minutes later by
    another leader task being enqueued for the same issue, with no new comment or human
    action in between — i.e. lifecycle events also appear to re-wake the assignee.

With --max-concurrent-tasks 1 on the runtime this becomes a starvation loop: each
informational comment or cancel re-queues the leader, and scheduled/autopilot tasks wait
behind it. We had to unassign the squad from the issue to stop the cycle.

Suggestion: treat member comments without a mention, and task lifecycle events
(cancel/complete), as non-waking by default — or make the wake policy configurable per
issue/squad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants