Skip to content

[Bug]: opencode-go provider streaming — API calls complete on provider side but gateway never receives stream termination signal #93610

Description

@ForceConstant

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

This has happened for at least a week now, now sure what version. But basically I see all my cron jobs fail, whereas if I run the task manually it works fine.

The opencode-go provider plugin intermittently fails to forward stream completion events from the provider API to the gateway runtime. The provider-side HTTP stream delivers tokens successfully, but the final [DONE] / stream-close signal is never propagated. The gateway sits stuck on model_call:stream_progress until stuckSessionAbortMs (600ms) kills it, resulting in "LLM request failed." and "Request was aborted" errors.

This affects any model routed through the opencode-go provider (observed on deepseek-v4-flash).

Symptoms

  • Cron jobs using opencode-go/{model} fail with "LLM request failed."
    
  • Session trajectory shows prompt.submitted → 600+ seconds of silence → model.completed (aborted=true, externalAbort=true)
    
  • Provider-side dashboard shows the API call completed normally with full token counts and no errors
    
  • Failover is never attempted despite fallbackConfigured: true (always surface_error)
    
  • Occurs intermittently — same jobs succeed on other days with identical configs
    

Steps to reproduce

  1. Configure a cron job using any model through the opencode-go provider (e.g., opencode-go/deepseek-v4-flash)
  2. Let it run during a routine schedule
  3. After ~10 minutes — observe "LLM request failed." error
  4. Check the provider dashboard — the API call shows as completed with partial or full output tokens

Expected behavior

Cron jobs to run completely.

Actual behavior

  • Cron jobs using opencode-go/{model} fail with "LLM request failed."

OpenClaw version

2026.6.6

Operating system

docker

Install method

docker

Model

opencode-go/deepseek-v4-flash

Provider / routing chain

openclaw->opencode-go

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Session Trajectory (from one affected run)

seq=1  session.started             05:00:01 EDT
seq=2  trace.metadata              05:00:01
seq=3  context.compiled            05:00:01
seq=4  prompt.submitted            05:00:01    18k total tokens
                          ⬐ 622 seconds of silence ⬏
seq=5  model.completed             05:10:23    aborted=true externalAbort=true
seq=6  trace.artifacts             05:10:23
seq=7  session.ended               05:10:23    promptError="This operation was aborted"

Key detail: model.completed at seq=5 shows:

The model produced 226 output tokens — visible on the provider side as a completed call — but model.completed only fired because the stuck-session recovery aborted it. The stream never closed naturally.
Gateway Log Entries (diagnostic)

stalled session: age=502s activeWorkKind=model_call
  lastProgress=model_call:stream_progress lastProgressAge=497s
  recovery=none

stuck session recovery: age=622s action=abort_embedded_run aborted=true

embedded_run_failover_decision:
  decision: surface_error
  provider: "opencode-go"
  fallbackConfigured: true
  aborted: true
  rawErrorPreview: "Request was aborted"

Impact and severity

Affected: opencode-go users
Severity: blocks cron jobs
Frequency: 90% of cron jobs are failing for me.
Consequence: Missed tasks

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.bugSomething isn't workingclawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:needs-live-reproClawSweeper 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:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.regressionBehavior that previously worked and now fails

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions