Skip to content

fix: extend realtime OpenClaw consult wait#607

Merged
rogerchappel merged 1 commit into
mainfrom
codex/fix-openclaw-realtime-timeouts
Jun 1, 2026
Merged

fix: extend realtime OpenClaw consult wait#607
rogerchappel merged 1 commit into
mainfrom
codex/fix-openclaw-realtime-timeouts

Conversation

@rogerchappel
Copy link
Copy Markdown
Owner

Summary

  • Extend CrewCMD's realtime OpenClaw consult wait from 110 seconds to a 10 minute bounded window and raise the route max duration accordingly.
  • Recover empty or missed realtime final events by reading durable chat.history, preferring the assistant row matching the OpenClaw run id/idempotency key, then falling back to the consult prompt.
  • Add a regression test for an empty final event recovered from chat history.

Investigation

OpenClaw docs describe talk.client.toolCall as the browser realtime path for openclaw_agent_consult: clients receive a run id, wait for normal chat lifecycle events, then submit the provider-specific tool result. The Control UI docs also distinguish live chat delivery events from durable chat.history, and say history is reloaded after tool-final events.

CrewCMD's relay route followed the event-wait pattern, but it added a hard 110 second timeout and returned OpenClaw completed without returning text. when the final event had no text. That explains both failure modes reported here: long OpenClaw runs crossed CrewCMD's local timer, and final events without inline text were not recovered from the durable transcript.

Verification

  • pnpm vitest run 'src/app/api/runtimes/[id]/talk/realtime/relay/route.test.ts'
  • pnpm typecheck
  • pnpm exec eslint 'src/app/api/runtimes/[id]/talk/realtime/relay/route.ts' 'src/app/api/runtimes/[id]/talk/realtime/relay/route.test.ts'
  • git diff --check
  • pre-push hook: pnpm typecheck && pnpm build passed. Build emitted existing Turbopack NFT warnings around next.config.ts / openclaw-config-parser.ts.

Risk

Medium. This keeps an HTTP tool-call request open longer, matching the current synchronous relay architecture. A follow-up background consult handoff would be better for truly unbounded OpenClaw runs.

@rogerchappel rogerchappel marked this pull request as ready for review June 1, 2026 00:31
@rogerchappel rogerchappel merged commit cc98a14 into main Jun 1, 2026
1 check passed
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