openclaw - 💡(How to fix) Fix [Feature]: add pre-answer context preload hook for realtime voice agents

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Request: Add a first-class pre-answer context preload hook for realtime voice agents.

Why: We want the realtime voice agent to preload caller/contact context before it starts speaking, similar to our V1 intake agent. Right now this requires patching the compiled voice-call runtime, which is fragile across OpenClaw/plugin updates.

Use case: When an inbound call arrives, OpenClaw should be able to:

• read call metadata like from, to, and callSid • look up the caller in CRM/contact systems • match tenant/owner/vendor/unknown • load linked property/account/recent issue context • inject a sanitized context block into realtime session instructions before the first model turn

Desired lifecycle: Inbound call arrives → run async caller/contact preload → return Twilio <Connect><Stream> → create realtime session → inject sanitized per-call context → model speaks with context on first turn

important behavior:

• async hook with configurable timeout • if hook fails/times out, call still connects normally • context is scoped to the call/session • logs show success/failure without leaking private data • no monkey-patching compiled runtime files

Root Cause

Because that context is not available before the first model turn, the agent may ask unnecessary questions, respond generically, or miss important known information.

Fix Action

Fix / Workaround

Why: We want the realtime voice agent to preload caller/contact context before it starts speaking, similar to our V1 intake agent. Right now this requires patching the compiled voice-call runtime, which is fragile across OpenClaw/plugin updates.

• async hook with configurable timeout • if hook fails/times out, call still connects normally • context is scoped to the call/session • logs show success/failure without leaking private data • no monkey-patching compiled runtime files

Current workaround: patching the compiled voice-call runtime. That works locally, but it is fragile and likely to break during OpenClaw/plugin updates.

RAW_BUFFERClick to expand / collapse

Summary

Request: Add a first-class pre-answer context preload hook for realtime voice agents.

Why: We want the realtime voice agent to preload caller/contact context before it starts speaking, similar to our V1 intake agent. Right now this requires patching the compiled voice-call runtime, which is fragile across OpenClaw/plugin updates.

Use case: When an inbound call arrives, OpenClaw should be able to:

• read call metadata like from, to, and callSid • look up the caller in CRM/contact systems • match tenant/owner/vendor/unknown • load linked property/account/recent issue context • inject a sanitized context block into realtime session instructions before the first model turn

Desired lifecycle: Inbound call arrives → run async caller/contact preload → return Twilio <Connect><Stream> → create realtime session → inject sanitized per-call context → model speaks with context on first turn

important behavior:

• async hook with configurable timeout • if hook fails/times out, call still connects normally • context is scoped to the call/session • logs show success/failure without leaking private data • no monkey-patching compiled runtime files

Problem to solve

The problem to solve is:

Realtime voice agents currently start inbound calls “cold.”

When a call comes in, the model may begin speaking before OpenClaw has loaded caller context like:

• who the caller is • whether they are a tenant, owner, vendor, or unknown • what property/account they belong to • recent LeadSimple or PropertyMeld history • open maintenance issues • relevant routing or safety notes

Because that context is not available before the first model turn, the agent may ask unnecessary questions, respond generically, or miss important known information.

For us specifically, we want the realtime voice agent to behave more like the V1 intake agent: preload caller/contact/property context before answering, so the first response is informed and useful.

Current workaround: patching the compiled voice-call runtime. That works locally, but it is fragile and likely to break during OpenClaw/plugin updates.

So the feature request is asking OpenClaw to add a stable hook for this lifecycle point.

Proposed solution

Realtime voice agents currently start inbound calls “cold.”

When a call comes in, the model may begin speaking before OpenClaw has loaded caller context like:

• who the caller is • whether they are a tenant, owner, vendor, or unknown • what property/account they belong to • recent LeadSimple or PropertyMeld history • open maintenance issues • relevant routing or safety notes

Because that context is not available before the first model turn, the agent may ask unnecessary questions, respond generically, or miss important known information.

For us specifically, we want the realtime voice agent to behave more like the V1 intake agent: preload caller/contact/property context before answering, so the first response is informed and useful.

Current workaround: patching the compiled voice-call runtime. That works locally, but it is fragile and likely to break during OpenClaw/plugin updates.

So the feature request is asking OpenClaw to add a stable hook for this lifecycle point.

Alternatives considered

No response

Impact

Impact

Without a pre-answer context preload hook, realtime voice agents start calls without knowing who is calling or why they may be calling. This creates a weaker first interaction and forces the agent to rely on mid-call retrieval or repeated clarification questions.

The practical impact is:

• Worse caller experience: the agent may greet callers generically instead of recognizing known tenants, owners, vendors, or leads. • Slower triage: the agent has to ask for information that may already exist in CRM/intake/property systems. • Less accurate first response: important context like open work orders, recent intake history, caller type, or linked property may not be available until after the conversation has already started. • More brittle implementations: teams have to patch compiled runtime code or build custom Twilio wrappers to preload context, which can break on OpenClaw/plugin updates. • Harder adoption for production voice agents: many real-world inbound agents need contact/account context before speaking, especially in property management, healthcare, support, sales, and operations workflows.

Adding this hook would make realtime voice agents feel more responsive, informed, and production-ready from the first turn.

Evidence/examples

es — add a short “Evidence / additional context” section like this:

Evidence / additional context

We have a working local use case that demonstrates the need.

In our current voice-agent setup, we are testing enriched caller context in DRY_RUN mode. The preload step classifies inbound callers as owner/tenant/vendor/unknown, looks up CRM/property context, and can check PropertyMeld/open maintenance context before the agent handles the call.

Relevant local feature flags include: VOICE_FEATURE_ENRICHED_CALLER_CONTEXT=1 VOICE_FEATURE_TEST_OVERRIDES=1 VOICE_OVERRIDE_MODE=true VOICE_PROPERTYMELD_WRITE_ENABLED=false VOICE_RING_DELAY_SECONDS=3 The current implementation works locally, but only because we are patching around the voice-call runtime. That proves the feature is useful, but also shows why it should be upstreamed: this should be a supported lifecycle hook instead of a fragile local runtime patch.

The practical evidence is:

• caller classification already exists and is useful before the first spoken turn • PropertyMeld/open-issue lookup is useful before the agent asks questions • the V1 intake-agent pattern already benefits from preloaded caller/contact/property context • realtime voice needs the same context before the model starts speaking • current workaround requires local patching, which is fragile across OpenClaw/plugin updates

You can also add: This is not theoretical for us. We are already using a local/preload pattern for an intake-style voice agent, but realtime mode needs a first-class supported hook so the same context can be injected safely before the first model turn.

Additional information

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Feature]: add pre-answer context preload hook for realtime voice agents