Skip to content

fix(gateway): keep dense stream updates incremental#87558

Open
osolmaz wants to merge 17 commits into
mainfrom
codex/ollama-dense-gateway-repro
Open

fix(gateway): keep dense stream updates incremental#87558
osolmaz wants to merge 17 commits into
mainfrom
codex/ollama-dense-gateway-repro

Conversation

@osolmaz
Copy link
Copy Markdown
Member

@osolmaz osolmaz commented May 28, 2026

Opened on behalf of Onur Solmaz (@osolmaz). Windows, WSL2, and real Ollama-daemon validation are still open proof gaps. Maintainer Crabbox changed-gate proof passed on AWS Linux.

AI-assisted PR. Dense local-provider streams could make the gateway slow to answer unrelated requests.
This change makes streaming delta-first for the hot path: providers emit cheap deltas, the shared accumulator owns the full assistant message, and full snapshots are reserved for boundaries.
It also keeps the live gateway repro so reviewers can prove the delay behavior instead of relying only on unit tests.

Refs #86599.
Related #86633.

Summary

Dense local-provider streams could starve the event loop even though the response was asynchronous.
The expensive part was CPU work repeated for every tiny chunk, especially parsing dense Ollama-compatible output and repeatedly carrying or inspecting full growing assistant messages.
This change keeps ordinary streaming work proportional to the new delta, not the whole answer so far.

What Changed

The fix now includes both the narrow Ollama safety valve and the broader production shape.
Ollama still yields cooperatively while parsing dense NDJSON, but the long-term fix is the shared accumulator plus delta-first subscribers.

  • Added scripts/repro-gateway-dense-stream-latency.ts as an opt-in live gateway harness.
  • Corrected the repro fixture so the local provider streams chunks in bounded batches instead of blocking the measuring process with one synchronous write loop.
  • Added --assert-responsive, which checks dense-stream p99 health latency instead of max latency because a one-chunk control run showed unrelated max outliers.
  • Added createAssistantStreamAccumulator in core and re-exported it through openclaw/plugin-sdk/provider-stream-shared.
  • Migrated Ollama native streaming to emit lightweight partial payloads on text_delta and thinking_delta; text_end, thinking_end, and done still carry full content.
  • Migrated proxy streaming to the same accumulator in snapshot mode, preserving its current reconstructed-partial behavior while proving the helper is not Ollama-specific.
  • Documented the assistant stream contract: delta is the source of truth for incremental text/thinking/tool fragments; partial is compatibility state and may be lightweight on delta events.
  • Updated assistant stream subscription so unphased text_delta handling uses the new delta and streaming directive accumulator instead of repeatedly extracting/tag-stripping the full partial or accumulated assistant text.
  • Preserved replacement stream clears end-to-end: agent parser state, gateway projection, SDK projection, and UI stream state now honor explicit empty replacements without leaking suppressed control-token lead fragments.
  • Kept phase-aware OpenAI Responses behavior on the existing partial-message path.
  • Added focused accumulator, proxy, gateway coalescing, replacement-clear, Ollama stream, SDK projection, UI projection, and subscriber tests.

Testing

The fast tests cover the new helper, the hot Ollama path, the proxy compatibility path, gateway coalescing, replacement clear propagation, and the subscriber delta path.
The live proof uses a real local OpenClaw gateway and a local Ollama-compatible dense NDJSON endpoint.

  • node scripts/run-vitest.mjs packages/agent-core/src/agent-loop.test.ts src/plugin-sdk/provider-stream-shared.test.ts src/llm/assistant-stream-accumulator.test.ts src/agents/embedded-agent-subscribe.handlers.messages.test.ts src/agents/embedded-agent-runner/run/attempt.model-diagnostic-events.test.ts src/agents/runtime/proxy.test.ts src/gateway/server-chat.agent-events.test.ts src/gateway/server-chat.stream-text-merge.test.ts ui/src/ui/controllers/chat.test.ts packages/sdk/src/index.test.ts - 13 files, 302 tests passed.
  • node --max-old-space-size=8192 --import tsx scripts/generate-plugin-sdk-api-baseline.ts --check.
  • git diff --check origin/codex/ollama-dense-gateway-repro..HEAD.
  • ./.agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main - clean, no accepted/actionable findings.
  • node scripts/crabbox-wrapper.mjs run --timing-json --shell -- "corepack pnpm check:changed" - passed on AWS Crabbox, run run_83ba0b846d17, lease cbx_dac8f161e0fe, provider aws, total 13m38.652s, exit 0.
  • Earlier focused/local proof from the original patch included pnpm tsgo:core, pnpm tsgo:extensions, pnpm build, and node --import tsx scripts/repro-gateway-dense-stream-latency.ts --assert-responsive.

