Skip to content

feat(orchestration): let the Linear channel say that the tracker could not be reached #1089

Backlog

Description

@krokoko

Problem

Step 1b of reconcileTerminalChild (cdk/src/handlers/orchestration-reconciler.ts) moves a failed child's issue back and replaces its reaction. Since #1084 a try that did not land inside the settle window leaves a mark on the child's row (unsettled_task_id), and the next write on the task record tries once more.

The step can only read two booleans, and they say less than it needs:

  • revertState answers false when the request failed and when there was nothing to move (revertIssueToNotStarted, cdk/src/handlers/shared/linear-feedback.ts). A state call that failed alone is therefore not owed.
  • replaceIssueReaction answers false when the tracker could not be reached and when a marker stayed that it could not remove (swapReaction, same file). After the window the step cannot tell an outage from a marker that will never go, so the late try is the last one, and an outage that outlasts it loses the settle.
  • swapReaction takes a failed read of the reactions for an item without reactions: it adds the wanted marker and answers true, with the agent's marker left beside the new one.
  • The markers are matched by emoji alone, so the swap also tries to delete a person's own reaction with a marker emoji. The Channel contract says "A human's reactions are never touched" (cdk/src/handlers/shared/orchestration-channel.ts). If Linear refuses that delete (not verified on a live workspace), the swap answers false on every try for such an issue: it is marked, and the late try moves the issue back once if a person has taken it over.

All four were reproduced in the review round of #1084 with the real handler and the real adapter against a stand-in tracker. For the fourth the stand-in refuses the delete; what Linear itself answers is not known.

Proposal

  1. Let revertState and replaceIssueReaction report that the tracker could not be reached or the token could not be resolved, apart from "nothing to move" and "a marker stays". Whether as a third answer or as a throw is to decide: every other caller ignores the answer. revertState has no other caller. replaceIssueReaction has one, upsertEpicPanel (orchestration-rollup.ts), which calls it inside a try that logs a warning. The comment swap shares swapReaction with it, and seven of its nine calls have no try of their own (linear-webhook-processor.ts, fanout-task-events.ts, replyToIterationComment in the reconciler), so a throw out of swapReaction itself would turn a best-effort marker into a handler error there. The Slack adapter implements replaceIssueReaction as well and answers a plain boolean. The reconciler does not reach it today (its registry tables name Linear and Jira only). The Channel contract has to say what a plain false means for an adapter that cannot tell.
  2. In step 1b: mark the settle as owed when either call could not reach the tracker, keep the mark after a late try that could not reach it, and do not mark for a marker that stays.
  3. In swapReaction: answer false, or the new answer, when the read of the reactions failed.
  4. Delete only the application's own markers: read the reaction's user with the reactions and compare it with the token's own user, as agent/src/linear_reactions.py does. Check on a live workspace first whether Linear refuses the application's delete of a person's reaction.

Acceptance criteria

  • A state call that fails alone inside the window is retried by the next record of the task, also after the window.
  • A late try that could not reach the tracker keeps the mark; one that reached it removes the mark whatever it changed.
  • A person's own reaction with a marker emoji is neither deleted nor a reason for a mark.
  • A swap whose read of the reactions failed does not answer true: inside the window the settle is owed, and the next record removes the agent's marker.
  • No other caller of the reaction swap gets a throw or has to read the answer: upsertEpicPanel (orchestration-rollup.ts), replyToStandaloneTrigger (fanout-task-events.ts), the comment handlers of linear-webhook-processor.ts, and settleRetryComment and replyToIterationComment (orchestration-reconciler.ts). What they do at the tracker changes in one point: a person's reaction with a marker emoji is left alone.

Activity

  1. added
    enhancement
    orchestration
    on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementorchestration

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions