AlphaAvatar v0.6.8: Native Agent Runtime, Processor-Owned Plugins, and Streaming Voice

Hi everyone :waving_hand:

In my previous AlphaAvatar v0.6.6 post, I shared how the project was moving toward shared multimodal perception, event-driven Memory, unified inference runners, and more explicit runtime contracts.

Since then, v0.6.7 introduced AlphaAvatar-owned multimodal turn-taking and semantic addressing, reducing the dependence on transport-specific interaction policies.

With AlphaAvatar v0.6.8, the project reaches a larger architectural milestone.

AlphaAvatar now has its own native realtime Agent runtime, independent of the LiveKit Agents SDK.

This does not mean removing LiveKit. LiveKit remains the first supported realtime communication backend. What changes is that LiveKit no longer owns the Agent lifecycle, model execution, tool orchestration, or the application’s runtime architecture.

This release also introduces:

  • A native AvatarHost responsible for application and execution lifecycle management

  • Processor-owned Persona, Memory, and Router capabilities

  • A runtime capability system that goes beyond prompt descriptions

  • A native streaming model and tool execution pipeline

  • Streaming PCM speech with playback-synchronized transcripts

  • Unified workspace organization, diagnostics, and Python 3.13 tooling

For me, the most important part is not any individual feature.

It is that the Agent, its execution, its capabilities, and its realtime connection now have more explicit ownership boundaries.

Moving beyond an SDK-managed Agent lifecycle

Earlier versions of AlphaAvatar used LiveKit Agents for more than realtime communication.

The SDK also managed parts of application startup, worker execution, Agent sessions, and foreground model orchestration.

This was useful for building the initial system, but it gradually created architectural constraints.

For example:

  • Should a realtime connection determine whether an Agent execution exists?

  • Should model execution be tied to a particular RTC SDK?

  • Who should own shared inference runners used by multiple components?

  • How should an Agent eventually continue working after a user disconnects?

  • Can the same Agent runtime support a server, desktop application, mobile device, or another future environment?

These questions are difficult to answer cleanly when communication, execution, and application lifecycle are coupled.

In v0.6.8, AlphaAvatar introduces a standalone avatar-host package.

The architecture is now approximately:

          alphaavatar dev / start
                    |
                    v
                AvatarHost
                    |
       +------------+-------------+
       |            |             |
  Application    Execution      Session
   Services      Management    Management
       |            |             |
       |            |         RTC Backend
       |            |             |
       |            |           LiveKit
       |            |
       +------------+
                    |
                    v
               AvatarEngine
                    |
       +------------+-------------+
       |            |             |
     Core        Foundation     Plugins
  Perception     Services      & Tools
       |            |             |
       +------------+-------------+
                    |
                    v
          Native Model / Tool Loop
                    |
                    v
           Output / Voice Runtime
                    |
                    v
          RTC Media & Transcripts

The Host coordinates application initialization, managed executions, shared services, process supervision, and session attachments.

The Agent runtime remains responsible for perception, turn handling, model/tool orchestration, and output production.

The RTC integration is handled through a separate avatar-rtc package and Host session adapters.

Importantly, LiveKit remains the implemented RTC backend, but livekit.agents is no longer part of the active Agent execution path.

This is an architectural separation rather than a claim that all RTC transports are already supported.

A session is not the same thing as an Agent execution

One distinction I wanted to establish is that several concepts previously treated as closely related are actually different:

Application lifecycle
        |
        +-- Managed Agent execution
        |         |
        |         +-- Model / Tool Runs
        |         |
        |         +-- Runtime services
        |
        +-- Interactive sessions
                  |
                  +-- RTC connections
                  +-- Media transport

An interactive session represents access to an Agent through a particular connection.

A model Run represents a bounded model/tool execution.

A managed Agent execution represents a larger runtime lifecycle.

These should not be interchangeable identities.

For example, a user disconnecting from a browser does not necessarily imply that every shared runtime service should be destroyed.

Conversely, a completed model response does not imply that generated speech has finished playing.

v0.6.8 establishes these boundaries in the Host and runtime contracts.

However, I want to be precise about what is implemented.

Connection-independent, persistent Agent execution is not yet provided by this release. A configured execution may still end when its session terminates.

Durable Episodes, persistent Context recovery, execution resumption, and autonomous background operation remain future work.

The purpose of this release is to establish the ownership model needed to implement those features without restructuring the entire application again.

Persona and Memory now own their processors

Another substantial change is how plugins are structured.

Previously, some plugin functionality was still implemented directly in the Agent package, while parts of the plugin lifecycle and configuration were managed at a broader level.

In v0.6.8, Persona and Memory have been reorganized around independently managed processors.

For example:

Persona Plugin
    |
    +-- Profiler Processor
    +-- Speaker Processor
    +-- Face Processor

Memory Plugin
    |
    +-- Conversation Processor
    +-- Tool Processor
    +-- Environment Processor
    +-- Retrieval Processor

Each processor can own its configuration, providers, internal implementation, and lifecycle.

The Agent package retains reusable interfaces and runtime composition rather than embedding plugin-specific business logic.

Router has also moved further toward processor-owned organization for addressing and turn-taking.

This follows a principle I have been gradually adopting across AlphaAvatar:

A plugin should not merely register a feature. It should own the implementation and lifecycle of that feature.

This becomes increasingly important as plugins become more complex.

For example, Persona may have different models for speaker recognition, face recognition, and profile extraction.

Memory may have different processing policies for conversations, tool outcomes, environment observations, and retrieval.

Those capabilities should not need to share one large lifecycle or configuration implementation simply because they belong to the same plugin.

The workspace now organizes plugins into three groups:

  • Foundation: Context, Loop, Provider, Voice

  • Perception: Character, Memory, Persona, Router, Status

  • Tools: DeepResearch, MCP, RAG

These are organizational boundaries; they do not require changing public Python import paths to include the group names.

From capability descriptions to runtime capabilities

In v0.6.6, I introduced a way for plugins to describe their capabilities to the Avatar.

At that point, the primary goal was to let the model understand which features existed without hard-coding every possible plugin into the system prompt.

But there was an important limitation:

Describing a capability is not the same as making it executable.

A runtime needs to distinguish between:

  • A capability being registered

  • Its availability in the current runtime

  • Its visibility to the model

  • Whether a particular invocation is authorized

  • Whether it can actually execute

  • What happened after execution

v0.6.8 promotes capabilities into typed, runtime-registered definitions with callable bindings.

Conceptually:

Plugin / Processor
        |
        v
Capability Registration
        |
        v
Runtime Capability Registry
        |
        +-- Identity / Schema
        +-- Visibility / Scope
        +-- Authorization
        +-- Invocation
        |
        v
Native Model / Tool Loop
        |
        v
Validated Execution Result

This also allows the native Loop to invoke tools from MCP, RAG, DeepResearch, and other registered capabilities through a consistent execution boundary.

There is an additional detail I think is important for practical Agents.

Cancellation does not imply that an external action never happened.

If a tool call has already been dispatched, interrupting the Agent does not automatically make it safe to execute the same action again.

The native runtime preserves these distinctions instead of assuming that failed or interrupted executions are always retryable.

Native streaming model and tool execution

Removing the LiveKit Agents execution dependency also required AlphaAvatar to own its model and tool pipeline.

v0.6.8 introduces a native Loop that coordinates:

  1. Capturing the query’s runtime context

  2. Preparing structured model input

  3. Consuming streaming model responses

  4. Validating and authorizing tool calls

  5. Executing capabilities

  6. Returning tool results to the model

  7. Publishing canonical records and user-facing outputs

The Provider layer now separates shared model contracts from specific SDK implementations.

The release includes a native streaming implementation for the OpenAI Responses API, with structured input/output events, function calls, continuation handling, and explicit protocol validation.

Other provider integrations continue to exist, although not every task backend implements the same foreground streaming capabilities.

One useful outcome of this change is that the runtime can distinguish several states that are often conflated:

User input accepted
        |
        v
Committed Turn
        |
        v
Model / Tool Execution
        |
        v
Canonical Output Record
        |
        v
Output Processing
        |
        v
Audio / Text Delivery

For a realtime assistant, these distinctions matter.

A model completing its response does not mean the user has heard it.

A generated answer does not mean its audio synthesis succeeded.

An output being submitted to an RTC transport does not necessarily mean it reached the physical speaker.

Similarly, Memory processors should consume authoritative input and model/tool records rather than reconstructing conversation history from incidental transport events.

v0.6.8 makes more of those boundaries explicit through committed-turn events, canonical records, execution observations, and output delivery state.

Streaming voice and playback-synchronized transcripts

Realtime speech is another major focus of this release.

Previously, parts of the output path relied more heavily on sentence-complete synthesis and delivery.

v0.6.8 moves to a native streaming PCM pipeline.

The simplified flow is:

Streaming LLM output
         |
         v
Incremental Text Segmentation
         |
         v
Asynchronous TTS
         |
         v
Streaming PCM / Bounded Buffers
         |
         +------> RTC Audio Output
         |
         v
Playback Progress
         |
         v
Transcript Synchronization
         |
         v
RTC Text / Captions

Speech can begin before the entire model response or sentence sequence has been generated.

Text segmentation balances early speech startup against natural phrase boundaries.

The synthesis pipeline handles partial audio, bounded buffering, cancellation, and finite retry policies.

An additional improvement is playback-paced transcript synchronization.

Instead of releasing all generated text as soon as the LLM produces it, AlphaAvatar coordinates transcript delivery with local audio playout progress.

The intention is to make captions more closely follow the speech actually being delivered.

At the same time, caption delivery must not block PCM playback.

Slow transcript consumers or transport feedback should not become the pacing authority for audio frames.

The pipeline also includes configurable first-audio hedging for slow TTS starts. This can improve startup behavior in some conditions, but may issue additional synthesis requests and increase provider costs.

I do not consider these changes a universal latency guarantee.

Real provider response times, network behavior, RTC buffering, and device playback still need to be measured separately.

One further addition is support for model-generated commentary before appropriate tool operations.

For example, the assistant can briefly explain what it is about to investigate while a longer tool operation proceeds.

This is generated through the normal model/output pipeline rather than being a separate hidden reasoning request.

It is optional model behavior, not a mandatory spoken status message for every tool call.

Developer experience and diagnostics

There are also several infrastructure improvements.

The project now targets CPython 3.13, with a unified uv workspace, updated dependency lockfile, packaging checks, Ruff configuration, and CI validation.

The public CLI has also moved to the Host:

alphaavatar dev <config.yaml>
alphaavatar start <config.yaml>

Runtime diagnostics now include more structured information about Host execution, process ownership, model/tool activity, interruption, and output delivery.

The Host also supports structured JSONL logs and configurable developer-facing conversation previews.

I think observability is especially important for realtime Agents because a perceived delay can originate from very different places:

  • Perception or turn admission

  • Model response generation

  • Tool execution

  • TTS startup

  • Audio buffering

  • RTC transport

  • Client playback

Without separating these stages, it is easy to attribute a problem to the model when the actual cause is elsewhere.

For anyone trying v0.6.8, I currently recommend installing from the matching GitHub source tag and lockfile, rather than assuming every workspace package is available on PyPI.

The project contains 16 Python workspace packages, but the GitHub Release and PyPI publication processes are separate.

Why I think this architectural change matters

I have been thinking about AlphaAvatar less as an avatar application and more as a reusable runtime for persistent, multimodal personal Agents.

An avatar is one way to interact with that runtime.

A browser, desktop application, mobile device, or future device-native environment may be another.

Likewise, LiveKit is one way to connect realtime inputs and outputs.

But none of those should necessarily define how the Agent reasons, maintains Memory, invokes tools, or manages its execution.

My longer-term mental model is becoming:

           Applications / Devices
                     |
                     v
              Interaction Layer
                     |
                     v
                AvatarHost
                     |
                     v
               Agent Runtime
                     |
        +------------+------------+
        |            |            |
    Perception     Memory       Persona
        |            |            |
        +------------+------------+
                     |
               Context / Model
                     |
                Tool / Action
                     |
              Runtime Outcomes
                     |
                     v
              Output Delivery

The runtime should provide stable contracts for identity, state, capabilities, execution, and outputs.

The model should provide the reasoning and decision-making capabilities that connect those components.

This separation does not mean the runtime should attempt to reproduce intelligence already provided by the model.

Instead, I see its role as making model capabilities operationally useful: configurable, observable, replaceable, and eventually persistent across different execution environments.

What v0.6.8 does not solve yet

There are still several important limitations.

First, persistent Agent execution remains unfinished.

The new Host establishes separation between execution and interactive connection ownership, but it does not yet provide durable Episodes, automatic task recovery, or independent long-running background execution.

Second, LiveKit is currently the implemented RTC backend.

The architecture is designed to accommodate other backends, but support for arbitrary RTC implementations has not been demonstrated.

Third, the Character frontend is still under validation.

The current AIRI integration is optional, and its complete renderer/RTC behavior is not yet considered validated.

Fourth, broader reliability and performance testing is still needed.

CI checks cover packaging, installation, imports, and important lifecycle contracts, but these are not substitutes for long-duration, multi-participant, high-load, or cross-device testing.

Finally, developer onboarding still needs work, particularly around configuration, installation diagnostics, provider setup, and platform-specific dependencies.

These areas are part of the next development steps.

Questions I am currently thinking about

I would be interested in how others building realtime or persistent Agents approach these problems:

1. Where should the boundary between an interactive session and an Agent execution be?

Should an Agent always be able to continue after the connection disappears, or should background execution require an explicit separate lifecycle?

2. How do you represent completion in streaming Agent systems?

Model completion, tool completion, canonical output publication, audio synthesis, and actual playback can all occur at different times. Which of these should be first-class runtime contracts?

3. How should runtime capabilities be exposed to a model?

Now that capabilities can be registered and invoked through a runtime registry, should a model receive the complete active capability list, or only a small dynamically selected subset?

4. What is the best approach to streaming speech and transcript synchronization?

In particular, how do you handle partial TTS output, interruption, output backpressure, and the difference between server-side playout estimates and actual client playback?

I would be especially interested in real operational experiences, architectural criticism, and failure cases from people building voice Agents, multimodal assistants, or persistent Agent runtimes.

Links

Thanks again to everyone who commented on the earlier AlphaAvatar posts.

Some of those discussions, particularly around runtime boundaries, capability semantics, observation provenance, and persistent state, have been useful in shaping the direction of the project.

AlphaAvatar is still evolving quickly, and I would welcome feedback from anyone exploring similar architectural problems.

Hi. For now, I ran a few small experiments:


Four answers and a measured streaming boundary

I read the v0.6.8 announcement, compared its source with the earlier v0.6.6 discussion, and tested the speech-streaming path on CPU, including Colab runs. The architectural achievement here is explicit ownership, not a claim that durable execution, arbitrary RTC transports, or verified client playback already exist.

My answers to the four questions:

  1. Interactive session versus Agent execution: keep ordinary realtime conversation session-bound by default. Give explicitly requested background work a separate execution identity and lifetime when that feature is needed. Disconnect, reconnect to a live process, and restart recovery should remain three different promises. The new Host boundary helps without requiring durability immediately.
  2. What counts as completion: distinguish a model/tool Run settling, a canonical result being committed, speech synthesis settling, output being handed to a transport, and evidence of client playout. Not all deserve independently durable state machines. A small set of correlated terminal observations can be sufficient; an external action with unknown side effects must not be treated as safely retryable just because the caller was canceled.
  3. Capability exposure: if the active, appropriate tool set is small, expose it directly. If it grows enough to affect selection, latency, or context cost, compare a retrieved subset with that baseline. Visibility is not authorization: keep the existing Run-scoped permissions, policies, validation, and invocation checks as the enforcement boundary.
  4. Streaming voice: protect PCM delivery from remote caption-delivery delays, but also choose an explicit policy for internal alignment backpressure. A bounded queue can reasonably fail fast, wait briefly, or coalesce disposable estimates. I found an actual v0.6.8 code-path boundary that makes this a measurable design choice rather than a generic recommendation.

These are not requests for an architectural rewrite. Several boundaries are already present; the remaining choices depend on product goals.

The default path I would try first

  • Preserve the Host/Agent/RTC ownership separation and current session-lifetime behavior. Do not label a Run durable until restart and external effects can be reconciled.
  • Keep committed turns and canonical model/tool output authoritative for Agent/Memory state; treat speech, captions, and transport as delivery observations.
  • Keep the capability registry simple while the visible active inventory is manageable; evaluate a selector only when there is a demonstrated inventory problem.
  • Keep speech buffering bounded. Measure the particular queue and failing enqueue before changing its capacity or scheduling policy. Keep terminal reasons observable at whichever boundary needs them.
  • Under overload, choose between a reported partial utterance, a bounded pause, or continued PCM with coarser captions according to UX requirements.

A concrete v0.6.8 observation: the internal alignment queue

I tested the real v0.6.8 SpeechStreamer.run() path using synthetic PCM and a controlled delay around internal alignment handling. I did not use a live model, an actual TTS provider, RTC transport, a browser, or a speaker. That scope is important: the test probes scheduling and terminal behavior in a particular implementation path, not a production failure rate and not slow remote caption receivers.

In the tested source, OutputTextAudioAlignment items pass through an asyncio.Queue(maxsize=8), and the alignment producer uses put_nowait(). If all eight slots are occupied at the next enqueue, Python raises QueueFull (asyncio.Queue documentation). A peak of 8/8 alone does not imply an exception.

The Colab return contained 15 instrumented runs (10 completed, five stopped early) and six uninstrumented controls (four completed, two stopped early). All 21 expected-state checks passed, but only 14/21 speech outputs completed; seven ended early as expected in the overload scenarios. All five instrumented stops coincided with enqueue attempts into a full internal queue. The uninstrumented overload controls also stopped; this supports the code-path finding without proving that instrumentation had zero effect on timing.

Controlled input Colab outcome What it tells us
10 ms PCM frames supplied every 10 ms; 80 ms injected alignment delay 3/3 stopped, 100/120 frames published Producer can outrun internal alignment consumption
Same feed, 60 ms alignment delay 2/2 completed, 120/120 frames A faster consumer avoided failure in these trials
20 ms frame feed; 80 ms alignment delay 2/2 completed, 120/120 frames More spacing between inputs relieved the queue
Rapid delivery of 300 ms speech segments; 80 ms alignment delay 2/2 stopped, 210/360 frames Longer segment duration alone does not prevent pressure
500 ms segments at the selected borderline feed; 80 ms alignment delay 5/5 completed, 600/600 frames; peak reached 8/8 Full occupancy and a failed enqueue are different observations

In the short overloaded condition, enqueue-to-dequeue wait reached roughly 611-613 ms at p95; the injected alignment handling delay had a median near 80-81 ms. Neither measures network RTT, actual TTS latency, browser caption lag, or human-perceived audio.

The early stops were not mislabeled as successful synthesis. The speech job reported speech_synthesis_failed; the final transcript event carried interrupted=True, reason=None. These may intentionally describe different scopes. The narrow design question is whether any client needs to distinguish user barge-in from internal output failure from this event alone, or can use a correlated authoritative diagnostic.

The finding is not that eight slots are too few. It is an observable fail-fast boundary under sustained synthetic pressure. Local and Colab stop/complete patterns broadly agreed, but near-threshold timing was scheduler-sensitive. These samples cannot establish a universal unsafe cadence or real-world incidence. Deepgram’s TTS latency discussion is useful background on faster-than-realtime generation, but it does not validate our injected 80 ms workload as a typical provider workload.

A small decision guide

If the situation is… Start with…
Small, interactive voice session Session-bound execution and explicit cleanup
Background task with valuable output Opt-in separate lifetime, later recovery contract
Few versus many capabilities Direct exposure first; benchmark a selector if needed
Queue overload Keep fail-fast if partial speech is acceptable; otherwise compare bounded alternatives
Need end-user delivery confidence Optional client observations, not server-side assumptions

Details and reproduction notes follow. These are options, not prerequisites for v0.6.8 to be useful.

A. Session identity, execution lifetime, and reconnect

Ownership is not persistence

The release explicitly distinguishes application/Host ownership, a managed Agent execution, an interactive session, and a bounded model/tool Run. That separation is valuable. The release also explicitly says connection-independent persistent execution and automatic recovery are not yet implemented; the Host abstraction does not imply otherwise.

My preferred starting point is three behaviors, selected according to the user request:

Activity Lifetime by default Why
Realtime reply, voice clarification, ephemeral turn Session-bound Predictable cleanup and cost; abandoned calls stop
Explicit research, export, or file-processing job Independent execution when supported Useful result may outlive a browser or RTC connection
Scheduled/proactive persistent work Separate managed, recoverable task in a future durable mode Requires ownership, budget, revocation, result delivery, and recovery policies

A transport connection need not define Agent identity, and an Agent identity need not authorize work indefinitely. Background work needs an explicit lifecycle, particularly when it spends money or acts after the user disconnects.

Distinguish three reconnect questions

Connection disappears.
|
+-- Same process and execution still running?
|   Attach a new session only if identity, scope, and current policy allow it.
|
+-- Session closed and execution intentionally canceled?
|   Report the terminal state; don't silently reconstruct a "continuation."
|
+-- Worker/process restarted?
    Resume only if a durable checkpoint and safe effect-reconciliation
    contract actually exist; otherwise report that recovery is unavailable.

An in-process adapter cleanup, an RTC reconnection, and a process restart have different failure domains. IDs might be stable across them, but that does not establish recoverable work. After a crash, a model response, Memory update, or external action may already have committed. A timeout after dispatch is outcome unknown, not action did not happen. The author already recognizes this ambiguity; it supports the ownership separation rather than revealing an overlooked defect.

The A2A Task lifecycle documentation gives a useful comparison between related conversational context and separately identified stateful tasks. That is an analogy for contracts, not a dependency recommendation or a suggestion to adopt the same states verbatim.

Recommendation: keep v0.6.8’s ownership separation, retain session-bound behavior until a specific task needs continuation, and introduce persistence only with explicit recovery and authorization semantics. Reconnect support should not quietly expand the runtime’s authority or spending window.

B. Completion: canonical results versus generated and played media

One result can have several terminal facts

I would resist making one universal completed flag stand for an entire realtime interaction. The model may finish its answer before TTS starts; TTS may produce a partial prefix before failing; the transport may accept bytes that the remote client never renders. The author already separates several of these boundaries. The useful next question is which consumer needs which terminal observation, not how to persist every stage forever.

A compact conceptual breakdown, without proposing new mandatory API types:

Stage Evidence What that evidence does not prove
User turn committed Selected/admitted user input All candidate speech or sensor observations were authoritative
Model/tool Run settled Recorded Run outcome A dispatched external effect definitely did or did not occur
Canonical answer committed Authoritative output for Agent/Memory The answer has been spoken to the user
Speech synthesis settled PCM synthesis completed, failed, or was interrupted Client successfully played the generated audio
Transport output accepted Local publisher accepted frames/metadata Remote recipient decoded or played them
Client playout observed A specific client reported progress The human heard or understood the message

One workable minimal outcome vector is:

run:        succeeded | failed | canceled | effect_unknown
canonical:  committed | not_committed
speech:     complete | partial | failed | interrupted | unused
transport:  submitted | partial | not_submitted | unknown
playout:    observed_partial | observed_end | unobserved