What was not tested locally: Windows, WSL2, and a real Ollama daemon producing naturally dense output.

Real behavior proof

Behavior addressed: dense local-provider stream gateway responsiveness delay related to #86599 and #86633.
Real environment tested: local macOS OpenClaw checkout on codex/ollama-dense-gateway-repro, real OpenClaw gateway process, local Ollama-compatible dense NDJSON endpoint. This does not use a real Ollama daemon for the dense output.
Exact steps or command run after this patch: node --import tsx scripts/repro-gateway-dense-stream-latency.ts --assert-responsive
Evidence after fix:

{
  "liveGateway": true,
  "providerProtocol": "ollama-native-compatible",
  "realProviderDaemon": false,
  "chunks": 10000,
  "chunkBytes": 64,
  "serverBatchSize": 100,
  "finalExpectedChars": 640000,
  "chatRequests": 1,
  "sendStatus": "started",
  "runStatus": "ok",
  "ackMs": 105,
  "totalMs": 36414,
  "baseline": {
    "count": 20,
    "min": 36,
    "p50": 41,
    "p95": 56,
    "p99": 56,
    "max": 79,
    "over100ms": 0,
    "over500ms": 0,
    "over1000ms": 0
  },
  "during": {
    "count": 465,
    "min": 30,
    "p50": 34,
    "p95": 279,
    "p99": 323,
    "max": 2436,
    "over100ms": 87,
    "over500ms": 3,
    "over1000ms": 1,
    "errors": 0
  },
  "chatEvents": 77,
  "finalChars": 500000
}

Observed result after fix: the dense run completed with p99 health latency 323ms and no health errors. Max latency still had outliers; a one-chunk control run also showed a >1s max outlier, so the fixed-branch assertion intentionally uses p99 rather than max.
What was not tested: Windows, WSL2, and a real Ollama daemon producing naturally dense output.

Risks

The main compatibility risk is any consumer that incorrectly treated partial on every delta as the canonical full message.
The stream contract now says ordinary delta consumers should use delta, while boundary/final events carry full content.

  • Ollama text_delta and thinking_delta events now carry lightweight partial content; text_end, thinking_end, and done still carry full content.
  • Proxy streaming keeps snapshot partials, so existing proxy consumers should not see a shape change.
  • Phase-aware OpenAI Responses behavior stays on the existing partial-message path.
  • Explicit replacement clears now bypass the normal non-empty text gate, but suppressed control lead fragments remain suppressed.
  • The live repro is opt-in and should not run in normal CI.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: L maintainer Maintainer-authored PR labels May 28, 2026
@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 28, 2026

Codex review: needs maintainer review before merge. Reviewed May 28, 2026, 6:45 AM ET / 10:45 UTC.

Summary
The branch makes assistant streaming delta-first with a shared accumulator, migrates Ollama/proxy/gateway/subscriber/SDK/UI paths, documents the stream contract, and adds dense-stream latency repro and regression tests.

PR surface: Source +318, Tests +1116, Docs +8, Generated 0, Other +602. Total +2044 across 33 files.

Reproducibility: Do we have a high-confidence way to reproduce the issue? Partly: the linked issue has concrete starvation logs, and this PR adds a live dense-stream harness, but this review did not reproduce current main or the exact Windows/WSL2 real-Ollama setup.

Review metrics: 1 noteworthy metric.

  • Public stream contract: 1 event contract changed, 1 SDK helper export added. Plugin consumers need to understand the new delta/partial contract before maintainers accept the compatibility risk.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P2] Record maintainer acceptance of the lightweight delta partial contract before merge.
  • [P2] Decide whether Windows/WSL2 real-Ollama proof is required for the linked beta report.

Risk before merge

  • [P1] Plugin or embedded consumers that treated every delta event's partial as a full assistant-message snapshot can break unless maintainers accept the documented delta-first contract.
  • [P1] Gateway and channel-visible assistant delivery now depends on delta and replacement accumulation across agent-core, embedded subscribers, gateway projection, SDK, and UI, so a missed sibling consumer could alter streamed replies.
  • [P1] The supplied proof is strong for macOS, AWS Linux changed-gate, and a local Ollama daemon stream smoke, but it does not reproduce the exact Windows/WSL2 beta environment from [Bug]: Local model provider calls thread block gateway event loop on Windows beta; trivial infer run takes ~4 minutes #86599.

Maintainer options:

  1. Accept the delta-first stream contract (recommended)
    Maintainers can merge after explicitly accepting that delta is canonical for incremental consumers and lightweight delta partials are an intended SDK contract change.
  2. Require exact-environment proof first
    Maintainers can ask for Windows or WSL2 real-Ollama gateway proof before merge if this PR is meant to close the linked beta blocker completely.
  3. Pause if compatibility is not approved
    If the SDK stream contract is not acceptable, the branch should pause until a compatibility mode or narrower Ollama-only fix is chosen.

Next step before merge

  • [P2] Human review should decide SDK stream-contract compatibility and whether the remaining exact Windows/WSL2 proof gap is acceptable before merge.

Security
Cleared: No concrete security or supply-chain regression was found; the diff does not add dependencies, workflows, lockfile changes, or secret-handling expansion.

Review details

Best possible solution:

Land only after maintainers accept the stream-contract compatibility change and decide whether the remaining Windows/WSL2 real-Ollama proof gap must be closed before merge.

Do we have a high-confidence way to reproduce the issue?

Do we have a high-confidence way to reproduce the issue? Partly: the linked issue has concrete starvation logs, and this PR adds a live dense-stream harness, but this review did not reproduce current main or the exact Windows/WSL2 real-Ollama setup.

Is this the best way to solve the issue?

Is this the best way to solve the issue? Likely yes if maintainers accept the compatibility tradeoff: centralizing accumulation and making hot-path deltas cheap is cleaner than repeated full snapshots, but the SDK contract change needs explicit approval.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 4bd711e1c424.

Label changes

Label justifications:

  • P1: The PR addresses a linked local-provider gateway starvation report affecting real agent/channel workflows and beta usability.
  • merge-risk: 🚨 compatibility: The public AssistantMessageEvent/plugin SDK contract now permits lightweight delta partials and replacement text deltas.
  • merge-risk: 🚨 message-delivery: The patch changes how streamed assistant text is accumulated and projected through agent-core, gateway, SDK, and UI delivery paths.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR includes after-fix live output from a real local gateway dense-stream run, AWS Crabbox changed-gate proof, and a real local Ollama daemon stream smoke; exact Windows/WSL2 proof remains a maintainer risk decision.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR includes after-fix live output from a real local gateway dense-stream run, AWS Crabbox changed-gate proof, and a real local Ollama daemon stream smoke; exact Windows/WSL2 proof remains a maintainer risk decision.
Evidence reviewed

PR surface:

Source +318, Tests +1116, Docs +8, Generated 0, Other +602. Total +2044 across 33 files.

View PR surface stats
Area Files Added Removed Net
Source 16 623 305 +318
Tests 13 1139 23 +1116
Docs 2 9 1 +8
Config 0 0 0 0
Generated 1 2 2 0
Other 1 602 0 +602
Total 33 2375 331 +2044

What I checked:

  • Repository policy applied: Root AGENTS.md and scoped guides for extensions, plugin SDK, gateway, agents, docs, UI, and scripts were read; the review treats plugin SDK stream contract and gateway delivery changes as compatibility-sensitive. (AGENTS.md:16, 4bd711e1c424)
  • PR surface inspected: The local PR head changes 33 files with 2375 insertions and 331 deletions across the stream contract, Ollama runtime, gateway, agents, SDK/UI, docs, and repro script. (14013f7b57d7)
  • Shared accumulator contract: The new accumulator keeps full boundary/final assistant messages while allowing lightweight delta partials and replacement text deltas. (src/llm/assistant-stream-accumulator.ts:77, 14013f7b57d7)
  • Ollama hot path: Ollama dense NDJSON parsing now yields cooperatively and native streaming emits accumulator-backed delta updates with lightweight partials. (extensions/ollama/src/stream.ts:1029, 14013f7b57d7)
  • Gateway delivery path: Gateway chat projection now carries replacement deltas and allows explicit empty replacement clears while preserving throttling for normal deltas. (src/gateway/server-chat.ts:506, 14013f7b57d7)
  • Public SDK documentation: The docs explicitly state that delta is the incremental source of truth, delta partials may be lightweight, and boundary/terminal events carry full content. Public docs: docs/plugins/sdk-provider-plugins.md. (docs/plugins/sdk-provider-plugins.md:379, 14013f7b57d7)

