Skip to content

fix(Alden): block unconfirmed MLX replies before speech and durable history - #31

Draft
twoimo wants to merge 11 commits into
codex/alden-activity-order-20261011from
codex/alden-voice-completion-fence-20261011
Draft

twoimo wants to merge 11 commits into
codex/alden-activity-order-20261011from
codex/alden-voice-completion-fence-20261011

Conversation

@twoimo

@twoimo twoimo commented Oct 10, 2026

Copy link
Copy Markdown
Owner

Fixes a production-path gap in the local MLX voice runtime: previously a transport-complete, partial assistant text could reach TTS and persisted assistant history even if the generation had no verified finish reason, was content-filtered/tool-directed, carried an explicit failure, or appended another response after a "stop" marker.

Implementation, stacked strictly on draft #30:

  • Require one unambiguous local response with finish_reason="stop" before a reply can be returned to AldenVoicePipeline. Preserve explicit length-truncation handling; refuse missing/unknown, content_filter, tool_calls, function_call, failed/incomplete/cancelled states and explicit error payloads.
  • For SSE, verify ordered termination before accepting [DONE]; reject injected post-stop content/duplicate terminal frames and tool-call fragments. Permit a subsequent usage-only frame (choices=[]) without creating an extra answer.
  • Fail closed on duplicate JSON keys, nonfinite NaN/Infinity and exponent overflow from the loopback provider; reject invalid assistant roles or multiple selected choices.
  • Continue using the existing fixed local MLX model readiness check, per-turn request/context/source identity, abort guard and aggregate metrics; do not modify model choices, Gemini routes, voices, OSK, queue, or any production settings.
  • Run the real AldenVoicePipeline.process_text, LocalMlxLlm, AbortToken, and local SQLite voice_messages with only the provider socket and audio hardware faked. Confirm rejected model text is never spoken or persisted, the confirmed user input remains, duplicate event IDs cannot replay, and the next valid turn retains its ID/context attribution.

Verified: macOS Actions #38072362981, exact CI source b83ac5c34481ac827fa75a5862245658bb393e38: 175 tests, 169 passed, 6 skipped because this focused runner lacks NumPy. The implementation/test Git blob SHAs match this CI branch exactly. Earlier CI failures 38072109129 and 38072289600 exposed fixture assumptions that missing completion was accepted as success; fixtures were made explicit rather than relaxing the new production completion rule.

Technical contract, dated evidence and required Mac recovery steps.

Explicit limitations: No valid Core native turn_token or desktop Mac Computer Use channel has been provided to this turn. Therefore the user's designated Mac clone, goal-objective.md, outputs/STATUS.md, installed app and live model/STT/TTS sessions could not be accessed or changed. Remote synthetic macOS CI is not a physical device test, product model swap, notarized release or production deployment. PR #27-#30 remain open draft and unmerged.

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.

1 participant