These labels are illustrative, not the current AlphaAvatar schema. Retain only distinctions that affect retry, UI, history, Memory, or audits. If an authoritative outcome already carries a reason, captions may only need a correlation reference.

Two correct histories can differ

The canonical history can record the full response the Agent committed. The user-experienced timeline may show that only a prefix was emitted, captioned, or played. Both are useful, and neither should silently overwrite the other. Treating the full answer as heard can confuse the next turn after interruption; replacing canonical history with a partial transcript is not safe either. A lightweight delivery marker tied to the canonical output can preserve both facts.

For example:

Canonical result: "The three options are A, B and C. I recommend B."
Audio state:       interrupted after an estimated spoken prefix
Caption state:     final prefix and terminal disposition, if available
Next turn:         answer exists, but delivery was partial or uncertain

A user interruption and internal audio failure can both leave a partial prefix, yet their UI and retry implications differ. In our v0.6.8 probe, the internal failure reason was reported, while the final transcript event’s reason was null. That observed scope difference motivates checking where clients can retrieve the reason, not claiming that captions are broken.

Uncertain external actions must remain uncertain

Completion semantics matter beyond audio. An Agent may issue a tool call that sends a message, writes a record, or triggers another external side effect, then receive a timeout or cancellation. The tool’s caller is finished; the external action’s outcome may not be known. A future retry policy should distinguish pure computation from actions that require status reconciliation, idempotency keys, or user confirmation. That point is already acknowledged by the author and reinforces the existing typed capability/Run model.

Minimal default: retain one authoritative committed output plus correlated delivery observations. Persist only those needed for user-visible recovery or later decisions. Use an explicit unknown disposition when the evidence cannot support a stronger claim. The smallest test is to interrupt a spoken response halfway through and compare canonical output, final caption, speech-job outcome, and whatever the client actually reports.

C. Capability exposure, availability, and invocation authority

Start with the good boundaries that are already there

The move from descriptive plugin capabilities to typed invocable runtime capabilities is substantive. It separates the presence of a plugin from a binding that the native model/tool Loop can actually call. v0.6.8 already includes Run-level capability scopes, tool policy, and optional invocation authorization; I would not suggest adding an authorization layer as though it were missing.

A model’s tool view is only one stage in a longer sequence:

registered capability
  | owner ready / available?
  | relevant and appropriate to this Run?
  | exposed to the model?
  | selected with valid arguments?
  | authorized at the actual call boundary?
  | executed with a known or uncertain outcome?

Registration, readiness, visibility, authority, and outcome can differ. That distinction becomes increasingly valuable as Persona/Memory processors own more of their own lifecycles and third-party tools enter through MCP or other integrations.

Full-list baseline versus dynamic selection

Expose the currently active, appropriate list when small, not every installed or privileged capability. A direct list is debuggable, avoids selector recall errors, and may cost less than an extra selection step.

Selection becomes attractive when many tools have overlapping descriptions, users have substantially different accounts/scopes, or schemas consume meaningful context. But relevance filtering can accidentally hide the only correct tool. Therefore a selector should be compared with the direct-list baseline, not assumed superior because it produces shorter prompts.

A small paired evaluation could measure:

  • Needed-tool recall, especially rare or ambiguous tasks.
  • Wrong-tool selection and invalid arguments.
  • End-to-end task success, not merely whether a tool was called.
  • Prompt cost including retrieval/ranking cost and latency.
  • Correct denial of unauthorized calls regardless of model visibility.
  • Freshness when a processor goes offline or permissions change mid-Run.

A few common requests, rare-tool cases, and a no-tool case can establish whether selection helps. If the baseline works, simplicity is a valid outcome.

Selection never grants authority

The model seeing a schema is not permission to invoke it. Conversely, hiding a tool description is not security. Validate arguments, check the invoking user/Run scope and current handler readiness, and require confirmation for sensitive irreversible operations where policy requires it. If a permission changes after the model prompt was built, check it again at invocation. A description from a third-party tool catalog is data, not an instruction with higher authority than the Host/user policy.

The MCP Tools specification provides a useful external reference for listing tools, schemas, invocation, and list-change notifications; it does not replace an application’s policy engine. This matters especially if capability inventories become dynamic, but it does not imply AlphaAvatar needs a wholesale MCP-style redesign.

Conditional answer: use the simple active list now; introduce selection only when measured inventory size or quality makes it worthwhile. Preserve an invocation-time policy boundary and expose meaningful distinctions between “not available,” “not chosen,” and “not authorized.”

D. Streaming voice: overload policy, interruption, and alignment

Four pressure points should not be conflated