Likely related people:

  • osolmaz: Authored the central commits that add the dense stream repro and move Ollama/gateway streaming to the shared delta-first accumulator path. (role: current branch implementer; confidence: medium; commits: 64ea831a55e0, 16683d5e7ad2, 76ae0d79eed4; files: extensions/ollama/src/stream.ts, src/agents/embedded-agent-subscribe.handlers.messages.ts, src/llm/assistant-stream-accumulator.ts)
  • vincentkoc: Was assigned on the PR timeline and authored follow-up commits covering diagnostics, SDK export coverage, proxy replacement assertions, replacement clears, and terminal stream helper tests. (role: recent branch collaborator and likely follow-up reviewer; confidence: medium; commits: 4dc44dc06abd, b6207dac3c1f, 5ba1c014dce9; files: src/agents/embedded-agent-runner/run/attempt.model-diagnostic-events.ts, src/plugin-sdk/provider-stream-shared.test.ts, src/agents/runtime/proxy.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@osolmaz osolmaz changed the title test(gateway): add Ollama dense stream repro test(gateway): add dense stream latency repro May 28, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal backlog priority with limited blast radius. labels May 28, 2026
@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 28, 2026

ClawSweeper PR egg: ✨ hatched 🥚 common Sunspot Signal Puff. Rarity: 🥚 common. Trait: finds missing screenshots.

Details

Share on X: post this hatch
Copy: My PR egg hatched a 🥚 common Sunspot Signal Puff in ClawSweeper.
Hatchability:

  • Merged PRs are hatchable.
  • Open PRs are hatchable when they are status: 👀 ready for maintainer look, status: 🚀 automerge armed, or labeled clawsweeper:automerge.
  • Closed unmerged PRs are hatchable only when one of those hatchable labels is still present in the durable record.

About:

  • Eggs appear after real-behavior proof passes. They are collectible flavor only.
  • Review momentum changes the shell state: follow-up work warms it, re-review makes it wobble, and a clean final review lets it hatch.
  • The hatch is seeded from this repository and PR number, so the same PR keeps the same creature; the reviewed head SHA can only change safe visual details.
  • Rarity is just collectible sparkle: 🥚 common, 🌱 uncommon, 💎 rare, ✨ glimmer, and 🌈 legendary.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling extensions: ollama labels May 28, 2026
@osolmaz osolmaz changed the title test(gateway): add dense stream latency repro fix(gateway): keep dense stream updates incremental May 28, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. P2 Normal backlog priority with limited blast radius. labels May 28, 2026
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XL and removed size: L labels May 28, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label May 28, 2026
@osolmaz osolmaz requested a review from vincentkoc May 28, 2026 08:18
@vincentkoc vincentkoc self-assigned this May 28, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels May 28, 2026
@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label May 28, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels May 28, 2026
@osolmaz
Copy link
Copy Markdown
Member Author

osolmaz commented May 28, 2026

Final implementation report for the dense Ollama/gateway stream fix.

Summary:

  • Added a shared assistant stream accumulator and moved the Ollama dense stream path to lightweight delta partials.
  • Kept full assistant messages on boundary/final events, documented the stream contract, and propagated replacement text deltas through agent-core, proxy, embedded subscriber, BTW, live chat projection, and gateway merge paths.
  • Added the dense gateway latency repro plus focused regression tests for accumulator behavior, replacement deltas, lightweight/rich tool-call deltas, subscriber reset behavior, gateway text merge, and diagnostic/event accumulation.

Behavior addressed: dense Ollama-compatible streams no longer force repeated full partial snapshots through the gateway/subscriber hot path, reducing event-loop starvation risk while preserving full boundary/final messages.
Real environment tested: local macOS OpenClaw gateway with the PR head, using the live dense Ollama-compatible NDJSON repro server; CI checks on GitHub for commit 239f36d.
Exact steps or command run after this patch:

  • OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs packages/agent-core/src/agent-loop.test.ts src/gateway/server-chat.stream-text-merge.test.ts src/gateway/server-chat.agent-events.test.ts src/agents/runtime/proxy.test.ts src/agents/embedded-agent-subscribe.handlers.messages.test.ts src/agents/embedded-agent-subscribe.subscribe-embedded-agent-session.subscribeembeddedagentsession.test.ts src/agents/btw.test.ts src/llm/assistant-stream-accumulator.test.ts extensions/ollama/src/stream-runtime.test.ts src/agents/embedded-agent-runner/run/attempt.model-diagnostic-events.test.ts
  • node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.scripts.json
  • pnpm tsgo:core
  • pnpm tsgo:extensions
  • pnpm plugin-sdk:api:check
  • pnpm docs:list
  • pnpm docs:check-mdx
  • git diff --check origin/main...HEAD
  • node --import tsx scripts/repro-gateway-dense-stream-latency.ts --assert-responsive
  • pnpm build
  • codex review --base origin/main
    Evidence after fix:
  • Vitest: 15 files passed, 438 tests passed, 68.72s.
  • OX lint: passed.
  • tsgo core/extensions: passed.
  • plugin SDK API check: OK docs/.generated/plugin-sdk-api-baseline.sha256.
  • docs:list and docs:check-mdx: passed; MDX checked 657 files.
  • git diff --check: passed.
  • build: passed. Existing rolldown d.ts warning remains for packages/agent-core/src/harness/messages.d.ts.
  • Codex review: no actionable correctness issues found after the final fix.
  • GitHub checks: no failing or pending PR checks; relevant reported checks are pass or path-selected/skipped.
    Observed result after fix: the live dense-stream repro completed successfully with ackMs 94, runStatus ok, chatRequests 1, chatEvents 78, finalChars 500000, and during-stream ping errors 0.
    What was not tested: exact Windows/WSL2 plus real local Ollama daemon reproduction for issue [Bug]: Local model provider calls thread block gateway event loop on Windows beta; trivial infer run takes ~4 minutes #86599; this remains a proof-scope decision for maintainers.

@osolmaz osolmaz marked this pull request as ready for review May 28, 2026 10:34
@osolmaz
Copy link
Copy Markdown
Member Author

osolmaz commented May 28, 2026

Additional local live smoke after the final report:

Real local Ollama daemon path was available on this machine and passed a direct provider-stream smoke.

Command:

node --import tsx --input-type=module <<'EOS'
import { createOllamaStreamFn } from './extensions/ollama/src/stream.ts';

const streamFn = createOllamaStreamFn('http://127.0.0.1:11434');
const stream = await streamFn(
  {
    id: 'qwen2.5:0.5b',
    api: 'ollama',
    provider: 'ollama',
    name: 'qwen2.5:0.5b',
    contextWindow: 32768,
    maxTokens: 64,
    input: ['text'],
    cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
  },
  { messages: [{ role: 'user', content: 'Reply with exactly: live smoke ok' }] },
  { maxTokens: 16, temperature: 0, timeoutMs: 30000 },
);

let text = '';
let textDeltas = 0;
let done = false;
for await (const event of stream) {
  if (event.type === 'text_delta') {
    textDeltas += 1;
    text = event.replace ? event.delta : text + event.delta;
  }
  if (event.type === 'done') done = true;
  if (event.type === 'error') throw new Error(event.error.errorMessage ?? 'ollama stream error');
}
const finalMessage = await stream.result();
console.log(JSON.stringify({ done, textDeltas, streamedText: text.trim(), stopReason: finalMessage.stopReason, finalText: finalMessage.content.map((part) => part.type === 'text' ? part.text : '').join('').trim() }, null, 2));
if (!done || textDeltas === 0) process.exitCode = 1;
EOS

Observed result:

{
  "done": true,
  "textDeltas": 3,
  "streamedText": "live smoke ok",
  "stopReason": "stop",
  "finalText": "live smoke ok"
}

This adds real local Ollama daemon coverage on macOS. It still does not replace exact Windows/WSL2 real-Ollama proof for issue #86599.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui docs Improvements or additions to documentation extensions: ollama gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants