Skip to content

bug: an identical delegation from a later turn replays the first run, so report-back goes to the first turn's conversation #3296

Closed

Description

@AndriiPasternak31

Summary

An identical delegation made from a later turn within 24 h is answered with the first run's receipt, and the delegated work reports back into the first turn's conversation, not the one now asking.

chat_with_agent derives its Idempotency-Key from caller, target, route, model, mode and message (deriveMcpIdempotencyKey in src/mcp-server/src/tools/chat.ts); the caller's turn is deliberately not part of it (Invariant #18: the key must not change when only report-back changes). The backend replays a matching key before it creates the child row (begin_task_idempotency in src/backend/services/dispatch_admission_service.py, reached from the /task admission path before create_task_execution_and_activities), so the second turn's request never runs and never inherits the second turn's conversation. With #3232's default report-back on async delegations, the replayed receipt also carries report_back: "requested", although the run it names was asked to report to the earlier turn (and may already have).

Example: an agent serving a Slack thread delegates "summarise yesterday's incidents" with parallel=true, async=true; two hours later, serving a different thread, it sends the same text. The second thread gets a receipt that says report-back was requested, and never gets a note: the only run is the first one, which reports into the first thread.

Acceptance Criteria

Technical Notes

Activity

  1. added
    priority-p2
    type-bug
    theme-reliability
    status-ready
    on Oct 6, 2026
  2. added
    complexity-medium
    on Oct 8, 2026
  3. removed
    status-ready
    on Oct 23, 2026
  4. dolho commented on Oct 23, 2026

    @dolho
    Contributor

    /claim

  5. added
    status-in-progress
    on Oct 23, 2026
  6. github-actions commented on Oct 23, 2026

    @github-actions

    Claimed by @dolho. Label status-in-progress added.

    Next steps:

    1. Create branch: feature/3296-<short-slug>
    2. Implement the feature
    3. Open a PR with Fixes #3296
  7. added
    status-in-dev
    and removed
    status-in-progress
    on Oct 26, 2026
  8. removed
    status-in-dev
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

complexity-mediumpriority-p2theme-reliabilitytype-bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions