Skip to content

docs: propose multi-turn AMD on an effects-based reply gate - #8766

Draft
chenghao-mou wants to merge 5 commits into
v2.0from
chenghao/feat/amd-turn-hooks-design
Draft

chenghao-mou wants to merge 5 commits into
v2.0from
chenghao/feat/amd-turn-hooks-design

Conversation

@chenghao-mou

@chenghao-mou chenghao-mou commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Proposes how to port multi-turn AMD (#6202) into the v2.0 voice core. AMD observes session effects and answers each turn's reply decision with run- and turn-keyed inputs. The session holds at commit, drops stale answers, supersedes turns itself, and keeps live facts local: speech, silence timing, and opening eligibility. The protocol then holds under any interleaving the DST explores. This builds on a63b7c1, which removed the one-shot sidecar.

The proposal also states the machine rules that live in Python's detector.py, not only in _fsm.py: voicemail, idle, counters, classifier history, and the completed category. A "Ported unchanged" table lists the spec rules that carry over as written, with an owner for each.

The proposal differs from Python in these places:

  • A direct human answer keeps its preemptive generation. A reply with stage instructions or DTMF still generates again.
  • The session times the silence hold and removes the gate at Detach without waiting for a customer hook.
  • If AMD completes after the session commits a newer turn, the newer turn gets the final decision.

Review focus: the "proposed" rows in Decisions, and the open questions.

Initial prompt and agent context

Model: Claude Opus 5.5. Claude Fable 5.2 and GPT-6.2 Astra reviewed the hook-trait version, the gate design, and the latest revision. Two audits compared the proposal with spec/amd.md, tests/test_amd.py, and detector.py on main.

"I think the trickiest thing to do for the AMD v2.0 port, is going to be how should we think about AMD inside our DST"

we have a 2.0 branch, take a look and figure out the issue.

sketch the core sub-machine design with the TurnHooks seam

let's create a draft PR. Ask both model:claudeAgent_claude_personal/claude-fable-5-2 and model:codex/gpt-6.2-astra to review it before commit

TurnHooks is quite tricky since we use state machines everywhere now. It feels like an anti-pattern. Ideally AMD can just react to the Effects?

update the PR with the effects-based gate design

ask fable and astra to review the gate design

yes, but if we missed had_machine_stage, what else did we miss.

let's do the two-model review again

keep Fable's choice, push and update the PR

🤖 Generated with Claude Code

Port Python's multi-turn answering-machine detection into the voice
core as a pure machine stepped inside the session's transitions,
behind a per-turn hook seam, so the DST checks its reply decisions
under every ordering it explores.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chenghao-mou chenghao-mou added the review_effort:high Needs broad context and substantial validation label Nov 24, 2026
A trait called inside session transitions does not fit the state-machine
architecture. AMD now observes session effects and answers each turn's
reply gate with turn-keyed inputs. The session holds at commit, drops
answers for stale turns and supersedes turns itself, so the protocol is
safe under any delivery order the DST explores.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chenghao-mou chenghao-mou changed the title docs: propose multi-turn AMD on a TurnHooks seam docs: propose multi-turn AMD on an effects-based reply gate Nov 24, 2026
chenghao-mou and others added 3 commits November 24, 2026 22:50
Reviews found three orders the turn key does not cover: speech that
restarts before AMD's silence release lands, completion while a turn is
still in its customer hook, and an opening requested after the
participant spoke. The session now times the silence hold, checks the
opening against its own speech record, and applies a final decision to
every turn committed under the gate before it detaches. Decisions key to
the commit rather than the park, carry their profile version, and the
DST gains liveness and outcome rules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… hold

Replace the reply profile with a DTMF flag, keep the preemptive generation
when the reply's request is unchanged, and record when human_instructions
apply. Release a held reply on every completion, let Detach replace decisions
not yet applied, and list the spec rules the port keeps unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Detach removes the gate at once and respects a wait category. AMD counts a
held reply from the session's silence hold. Preemptive generations never get
the DTMF tool and are adopted only without stage instructions or DTMF. The
session applying Activated is the activation instant for both sides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

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

Labels

review_effort:high Needs broad context and substantial validation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant