Skip to content

feat(orchestrator): record surface-tool replies as 'delivered', not 'silent' - #623

Open
yzxcj797 wants to merge 2 commits into
yc-software:mainfrom
yzxcj797:fix/turn-outcome-status-609
Open

feat(orchestrator): record surface-tool replies as 'delivered', not 'silent'#623
yzxcj797 wants to merge 2 commits into
yc-software:mainfrom
yzxcj797:fix/turn-outcome-status-609

Conversation

@yzxcj797

@yzxcj797 yzxcj797 commented Aug 20, 2026

Copy link
Copy Markdown

Fixes #609 — suggestions (1) and (3) from the issue, which the reporter identified as "small and would do most of the work".

What changes

TurnResult gains "delivered". The surface-tool branch — the ordinary shape of a Slack answer, where the reply goes out through the post tool rather than the TurnResult reply field — previously recorded status: "silent", the same value the ambient gate writes when it declines to answer. A delivered answer and a suppressed turn were indistinguishable in runs.result; the reporter's harness scored a correct in-thread reply as a failure three times running because of it. Now:

producer status
ambient gate declined silent (unchanged — means exactly this)
poll fire, model said nothing silent (unchanged)
surface-tool delivery delivered (was silent)
ordinary reply ok (unchanged)

The metrics sink stops hardcoding "ok". turn_metrics.status now mirrors the finalResult branches (same primitives, same order — including collect-mode's ok-with-approvals, pinned by the existing test): delivered turns land as delivered, silent polls as silent, approval pauses as paused/pending_approval. Previously ALL of them landed as "ok" (the reporter's 1,200-turn dump: capture 600 | ok 600, nothing else).

Consumers taught the new value (audited: every status === "silent" / !== "ok" site):

  • Slack turn handler: delivered settles the ack and stands down — the reply already posted, delivering again would double-post (exactly the pre-split silent behavior).
  • Trigger runner: delivered counts as a success in failure classification, and stands down on forwarding (the surface tool already posted at the destination).

Suggestions (2) and (4) — metrics rows for gate-declined early returns, persisting the detection call's model request — are larger changes to the early-return path and are deliberately not included.

Tests

  • a surface-tool turn records status 'delivered', not 'silent'fails on main (silent).
  • the metrics sink carries the turn's outcome instead of hardcoding 'ok' — the turn_metrics row for a surface-tool turn reads delivered. Fails on main (ok).
  • a gate-declined ambient turn still records 'silent' — pins that the split doesn't blur suppression.

Full orchestrator.test.ts: 69 passed / 60 pre-existing environment failures, identical set on clean main (where the two new tests fail); trigger suites 39/39; tsc --noEmit clean.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

yzxcj797 and others added 2 commits August 20, 2026 15:50
…silent'

"silent" meant two opposite things in runs.result: the ambient gate
declining to answer (suppression), and a turn whose reply went out
through a surface tool — which is how every ordinary Slack answer is
delivered. A delivered answer and a suppressed turn were
indistinguishable in the durable record, so any operator, dashboard, or
alert scoring turns was wrong by default (yc-software#609).

- TurnResult gains "delivered": the surface-tool branch (the ordinary
  Slack-answer shape) records it; gate suppression and poll-silence
  keep "silent", each now meaning exactly one thing.
- The metrics sink mirrors the finalResult branches (same primitives,
  same order, including collect-mode's ok-with-approvals) instead of
  hardcoding "ok" — delivered answers, silent polls, and approval
  pauses now land in turn_metrics as what they are.
- Consumers taught the new value: the Slack turn handler settles the
  ack and stands down (the reply already posted — delivering it again
  would double-post, exactly the pre-split silent behavior), and the
  trigger runner treats "delivered" as a success shape both for
  failure classification and for destination forwarding (the surface
  tool already posted at the destination).

Suggestions (2) and (4) from the issue — metrics rows for gate-declined
early returns and persisting the detection call's model request — are
larger changes to the early-return path and are not included.

Fixes yc-software#609
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.

A turn's outcome isn't recorded faithfully: silent means two opposite things, and suppressed turns are absent from turn_metrics

1 participant