-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
Azure OpenAI Responses stalls before first event when memory tools are exposed #80926
Copy link
Copy link
Open
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.Crash, hang, restart loop, or process-level availability failure.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.maintainerMaintainer-authored PRMaintainer-authored PR
Description
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.Crash, hang, restart loop, or process-level availability failure.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.maintainerMaintainer-authored PRMaintainer-authored PR
Type
Fields
Priority
None yet
Summary
Azure OpenAI Responses can return HTTP 200 headers for an OpenClaw embedded run and then never deliver a first parsed Responses event when memory tools are exposed. The same Azure deployment streams normally for direct Responses API calls, and the same OpenClaw run succeeds when the memory tools are excluded from
tools.allow.This is related to the broader Responses stream-stall reports in #76305 and Azure Responses adapter problems in #79570, but the trigger isolated here is the OpenClaw tool surface, specifically
memory_get/ memory tools.Environment
7116cc8a2cplus local debug/fix branchazure-openai-responses2025-04-01-preview/openai/responses?api-version=2025-04-01-previewgpt-5.4-proBefore proof: memory tool stalls before first event
With
memory_getenabled, OpenClaw reaches Azure and receives streaming response headers, but no[responses] first_eventlog arrives before timeout.Command shape:
OPENCLAW_DEBUG_MODEL_TRANSPORT=1 \ OPENCLAW_DEBUG_SSE=events \ OPENCLAW_DEBUG_MODEL_PAYLOAD=summary \ AZURE_OPENAI_API_VERSION=2025-04-01-preview \ pnpm openclaw agent --local \ --session-id devdiv-memoryget-062004 \ --model azure-openai-responses-devdiv/gpt-5.4-pro \ --thinking off \ --timeout 35 \ --message 'Reply with only: ok' \ --jsonObserved transport lines:
No
[responses] first_eventor[responses] stream_donefollowed before the run was killed/timeout-bound.A prior full/default tool-surface run showed the same pattern and eventually timed out:
Control proof: endpoint and streaming are valid
A direct non-OpenClaw curl call to the same Azure Responses endpoint with
stream=truereturned SSE immediately, includingresponse.created,response.output_text.delta, andresponse.completed.A direct curl call with cache fields, reasoning include, about 30k input chars, and 21 simple function tools also streamed promptly. That points away from endpoint/auth/API-version and toward the OpenClaw tool payload or tool-conditioned prompt surface.
After proof / workaround: exclude memory tools
With memory tools excluded and core/session/web tools allowed, the same OpenClaw model call succeeds:
Command shape:
OPENCLAW_DEBUG_MODEL_TRANSPORT=1 \ OPENCLAW_DEBUG_SSE=events \ OPENCLAW_DEBUG_MODEL_PAYLOAD=summary \ AZURE_OPENAI_API_VERSION=2025-04-01-preview \ pnpm openclaw agent --local \ --session-id devdiv-web-060949 \ --model azure-openai-responses-devdiv/gpt-5.4-pro \ --thinking off \ --timeout 45 \ --message 'Reply with only: ok' \ --jsonObserved success:
The final assistant payload was
ok.Local fix branch evidence
I found one concrete provider-compat problem while isolating this: memory tool
corpusschemas usedType.Union([Type.Literal(...)]), which compiles toanyOf. The repo already has a flatstringEnumhelper for this class of provider compatibility issue. I patched memory-core to use flat string enums and added a regression test that asserts noanyOfis emitted for those corpus fields.That cleanup is useful but does not fully resolve this Azure stall: after the enum patch, enabling
memory_getstill reproduced the pre-first-event stall. The remaining bug is likely either another part of the memory tool schema/description or Azure's handling of this specific memory tool surface.Verification run locally
Expected behavior
Azure OpenAI Responses should either stream a first event promptly or fail with a bounded, actionable error when a provider cannot handle a tool payload. It should not leave the embedded run in
model_call:starteduntil timeout after headers have already arrived.