gateway: answer spoken approvals, route off-gate results

New-skill authoring via the voice gateway never completed: STT emits
"Approve." / "Yes." / "retry." with sentence punctuation, but the
approval/repair maps were matched with an exact lookup, so a spoken
answer fell through to submit_request while the pending approval timed
out and nothing was registered.

- gateway/service: normalize the reply before the action lookup
  (`_normalize_action`: lowercase, strip edge punctuation, first-word
  fallback) and broaden the approval/repair vocabularies, so a spoken
  "Approve." / "Yes." / "retry." matches like a typed one.
- scheduler: buffer the replies of a background drain (the codegen
  worker's post-authoring re-run, a repair retry) in an outbox instead
  of returning them into a thread that discards them; a front end's
  `drain_outbox()` routes them, so the answer to the user's own request
  is no longer swallowed.
- cli/dashboard: drain the outbox alongside the queue.
- tests: normalization + spoken approval/repair routing, outbox
  routing, and the async requeue assertion.
This commit is contained in:
gabby committed 2026-10-12 08:14:42 +00:00
1 parent 3a5b90b1cb
commit b15a9e1b45
7 files changed
+269 -29

No files matched your search

+6 -2
View File
@@ -502,9 +502,13 @@ def _print_reply(reply, show_run_id: bool = False, verbosity: str = "result") ->
def _drain_queue(scheduler: Scheduler) -> None:
"""Run queued work, printing each outcome with its run id."""
"""Run queued work, printing each outcome with its run id.
Routes any replies a background drain buffered (a post-authoring re-run, a
repair retry) before the queued work, so an off-gate completion still prints.
"""
verbosity = getattr(scheduler, "verbosity", "result")
for reply in scheduler.run_queue():
for reply in [*scheduler.drain_outbox(), *scheduler.run_queue()]:
_print_reply(reply, show_run_id=True, verbosity=verbosity)