There is a useful distinction between (1) text generation outpacing segmentation/TTS, (2) TTS/audio framing outpacing internal alignment handling, (3) media output outpacing RTC/network/client consumption, and (4) caption publication outpacing a remote text subscriber. The experiment above exercises the second boundary. It does not show that a slow browser subtitle listener blocks the PCM path, nor that network delivery is too slow. This specificity matters because otherwise a good architecture could be criticized for an unrelated failure mode.

The simplified shape of the tested boundary is:

synthetic text segments + PCM frame producer
                |
          SpeechStreamer.run()
                |
         +------+-------+
         |              |
      PCM frames     alignment items
         |              |
      audio output    bounded queue (8)
                        |
                   alignment handler
                        |
                  transcript mapping

Nonblocking enqueue is a bounded-memory, low-latency choice; waiting indefinitely or buffering without limit would carry different risks. Fail-fast is defensible. The open policy question is whether partial speech is the intended visible outcome, or whether disposable alignment updates can degrade independently of PCM.

Policy menu, with costs made explicit

A. Preserve fail-fast and improve observability. This is the lowest-cost default if a partial utterance is an acceptable degraded outcome. Keep the bound and exception behavior; count failed enqueues and correlate the speech-job reason with the output ID. Ensure that the UI does not describe an internal failure as if the user had deliberately interrupted. It also provides a clear regression-test target. This path does not guarantee continuous speech under overload, but it prevents silent unbounded lag.

B. Use a short bounded wait. A limited await put() may absorb transient bursts; after a deadline the system still terminates or degrades. However, placing that wait on the PCM publisher’s critical path can introduce audible gaps and slow cancellation. It must be measured with audio frame timing, end-to-end latency, and interrupt responsiveness, not judged only by fewer queue errors. A longer timeout may trade a visible failure for a stuttering utterance.

C. Coalesce superseded estimates. If estimated alignment for a segment is replaced by a newer estimate, retaining only the latest valid revision could reduce pressure. Preserve segment identity, ordering, final markers, and authoritative text; do not arbitrarily drop the only final mapping. Coalescing is useful only if the existing consumer contract permits missing intermediate estimates. Its trade-off is less subtitle timing granularity, possibly a better choice than losing PCM.

D. Explicitly drop low-value interim data. Similar to coalescing but with a simpler policy: discard only optional nonterminal estimates under load and increment a drop counter. It must not discard committed canonical output or an essential terminal notification. If terminal delivery shares the same congested queue, reserve a reliable settlement path or document its failure semantics.

E. Isolate the slower stage or increase queue capacity. A dedicated scheduler could preserve PCM timing but adds task lifetime and cleanup complexity. A bigger queue may absorb genuine short bursts, but sustained rate mismatch still causes growth and stale captions. It is not a solution just because a larger number makes the synthetic test pass.

A practical choice tree:

Do failed internal alignment enqueues occur under intended workloads?
|
+-- No: retain the existing bounded design; peak 8/8 alone is insufficient.
|
+-- Yes:
    |
    +-- Is a clearly signaled partial utterance acceptable?
    |   Yes: retain fail-fast; expose an appropriate terminal diagnostic.
    |
    +-- Must audio continue even with reduced caption accuracy?
    |   Consider revisable-estimate coalescing or selective interim dropping.
    |
    +-- Must exact alignment remain intact?
        Compare a bounded wait or isolated scheduling; measure audio gaps.

This is a policy choice, not a request to implement all five. If users see truncation, compare the current behavior with one bounded alternative.

Interruption is a separate axis

Real user barge-in, echo-triggered false interruption, automatic cancellation, TTS synthesis failure, and alignment-queue saturation can all lead to partial speech. They should not be treated as interchangeable causes, even if all can set an interrupted flag at one presentation boundary. For example, an internal overflow should not cause a UI to say “you interrupted me” without evidence of user action.

A generated answer, published PCM frames, a server playout estimate, actual client-side playout and the text shown as subtitles are distinct streams of evidence. It may be helpful to retain full canonical text for Memory while marking delivery as partial. The LiveKit synchronized-transcription documentation and PlaybackFinishedEvent reference show how another stack treats some of these distinctions. The important part is the semantics, not an SDK dependency.

A small terminal-reason contract, only where needed

In the partial-failure path, the speech job had speech_synthesis_failed, while the final transcript had interrupted=True, reason=None. At least three interpretations fit:

  1. The transcript intentionally exposes only presentation-level termination, and the authoritative speech outcome is discoverable elsewhere. No additional field is needed if consumers can correlate them.
  2. A client needs to render different messages for user interruption and pipeline failure. An optional reason/category or correlated outcome reference may help.
  3. Consumers only need a terminal marker to stop their UI. Adding reasons to every caption would create redundant policy coupling; a diagnostic event/counter is enough.

I would choose among these based on an actual consumer requirement. The experiment establishes the observation, not that reason=None violates a contract. It also confirms the failure was not labeled clean completion.

