Skip to content

improve(gateway): measure time to first streamed answer delta - #272

Merged
vincentkoc merged 2 commits into
mainfrom
fix/gateway-session-stream-timing
Nov 20, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
fix/gateway-session-stream-timing

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Kova's Gateway session benchmark currently finds the first assistant text by polling history. That poll interval adds timing error to comparisons of cold first answers.

User Impact

A caller can opt in to a direct time-to-first-answer measurement in the JSON receipt. The measurement follows the submitted run's streamed text and reports a missing sample explicitly.

Why This Change Was Made

Subscribe before sending so the first delta can be recorded even if it arrives before the send acknowledgment. Match the canonical session, run ID, and expected answer prefix. Keep the existing history-based completion and correctness checks.

Evidence

node tests/gateway-session-send-turn.mjs passed, including an early matching delta and a completed run without a matching delta. Syntax and diff checks passed. The disposable Linux check on cd728270f24 used OpenClaw 2026.11.6 and Node 24.22.1. OCM reported a running process, but Gateway readiness never passed: the assigned loopback port refused connections for 90 seconds. The session call therefore produced no stream sample. AWS Crabbox readiness receipt

All checks passed on the reviewed head. Exact-head CI

@vincentkoc vincentkoc self-assigned this Nov 20, 2026
@clawsweeper

clawsweeper Bot commented Nov 20, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@vincentkoc
vincentkoc marked this pull request as ready for review November 20, 2026 06:53
@vincentkoc
vincentkoc merged commit 8ae529e into main Nov 20, 2026
14 checks passed
@vincentkoc
vincentkoc deleted the fix/gateway-session-stream-timing branch November 20, 2026 06:55
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