Skip to content

fix(llm): keep OpenAI-compatible reasoning streams active#89440

Merged
steipete merged 1 commit into
mainfrom
fix/84384-openai-compatible-reasoning-activity
Jun 2, 2026
Merged

fix(llm): keep OpenAI-compatible reasoning streams active#89440
steipete merged 1 commit into
mainfrom
fix/84384-openai-compatible-reasoning-activity

Conversation

@steipete

@steipete steipete commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary:

  • Treat OpenAI-compatible streaming usage chunks with positive completion_tokens_details.reasoning_tokens as reasoning activity when the chunk otherwise emits no assistant stream event.
  • Emit the same zero-length thinking_delta pattern used by the native Google transport so the LLM idle watchdog sees progress without leaking visible text.
  • Avoid adding trailing empty thinking blocks after visible text/tool output.

Fixes #84384

Verification:

  • node scripts/run-vitest.mjs src/agents/openai-transport-stream.test.ts src/agents/embedded-agent-runner/run/llm-idle-timeout.test.ts
  • node ./node_modules/.bin/oxfmt --check src/agents/openai-transport-stream.ts src/agents/openai-transport-stream.test.ts && git diff --check
  • pnpm check:test-types
  • .agents/skills/autoreview/scripts/autoreview --mode local (clean: no accepted/actionable findings)

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels Jun 2, 2026
@clawsweeper

clawsweeper Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix(llm): keep OpenAI-compatible reasoning streams active This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@steipete

steipete commented Jun 2, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready proof for exact head 31a3e181d2a05894bac03bbc97f7bf61dfb2ff84:

Local proof:

  • node scripts/run-vitest.mjs src/agents/openai-transport-stream.test.ts src/agents/embedded-agent-runner/run/llm-idle-timeout.test.ts — 314 passed
  • node ./node_modules/.bin/oxfmt --check src/agents/openai-transport-stream.ts src/agents/openai-transport-stream.test.ts && git diff --check — passed
  • pnpm check:test-types — passed
  • .agents/skills/autoreview/scripts/autoreview --mode local — clean, no accepted/actionable findings

CI proof:

  • PR check rollup is green on the exact head, including CI selected shards, Real behavior proof, Security High, OpenGrep, dependency guard, workflow sanity, CodeQL critical-quality selection, and ci-timings-summary.
  • The cancelled auto-response / Real behavior proof entries in the rollup were superseded by newer passing runs on the same head.

Known gap: no live reporter Vertex sidecar was available; regression models the reported OpenAI-compatible SSE shape with positive completion_tokens_details.reasoning_tokens in a usage-only chunk and verifies it emits an empty thinking_delta keepalive without adding trailing reasoning after visible text.

@steipete
steipete merged commit 5259fa4 into main Jun 2, 2026
181 of 184 checks passed
@steipete
steipete deleted the fix/84384-openai-compatible-reasoning-activity branch June 2, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Gemini 2.5 Flash via vertex-ai (OpenAI-compatible) streaming times out — thinking tokens not handled

1 participant