My recommendation for streaming voice: preserve bounded memory and PCM priority, keep the current behavior until real use indicates a problem, and make the failure type observable with minimal coupling. If continuous audio under overload is a product goal, compare one bounded alternative while measuring frame gaps, caption staleness, and interruption latency together.

E. Reproduction, controls, and limits of the evidence

For anyone wanting to reproduce the specific boundary without deploying a full avatar, the useful ingredients are the v0.6.8 SpeechStreamer.run() implementation (avatar-plugins/perception/avatar-plugins-router/alphaavatar/plugins/router/processors/speech/speech_synthesis/streaming.py), synthetic PCM frames, controlled segment/frame timing, and a delayed internal alignment consumer. These tests exercised the release source, not a generic queue simulator. Instrumentation wrapped the queue without changing the streaming algorithm.

A minimal scenario matrix (timings are injected, not measurements from a provider) is:

A: 12 short segments, 120 frames, 10 ms frame feed, 80 ms alignment delay
B: same frames and feed, 60 ms alignment delay
C: same frames and 80 ms alignment delay, 20 ms frame feed
D: longer segments with rapid audio generation and slow alignment
E: borderline case repeated to expose scheduling sensitivity

For each run, record source hash/version, produced and published frame counts, queue peak, each failed enqueue, enqueue-to-dequeue age, final speech-job outcome, terminal transcript state, and any uncaught exception. Repeat without the instrumentation wrapper as a control. Assertions should check consistency with the expected outcome, not count any early stop as a successful audio completion. Use process-local monotonic timing for queue intervals; do not compare unrelated clocks as if they were synchronized.

Evidence level: locally and on Colab reproduced synthetic scheduling behavior in the supplied v0.6.8 path. Not established: real provider cadence, production alignment delay, RTC delivery, perceived quality, client playback, multi-user load, or later commits. If the installed version has changed, pin the tested source before comparing. A useful future falsifier would be an end-to-end trace showing that actual alignment handling never approaches the synthetic backlog, or a code change that safely coalesces/paces the queue without affecting PCM or terminal signals.

Privacy note: counters and bounded latency summaries are preferable to logging raw speech, transcript contents, or user identifiers merely to diagnose queue saturation.

F. Selected comparison references

These are comparisons and background, not evidence of the same cause in AlphaAvatar:

For future review: Which state is authoritative? What was generated, handed off, or observed? Which overload policy is intentional? This regression scenario is compatible with the release’s architectural direction.

Hi @John6666,

Thank you for the detailed analysis and, especially, for taking the time to test the actual v0.6.8 SpeechStreamer.run() implementation. I really appreciate the controlled experiments and the clear distinction between synthetic scheduling pressure and real-world production behavior.

Your observations are very helpful, particularly the internal alignment queue backpressure issue.

I agree with your broader architectural points:

1. Session vs. Agent execution

The goal is to keep Agent execution independent of any particular transport or interactive session, while allowing different execution policies depending on the task.

Ordinary realtime interactions can remain session-bound, whereas explicitly requested background tasks should eventually support independent lifetimes. Reconnection, continuation, and durable recovery will have separate contracts rather than being treated as the same capability.

2. Completion and delivery semantics

I agree that canonical model/tool results and user-experienced delivery should remain distinct.

AlphaAvatar already separates several of these boundaries, but there is still room to improve how delivery outcomes and terminal reasons are correlated, especially when only part of a response has been spoken.

3. Runtime capabilities

I share your preference for keeping capability exposure simple until a larger inventory justifies dynamic selection.

The capability registry is intended to provide executable, scoped runtime contracts. Model visibility and actual invocation authorization remain separate concerns.

4. Streaming voice and alignment backpressure

This is the most actionable finding.

I reviewed the bounded alignment queue and its put_nowait() path. Your experiments demonstrate a reproducible failure boundary under synthetic pressure, even though they do not establish how frequently it occurs with real TTS providers.

One important design principle for AlphaAvatar is that PCM delivery should not be blocked by transcript synchronization or slower downstream consumers.

For v0.6.9, I plan to include this scenario in the voice stress and regression tests, particularly:

  • Alignment queue saturation and failure propagation.

  • Speech Job and transcript terminal-reason consistency.

  • PCM continuity, interruption responsiveness, and bounded queue behavior under pressure.

I would prefer to measure these behaviors before deciding whether bounded waiting, selective coalescing, or another overload policy is appropriate. Simply increasing queue capacity or introducing blocking waits could create different latency problems.

More broadly, v0.6.9 is focused on reliability, diagnostics, and systematic testing of the native runtime, so this feedback is particularly timely.

Thanks again for the thoughtful review and reproducible experiments. This is exactly the kind of technical feedback that helps improve AlphaAvatar’s architecture and implementation.

Really appreciate your contribution!